euglug.org

[Eug-lug] setuid programs

작성자

카테고리:



Jim BeardFri Feb 18 14:24:39 PST 2005

Howdy Folks,

	So we have been having some funky permission problems involving 
commits and lock files with our CVS installation.  To solve these 
issues I was planning on executing a script from CVSROOT/loginfo to 
clean up the repository permissions.  Originally I wrote a shell script 
to do this then made it setuid.  However I now realize that linux 
generally ignores setuid on shell scripts for security reasons.  
Sooo... I wrote a simple C executable using execl and execlp, however 
neither of them seem to work.

The C code looks like this:

#include <unistd.h>

int main () {
   execl("/bin/chown", "-R server /var/cvs/repository");
   execl("/bin/chgrp", "-R", "server", "/var/cvs/repository");
   execl("/bin/chmod", "-R o+w /var/cvs/repository");
}

Anyone know why this isn't working?  Anyone have a better solution to 
my problem?


Jim Beard
counterclaim.com, Inc
http://www.counterclaim.com
http://openefm.sourceforge.net
(800) 264-8145