home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!caen!news.cs.indiana.edu!umn.edu!gaia.ucs.orst.edu!skyking!stanley
- From: stanley@skyking.OCE.ORST.EDU (John Stanley)
- Newsgroups: comp.unix.admin
- Subject: Re: Shell script to invoke su and mount CD-ROM
- Date: 8 Jan 1993 18:49:57 GMT
- Organization: Coastal Imaging Lab, College of Oceanography
- Lines: 17
- Message-ID: <1ikiclINNftf@gaia.ucs.orst.edu>
- References: <1993Jan8.173010.18598@csi.uottawa.ca>
- NNTP-Posting-Host: skyking.oce.orst.edu
- Keywords: su, csh, cd-rom
-
- In article <1993Jan8.173010.18598@csi.uottawa.ca> glenn@popeye.genie.uottawa.ca (Glenn Warnock 789-3225 Algonquin Associate) writes:
-
- >We are trying to write a script which will invoke su and mount the CD-ROM,
- >but we cannot invoke su in the script and automatically give it the password.
- >
- >Any suggestions on how to solve this problem?
-
- Write a set-uid root perl script to do it.
-
- #!/usr/local/bin/suidperl
- $ENV{'PATH'} = '/bin:/usr/bin:/usr/ucb/bin:/usr/etc'; #security stuff
- $path = $ENV{'PATH'}; #security stuff
- $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne ''; #security stuff
- $ENV{'IFS'} = '' if $ENV{'IFS'} ne ''; #security stuff
- $< = $>; # real uid must be root for exportfs
- print `mount blah blah blah`;
-
-