diff options
author | ngie <ngie@FreeBSD.org> | 2017-06-02 00:27:08 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2017-06-02 00:27:08 +0000 |
commit | c7cc0295fb63c4851a344a29e2ce640ad5f2db39 (patch) | |
tree | d3068767aa372079864e6beb66ba27a8fc878f1f | |
parent | ec4bb68a39a5fb566af253e631612fb4696ee785 (diff) | |
download | FreeBSD-src-c7cc0295fb63c4851a344a29e2ce640ad5f2db39.zip FreeBSD-src-c7cc0295fb63c4851a344a29e2ce640ad5f2db39.tar.gz |
MFC r318210:
ssp_test:read:: query the value of MAXPATHLEN via getconf(1)
In the event the value of PATH_MAX was changed, the assumption that
MAXPATHLEN is 1024 (and hence the buffer length required to trigger
SSP to fail for read(2)) would be invalidated. Query getconf(1) for
the actual value of MAXPATHLEN via _XOPEN_PATH_MAX instead, and
increment the value by 1 to ensure that the SSP support tests the
stack smashing support properly.
-rwxr-xr-x | contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh index e535e3e..91147a1 100755 --- a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh +++ b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh @@ -392,7 +392,8 @@ read_body() h_fail "$prog 1027" "echo bar |" else # End FreeBSD - h_fail "$prog 1025" "echo bar |" + MAX_PATH=$(getconf _XOPEN_MAX_PATH) || atf_fail "getconf failed" + h_fail "$prog $(( $MAX_PATH + 1))" "echo bar |" # Begin FreeBSD fi # End FreeBSD |