cuserid sometimes lies!!

Russell J Fulton;ccc032u russell at ccu1.aukuni.ac.nz
Mon Feb 18 16:03:56 AEST 1991


The cuserid() call sometime lies! 

We have a setuid program that used cuserid
to find out who was running the program.( Some users are priviledged.)
We soon noticed that cuserid sometimes returned the wrong login name! and
we had to swap over to using getpwuid to find the login name of the user.
In some cases it is predictably wrong eg. if the program is executed from
a shell in Unipress emacs cuserid always returns telnet. But in other cases
it seems to pick a random (valid) logname.

Is this a known problem ? In any case we are reporting it as a bug.

Russell.

-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton at aukuni.ac.nz>



More information about the Comp.sys.sgi mailing list