I have a program that needs to be able to do the following under ISC 386/ix
(System V R3.2):
setuid to one of about 3 different accounts ("Account X")
do some work under that ID.
(*) setuid back to the ID of the person that originally ran it.
send some mail to Account X saying what was done.
The program needs to be able to change to one of the 3 or so different
accounts, so It's made setuid root. It doesn't actually want to do its
work under uid root, so it setuid's to whichever account it needs immediately.
[ It can't setuid to ANY account, only to one of the 3 or so ].
The problem is that when the program send the mail to X, I want it to come
addressed from the person that ran the program, not from X.
According to the manual, you can setuid() to the saved-uid from exec();
but I can't get the setuid back to the persons ID to work. (*)
Can anyone shed some insight on my problem?
/* Greyham Stoney: Australia: (02) 428 6476 *
* "BUT THAT'S JUST A BUTTON ON A STRING, BASICLY!!!" */