Click to See Complete Forum and Search --> : chmod in C


jcampbe
07-05-2006, 09:20 PM
I need to find a way to chmod peoples directories without root privilages.
Can I actually do this?

Thx. in advance

-Jcampbe

NogDog
07-05-2006, 09:33 PM
Only the file owner or a root user can chmod a file. If you set the ownership of your executable to the root user (which would have to be done as root) and either setuid on the file or use sudo, then it could be run with root's privileges. Of course, this has some obvious security implications which you need to think about before going this route.