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); |
What is your crontab line? It may be a PATH problem. You can set PATH in the crontab or specify full path to program.
|
Moved to Programming
|
Aiyaiyai.. this is a rooting just waiting to happen. Please configure and use sudo appropriately. And better yet, upgrade to something more recent than RH 4 or 5, that's like 10 years old by now.
|
He probably meant RHEL 4 & 5 :)
People tend to be a bit careless about that, unless they're old enough to remember using RH 4 & 5... |
All times are GMT -5. The time now is 07:17 PM. |