tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setreuid(2)?



>> What am I missing?

> Nothing.

> Using the saved id's is only an alternative ([...]) if the sole aim
> of using setreuid() ([...]) is to allow a setuid process perform some
> operations as the real uid, and then revert to the effective uid once
> those are done.

OK, so the real problem is that the manpage overstates the case for its
obsolescence.  I'll file a PR.

> For what you need (which is somewhat unusual) only setreuid() will
> work - or until we add [sg]res[ug]id() [...]

Yes, it's unusual.  It's for testing.  I've just designed (and
implemented a basic version of) something a bit like sockets where
addresses are process IDs.  (Sockets won't actually work without
significant internal overhaul, at least in the OS versions I'm working
with, so I'm going with DTYPE_MISC and a custom ops vector.)  One of
the things I wanted was something a bit like AF_LOCAL's LOCAL_PEEREID,
so to test it I wanted each process to have distinctive UID and EUID.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index