home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8214 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.8 KB  |  41 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!lwvanels
  3. From: lwvanels@athena.mit.edu (Lucien W. Van Elsen)
  4. Subject: Re: setreuid() broken?
  5. In-Reply-To: gamiddle@math.waterloo.edu's message of Thu, 23 Jul 1992 22:41:04 GMT
  6. Message-ID: <LWVANELS.92Jul27111601@fionavar.mit.edu>
  7. Sender: news@athena.mit.edu (News system)
  8. Nntp-Posting-Host: fionavar.mit.edu
  9. Reply-To: lwvanels@MIT.EDU
  10. Organization: Massachusetts Institute of Technology
  11. References: <1992Jul23.224104.19277@math.waterloo.edu>
  12. Date: Mon, 27 Jul 1992 15:16:28 GMT
  13. Lines: 26
  14.  
  15. gamiddle@math.waterloo.edu (Guy Middleton) writes:
  16.  
  17. > Sorry if this has been mentioned here before, but I just started reading this
  18. > newsgroup.  setreuid() doesn't seen to work right:
  19. ...
  20. > This is crazy.  If my uid and euid are 0, how could I possibly get an
  21. > EPERM error?
  22. > Is there any way to get this to do what I expect?
  23.  
  24. You cannot change the effective UID without changing the real uid as well;
  25. this is documented in the setreuid "man page".  Theoretically, to do want
  26. you want, you'd use setuidx(ID_REAL|ID_EFFECTIVE,200)).  A similar call
  27. later on can set the real and effective uid's back to 0, since the saved uid
  28. is still 0.  
  29.    However, there is a problem with this that Charles Hannum
  30. (mycroft@ai.mit.edu) reported while back; I do not know whether it has been
  31. resolved it.  Apparently, setuidx() "does not change priviledge vectors" as
  32. setuid and seteuid do, which still allows the process to access files as if
  33. it were root.  Unfortunately, unless it has been fixed, you can't get the
  34. effect you wish.
  35.  
  36.     -Lucien
  37.  
  38. ----------------------------------------------------------------------------
  39. Lucien Van Elsen               | lwvanels@athena.mit.edu
  40. MIT Athena Systems Development |
  41.