From 240fca38bfb128ccf767ebe8ec1b7c1137b36620 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sat, 5 Sep 2009 22:17:19 +0200 Subject: [PATCH] Add acl script code for Mac --- regress/tests/acl-xattr-test | 47 ++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/regress/tests/acl-xattr-test b/regress/tests/acl-xattr-test index 6e1c89f122..e1e827cab9 100755 --- a/regress/tests/acl-xattr-test +++ b/regress/tests/acl-xattr-test @@ -50,19 +50,40 @@ rm -rf $d mkdir $d mkdir $d/testdir cp ${cwd}/bin/bconsole $d -setfacl -m d:user:$uid:r-x $d/testdir -setfacl -m d:user:root:-wx $d/testdir -setfacl -m user:nobody:--- $d/testdir -setfacl -m user:nobody:--- $d/bconsole -setfacl -m group:nogroup:--x $d/bconsole -cp ${cwd}/bin/bconsole $d/testdir -cp ${cwd}/bin/bconsole $d/other -attr -s bacula.test -V rulez $d/other 2>/dev/null 1>/dev/null - -( cd $cwd/build - getfacl -R acl > $cwd/tmp/org - attr -g bacula.test $d/other > $cwd/tmp/attr.org -) + +case `uname -s` in + Linux) + setfacl -m d:user:$uid:r-x $d/testdir + setfacl -m d:user:root:-wx $d/testdir + setfacl -m user:nobody:--- $d/testdir + setfacl -m user:nobody:--- $d/bconsole + setfacl -m group:nogroup:--x $d/bconsole + cp ${cwd}/bin/bconsole $d/testdir + cp ${cwd}/bin/bconsole $d/other + attr -s bacula.test -V rulez $d/other 2>/dev/null 1>/dev/null + + ( cd $cwd/build + getfacl -R acl > $cwd/tmp/org + attr -g bacula.test $d/other > $cwd/tmp/attr.org + ) + ;; + Darwin) + chmod +a "user:$uid allow read execute" $d/testdir + chmod +a "user:root allow write execute" $d/testdir + chmod +a "user:nobody deny read write execute" $d/testdir + chmod +a "user:nobody deny read write execute" $d/bconsole + chmod +a "group:nogroup allow execute" $d/bconsole + cp ${cwd}/bin/bconsole $d/testdir + cp ${cwd}/bin/bconsole $d/other + xattr -w bacula.test "rulez" $d/other 2>/dev/null 1>/dev/null + + ( cd $cwd/build + ls -lde -R acl > $cwd/tmp/org + xattr -p bacula.test $d/other > $cwd/tmp/attr.org + ) + ;; +esac + change_jobname BackupClient1 $JobName start_test -- 2.39.5