3 # Run a backup of the Bacula build directory with some acls
6 # The fs have to be mount with the acl option (mount -o remount,acl,user_xattr /tmp)
7 # on ubuntu, it needs the attr package
9 # For this script to work, you will also need a number of acl packages loaded
10 # not default on Debian derivatives:
11 # apt-get install acl libacl1 libacl1-dev attr
13 TestName="backup-acl-test"
22 # Zap out any schedule in default conf file so that
23 # it doesn't start during our test
26 echo "s% Schedule =%# Schedule =%g" > $outf
27 echo "s/Options {/Options { aclsupport=yes; xattrsupport = yes/" >> $outf
28 cp ${cwd}/bin/bacula-dir.conf $cwd/tmp/1
29 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
37 cp ${cwd}/bin/bconsole $d
38 setfacl -m d:user:$uid:r-x $d/testdir
39 setfacl -m d:user:root:-wx $d/testdir
40 setfacl -m user:nobody:--- $d/testdir
41 setfacl -m user:nobody:--- $d/bconsole
42 setfacl -m group:nogroup:--x $d/bconsole
43 cp ${cwd}/bin/bconsole $d/testdir
44 cp ${cwd}/bin/bconsole $d/other
45 setfattr -n bacula.test -v rulez $d/other
48 getfacl -R acl > $cwd/tmp/org
49 getfattr -R acl > $cwd/tmp/attr.org
52 change_jobname BackupClient1 $JobName
55 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
58 @$out ${cwd}/tmp/log1.out
59 label volume=TestVolume001 storage=File pool=Default
60 setdebug level=400 trace=1 client
61 setdebug level=300 trace=1 director
62 setdebug level=300 trace=1 storage
69 @$out ${cwd}/tmp/log2.out
70 restore where=${cwd}/tmp/bacula-restores select all done
79 check_for_zombie_jobs storage=File
82 ( cd $cwd/tmp/bacula-restores/$cwd/build
83 getfacl -R acl > $cwd/tmp/new
84 getfattr -R acl > $cwd/tmp/attr.new
87 diff $cwd/tmp/org $cwd/tmp/new
92 diff $cwd/tmp/attr.org $cwd/tmp/attr.new
100 if [ x$REGRESS_DEBUG != x ]; then