|
version 1.1, 2012/02/17 15:09:30
|
version 1.1.1.3, 2021/03/17 00:32:36
|
|
Line 5
|
Line 5
|
| |
|
| # Test that rsync obeys directory setgid. -- Matt McCutchen |
# Test that rsync obeys directory setgid. -- Matt McCutchen |
| |
|
| . $srcdir/testsuite/rsync.fns | . $suitedir/rsync.fns |
| |
|
| umask 077 |
umask 077 |
| |
|
|
Line 23 testit() {
|
Line 23 testit() {
|
| check_perms "$todir/to/program" $4 "Target $1" |
check_perms "$todir/to/program" $4 "Target $1" |
| } |
} |
| |
|
| |
mkdir "$scratchdir/dir" |
| |
# Cygwin has a persistent default dir ACL that ruins this test. |
| |
case `getfacl "$scratchdir/dir" 2>/dev/null || true` in |
| |
*default:user::*) test_skipped "The default ACL mode interferes with this test" ;; |
| |
esac |
| |
|
| echo "File!" >"$scratchdir/file" |
echo "File!" >"$scratchdir/file" |
| echo "#!/bin/sh" >"$scratchdir/program" |
echo "#!/bin/sh" >"$scratchdir/program" |
| mkdir "$scratchdir/dir" | |
| chmod 2764 "$scratchdir/dir" || test_skipped "Can't chmod" | chmod u=rwx,g=rw,g+s,o=r "$scratchdir/dir" || test_skipped "Can't chmod" |
| chmod 664 "$scratchdir/file" |
chmod 664 "$scratchdir/file" |
| chmod 775 "$scratchdir/program" |
chmod 775 "$scratchdir/program" |
| |
|
| [ -g "$scratchdir/dir" ] || test_skipped "The directory setgid bit vanished!" |
[ -g "$scratchdir/dir" ] || test_skipped "The directory setgid bit vanished!" |
| mkdir "$scratchdir/dir/blah" |
mkdir "$scratchdir/dir/blah" |
| [ -g "$scratchdir/dir/blah" ] || test_skipped "Your filesystem doesn't use directory setgid; maybe it's BSD." |
[ -g "$scratchdir/dir/blah" ] || test_skipped "Your filesystem doesn't use directory setgid; maybe it's BSD." |
| |
|
| # Test some target directories |
# Test some target directories |
| testit setgid-off 700 rw------- rwx------ rwx------ |
testit setgid-off 700 rw------- rwx------ rwx------ |
| testit setgid-on 2700 rw------- rwx------ rwx--S--- | testit setgid-on u=rwx,g=rw,g+s,o-rwx rw------- rwx------ rwx--S--- |
| |
|
| # Hooray |
# Hooray |
| exit 0 |
exit 0 |