Why won't redhat 4/5 cron run my setuid root program?
I have a setuid root program. Works fine from the command line. I am running RedHat RHEL 4 & 5. Will not run when put in my crontab. I have tested the usuals - crontab line is correct (i.e., runs successfully if the program does not suid() to root)
I believe this to be a cron restriction that limits transitioning from root (which is running cron) to the userid of the crontab to run the command in the crontab line back to root (which my program does). If I run the same program under at, I get the same behavior (i.e., the command is scheduled and does not run successfully).
Here is the heart of the program
setuid(rootUid);
setgid(rootGid);
char * myCommand = getCommandString(argc, argv, myUid, myGid);
pid_t pid = fork();
if (pid == 0) system(myCommand);
Last edited by wingram77090; 02-25-2010 at 09:17 AM.
Reason: update to be more specific and answer questions from posts
|