home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.security.misc
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!rpi!fitzgb
- From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
- Subject: Re: Setuid script - is this unsecure?
- Message-ID: <6np1#gk@rpi.edu>
- Nntp-Posting-Host: mml0.meche.rpi.edu
- Organization: Rensselaer Polytechnic Institute, Troy, NY
- References: <1992Nov5.071354.24042@kth.se> <AMOSS.92Nov6102549@shuldig.cs.huji.ac.il>
- Date: Wed, 11 Nov 1992 04:59:53 GMT
- Lines: 32
-
- Amos Shapira writes:
- >A general suggestion for a programme which will do what you want would be:
- >
- >main (ac, av)
- > int ac;
- > char **av;
- >{
- > exec ("/usr/etc/mount", av);
- >}
- >
- >and have the object of this C programme suid root.
-
- IMHO this is an extremely poor counterexample, since it lets the user
- mount anything, with any options. That presents its own security
- risk.
-
- Usually these special purpose mount wrappers are written with constant
- arguments for exec. For example, someone (I don't recall who) posted a
- while ago:
-
- char *env[]={"PATH=/usr/etc",(char*)0};
- char *argv[]={"/usr/etc/mount","/pcfs",(char*)0};
-
- main()
- {
- setruid(getuid());
- execve("/usr/etc/mount",argv,env);
- }
-
- and a similar program for a cdrom, and two more programs for unmounting.
-
- Brian
-