#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=`basename $0` SANDPIT=`pwd` . $(ade-config ade_share_prefix)/include/adetestsupport.sh ############################################################################## # # Purpose of test: to verify that symlinks are correctly ignored and do # no adversely affect the permissions of the file they # point to if the configuration file specifies they have # different permissions, regardless of whether the file or # the symlink is processed first. # ############################################################################## echo "creating base directories ..." mkdir $SANDPIT/root $SANDPIT/scans $SANDPIT/tmp $SANDPIT/config echo "setting up a config file ..." cat > $SANDPIT/config/test.conf < $SANDPIT/root/file_then_symlink/file_to_be_writable ln -s file_to_be_writable $SANDPIT/root/file_then_symlink/a_symlink echo "setting up symlink_then_file ..." mkdir $SANDPIT/root/symlink_then_file ln -s file_to_be_writable $SANDPIT/root/symlink_then_file/a_symlink true > $SANDPIT/root/symlink_then_file/file_to_be_writable echo "fixing their permissions ..." find $SANDPIT/root | fadfixperms $SANDPIT/config/test.conf - echo "examining the differences in permissions (expect no output) ..." ( cd $SANDPIT/root/file_then_symlink && find . | mkfad ) > $SANDPIT/tmp/file_then_symlink.fad ( cd $SANDPIT/root/symlink_then_file && find . | mkfad ) > $SANDPIT/tmp/symlink_then_file.fad faddiff $SANDPIT/tmp/file_then_symlink.fad $SANDPIT/tmp/symlink_then_file.fad echo "all done"