home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / security / misc / 1708 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.2 KB  |  44 lines

  1. Newsgroups: comp.security.misc
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!rpi!fitzgb
  3. From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
  4. Subject: Re: Setuid script - is this unsecure?
  5. Message-ID: <6np1#gk@rpi.edu>
  6. Nntp-Posting-Host: mml0.meche.rpi.edu
  7. Organization: Rensselaer Polytechnic Institute, Troy, NY
  8. References: <1992Nov5.071354.24042@kth.se> <AMOSS.92Nov6102549@shuldig.cs.huji.ac.il>
  9. Date: Wed, 11 Nov 1992 04:59:53 GMT
  10. Lines: 32
  11.  
  12. Amos Shapira writes:
  13. >A general suggestion for a programme which will do what you want would be:
  14. >
  15. >main (ac, av)
  16. >    int ac;
  17. >    char **av;
  18. >{
  19. >    exec ("/usr/etc/mount", av);
  20. >}
  21. >
  22. >and have the object of this C programme suid root.
  23.  
  24. IMHO this is an extremely poor counterexample, since it lets the user
  25. mount anything, with any options.  That presents its own security
  26. risk.
  27.  
  28. Usually these special purpose mount wrappers are written with constant
  29. arguments for exec.  For example, someone (I don't recall who) posted a
  30. while ago:
  31.  
  32. char *env[]={"PATH=/usr/etc",(char*)0};
  33. char *argv[]={"/usr/etc/mount","/pcfs",(char*)0};
  34.  
  35. main()
  36. {
  37.         setruid(getuid());
  38.         execve("/usr/etc/mount",argv,env);
  39. }
  40.  
  41. and a similar program for a cdrom, and two more programs for unmounting.
  42.  
  43. Brian
  44.