file permissions and SUID
hi,
i have recently created a script that performs an rsync between 2 directories. it then ensures that the directory that was "sync'ed" has the correct permissions (it is a web directory so needs apache permissions...)
so within my shell script, there is a call to an "rsync" and another to a "chown"
i can run this script fine when logged in as root (the creator of the file) and also when i have it scheduled as a cron job (as it runs as root).
i would like any other user to be able to manually run it at any time though (in case they cannot wait for the next 5 mins!!)
i changed the SUID so the file perms are:
-rwsr-xr-x
this should allow any person to run the script with correct perms. but i recieve the following outputted errors:
[user@hostname ftp]$ ./syncweb.sh
RSYNCing the FTP and apache areas
building file list ... opendir(images): Permission denied
done
IO error encountered - skipping file deletion
wrote 270 bytes read 20 bytes 580.00 bytes/sec
total size is 54667 speedup is 188.51
rsync error: some files could not be transferred (code 23) at main.c(620)
Changing Permissions in web directory
chown: `/var/www/html/images': Permission denied
have i set this up right? do i need to set the SUID on both the rsync and chown apps aswell so that they can be run in elevated priveleges? this is not something i want to do though!!
any help would be appreciated
jingo_man
|