diff options
-rw-r--r-- | ChangeLog.txt | 2 | ||||
-rwxr-xr-x | test/test-cp-setuid.sh | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | test/test-tclsh-fork.sh | 0 |
3 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 3aa4758..e757596 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,8 @@ * (seebs) fix path stuff more thoroughly. * (seebs) Merge suggested README change from Richard Tollerton <rich.tollerton@ni.com> pointing to oe-core list. + * (seebs) Merge suggested setuid/etc bit change from + Richard Tollerton, and associated test case. 2018-03-29: * (seebs) wrap syscall, and if SYS_renameat2 exists, try to diff --git a/test/test-cp-setuid.sh b/test/test-cp-setuid.sh new file mode 100755 index 0000000..cdb2cd3 --- /dev/null +++ b/test/test-cp-setuid.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +# Verify that special bits (setuid/setgid/sticky) are preserved. +# +# Return vals: +# +# 2 - Incorrect permissions +# All other nonzero - Unexpected command error +# 0 - Pass + +trap "rm -rf d1 d2" EXIT + +mkdir d1 +chmod 7777 d1 +cp -Rp d1 d2 +perms=`ls -od d1 d2 | cut -c 1-10 | uniq` +if [ "$perms" != drwsrwsrwt ]; then + exit 2 +fi + + +exit 0 diff --git a/test/test-tclsh-fork.sh b/test/test-tclsh-fork.sh index e9dec66..e9dec66 100644..100755 --- a/test/test-tclsh-fork.sh +++ b/test/test-tclsh-fork.sh |