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

  1. Xref: sparky comp.unix.programmer:5225 comp.mail.mh:1269
  2. Newsgroups: comp.unix.programmer,comp.mail.mh
  3. Path: sparky!uunet!caen!batcomputer!theory.TC.Cornell.EDU!mdw
  4. From: mdw@theory.TC.Cornell.EDU (Matt Welsh)
  5. Subject: Re: setuid programs and calls...
  6. Message-ID: <1992Nov10.022239.24060@tc.cornell.edu>
  7. Sender: news@tc.cornell.edu
  8. Nntp-Posting-Host: theory.tc.cornell.edu
  9. Organization: Cornell Theory Center
  10. References: <1992Nov5.220832.3217@spectrum.xerox.com> <1992Nov9.031112.21835@spectrum.xerox.com> <BxG21C.n38@cck.coventry.ac.uk>
  11. Date: Tue, 10 Nov 1992 02:22:39 GMT
  12. Lines: 25
  13.  
  14. In article <BxG21C.n38@cck.coventry.ac.uk> champion@cch.coventry.ac.uk (Alun) writes:
  15. >I didn't see the beginning of this thread so I don't know exactly what
  16. >you are trying to do.
  17. >But doesn't system(arg) runs "sh -c arg" and therefore has some of the security
  18. >problems of a setuid shell script. You have not specified the full path to
  19. >"inc" so someone could write their own version of "inc" and as long as the
  20. >environment variable $PATH was configured properly it would run their version
  21. >of "inc" and not the intended on - same with "id". 
  22. >Even if you did specify the full path it would still be susceptible to attacks
  23. >with $IFS.
  24.  
  25. Yeah, I agree. I generally stay away from "system" and instead do a
  26. fork-and-execv, which is more numinous, and doesn't have the security and
  27. overhead of executing a shell just to run a single command.
  28.  
  29. Using system() does make it easier to redirect output and run pipes via
  30. sh's > and | operators. If you use execv you'll have to "roll your own" to
  31. get that functionality.
  32.  
  33. mdw
  34.  
  35. -- 
  36. Matt Welsh    mdw@tc.cornell.edu        +1 607 253 2737
  37. Systems Programmer, Cornell Theory Center
  38.   "She's like jelly roll, like sculpture!"
  39.