I wanna run some script with root priviliges but by apache user. So I added SUID bit to script file but this doesn't work as I expected.
Script file owner is root.
rwsr-xr-x 1 root root 2438 paź 8 12:10 script.sh
When I run this from bash as root everything works fine... but when I run this as apache user(it's launched by svn hook post-coomit script runing as apache) I'm getting some permission denied messages.
This is strange to me or I misundestood the mining of SUID bit. (users will get file owner’s permissions as well as owner UID and GID when executing a file/program/command.)
So what is the difference. Should I add proper line to /etc/sudoers that will enable runing that script as root...