Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing effective user

Status
Not open for further replies.

izivt

Programmer
Jun 26, 2001
17
US
I am in the process of making a web-based mail autoresponder for a network with more than 400 users. Since it is a security risk to run the actual server as a root, I decided to submit the requests to a specific folder, and have a cron running every 5 minutes or so to execute the requests. The problem I am having is with the actual script that is ran by cron. The script has to send an at command from the user, requesting the service, which would activate the vacation program sometime in the future for that user, and then pipe the output of the at command back to get the job number for future reference.






I am not sure how I would accomplish this task. I have played around with the $> and the $< but i have not had any success actually sending a specific command from a different user.













if anyone has a suggestion, it would be very appreciated!!! Thanks :)













-vit






 
alright.. never mind... I got it =)
 
In case anyone else has the same problem, you might post HOW you got it. Thanks. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
yeah, no problem :)

it was pretty much nothing actually. The only thing I had to do was to set the effective user($>) and the real user($<) variables to the desired UID and would run that process as that user.
For some reason I thought it was more complicated than that. I was looking for a function kind of like seteuid() in c++, but I didn't realize that how simple it really was -=).. hope that helps, if anyone ever runs in to that.
 
and by set, I mean just make it equal to whatever UID.
i.e.
$>=501;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top