Need help with setuid() problems on 386/ix with setuid root program.

Need help with setuid() problems on 386/ix with setuid root program.

Post by Greyham Ston » Wed, 25 Apr 1990 14:13:11



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?

                                        thanks
                                                Greyham.
--
/*  Greyham Stoney:                            Australia: (02) 428 6476  *

 *          "BUT THAT'S JUST A BUTTON ON A STRING, BASICLY!!!"           */

 
 
 

Need help with setuid() problems on 386/ix with setuid root program.

Post by Conor P. Cahi » Fri, 27 Apr 1990 22:26:35



>    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.

This is what you need to do:

        determine uid to do the stuf as
        fork
        in child
                set user id to that user id
                do your stuff
                exit
        wait for child to complet
        set user id to real user id
        mail the message
--
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170

 
 
 

1. 386/ix mailx as distributed with 386/ix

I am having problems with mailx as distributed with 386/ix when
responding to messages.

Check the rmail line in this out:

U larry nstar
# return status on failure
Z
# return address for status or input return
R larry
F D.nstar7606d84
I D.nstar7606d84
C rmail iuvax!ames!claris!apple!uuwest!vox.darkside.com!root iuvax!uiucuxc!egg-id!ucdavis!ucdavis!apple.com!nstar!larry

I replied to a message from vox!root - and check out the path to vox - which
is fine - followed by the secondary path back to nstar (my machine).  This
only happens when using mailx - not mail.

--
The Northern Star Public Access Unix Site, Notre Dame, Indiana USA

USR HST 219-287-9020 * PEP 219-289-3745 * Hayes V9600 219-289-0286

2. (not another) sunpci question

3. HELP: setuid root program can't verify passwords???

4. shrink /usr

5. VP/ix and 386/ix

6. CD-RW power calibration?

7. Help- PING needed, not setuid root

8. Old Unix

9. Help! need setuid c program example

10. Help! need setuid example program

11. help: pppd and setuid-root problem

12. setuid-root programs and pipes to other processes

13. setuid root program seeks same