selftests/exec: include cwd in long path calculation
authorSteve Muckle <smuckle.linux@gmail.com>
Fri, 13 Oct 2017 04:44:57 +0000 (21:44 -0700)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 15 Nov 2017 15:01:42 +0000 (08:01 -0700)
commit2d80c92d6cae986e8f3f04e64dbea9883680ae1c
treed662412c2bccb69adda61de54848d1ee2305f80f
parentd54e9a8f4430d789a7b462b5318b1012d5643fd4
selftests/exec: include cwd in long path calculation

When creating a pathname close to PATH_MAX to test execveat, factor in
the current working directory path otherwise we end up with an absolute
path that is longer than PATH_MAX. While execveat() may succeed, subsequent
calls to the kernel from the runtime environment which are required to
successfully execute the test binary/script may fail because of this.

To keep the semantics of the test the same, rework the relative pathname
part of the test to be relative to the root directory so it isn't
decreased by the length of the current working directory path.

Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/exec/execveat.c