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