home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.20 / text0155.txt < prev    next >
Encoding:
Internet Message Format  |  1990-08-02  |  1.9 KB

  1. From:  Bob Lenk <rml@hpfcdc.fc.hp.com>
  2.  
  3. In article <404@usenix.ORG>,jfh@rpp386.cactus.org (John F. Haugh II) says:
  4.  
  5. > The conflict between 4.2.2.2 and System V setuid is that System V states
  6. >     "If the effective user ID of the calling process is super-user,
  7. >      the real user (group) ID and effective user (group) ID are set
  8. >      to uid (gid)."
  9. > and 4.2.2.2 states
  10. >     "(1) If the process has appropriate privileges, the setuid()
  11. >      function sets the real user ID, effective user ID, and the
  12. >      saved set-user-ID to uid."
  13.  
  14. The behavior required in 4.2.2.2 is understood to be the actual behavior
  15. of System V (at least Release 2, assuming that appropriate privilege
  16. means super-user).
  17.  
  18. > The first problem is that a program which is set-user-ID to an ID other
  19. > than super-user will behave quite differently when executed by root.
  20.  
  21. Correct.
  22.  
  23. > The second problem relates to processes which are set-user-ID to super-user.
  24.  
  25. Correct.
  26.  
  27. Contrary to the rationale, this behavior does not permit the application
  28. to toggle between the real and saved set-user-ID unless both are not the
  29. super-user's ID.
  30.  
  31. I'm not sure if this is contrary to the rationale, though it is more
  32. complete.  The third paragraph of B.4.2.2 (top of page 236) explains
  33. that the behavior for privileged processes is different.  The problem is
  34. that setuid() and setgid() are overloaded with two behaviors, and the
  35. behavior is selected by privilege (traditionally uid).  The fact that a
  36. portable POSIX application has no way to determine whether it is
  37. privileged makes this even worse.
  38.  
  39. > So, how does an application toggle between a non-super user and a super-user?
  40.  
  41. The only ways I know of are to use non-(POSIX/SysV) features or to use
  42. two processes.  The current draft of the 1003.1a supplement (formerly
  43. 1003.1b, *not* the 1003.1-1990 revision) introduces the functions
  44. seteuid() and setegid() to address this.
  45.  
  46.         Bob Lenk
  47.         rml@hpfcla.hp.com
  48.         hplabs!hpfcla!rml
  49.  
  50.  
  51. Volume-Number: Volume 20, Number 152
  52.  
  53.