home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5206 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1023 b 

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: setuid programs and calls...
  5. Message-ID: <15390@auspex-gw.auspex.com>
  6. Date: 7 Nov 92 20:25:15 GMT
  7. References: <1de9ihINN98v@early-bird.think.com> <p7k1+ga@rpi.edu>
  8. Sender: news@auspex-gw.auspex.com
  9. Organization: Auspex Systems, Santa Clara
  10. Lines: 13
  11. Nntp-Posting-Host: bootme.auspex.com
  12.  
  13. >I have just a minor question, but how does a Sun executable program
  14. >find out its effective uid?  Whenever I trace a program I see that it
  15. >make makes a call to getuid but not geteuid.  I have always wondered
  16. >about this.
  17.  
  18. Do not confuse traps into the kernel with procedure calls.
  19.  
  20. Both the "getuid()" and "geteuid()" calls make the exact same trap into
  21. the kernel; the real and effective UIDs are returned in two different
  22. registers.  The "getuid()" routine returns the value in one of those
  23. registers; the "geteuid()" routine returns the value in the other.
  24.  
  25. "trace" traces traps into the kernel, not procedure calls.
  26.