home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / hp / 14256 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.4 KB

  1. From: mintz@hpindda.cup.hp.com (Ken Mintz)
  2. Date: Fri, 18 Dec 1992 22:08:57 GMT
  3. Subject: Re: non-root mount
  4. Message-ID: <4310331@hpindda.cup.hp.com>
  5. Organization: HP Information Networks, Cupertino, CA
  6. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!europa.asd.contel.com!howland.reston.ans.net!usc!sdd.hp.com!col.hp.com!news.dtc.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!hpcss01!hpindda!mintz
  7. Newsgroups: comp.sys.hp
  8. References: <BzCsyy.KBx@rivm.nl>
  9. Lines: 51
  10.  
  11. > Does anyone know how to have non-root users use the mount command
  12. > as more and more users have their own cd-rom connected to their
  13. > workstation ?
  14.  
  15.   After some private interactions with Derko, the problem was in the 
  16.   implementation of his mountcd script.  An easy misunderstanding, as
  17.   you will see from my response below.
  18.  
  19. > $ cat /usr/local/bin/mountcd :
  20. > if [ $# -ne 1 ]
  21. >   [...]
  22.  
  23.   Aha!  Now this is all coming back to me.  I went down the same path of
  24.   confusion that you are on a long time ago.
  25.  
  26.   [...]
  27.  
  28.   [T]he problem is that we need to put "#!/bin/ksh" in the first line
  29.   of the script.  `chmod u+s /etc/mount` works because /etc/mount is a
  30.   program, not a script.
  31.  
  32.   [...]
  33.  
  34.   The explanation appears in the ksh(1) man page.  However, the structure
  35.   of the paragraph is poor, so it is not very clear.  (I missed it the
  36.   first time I read it long ago.)
  37.  
  38.   Find the "Execution" description.  Under there is a paragraph like:
  39.  
  40.     "The shell parameter PATH defines the search path for the directory
  41.      containing the command.  Alternative directory names are separated by
  42.         [...]
  43.      script file, which is a file of data for an interpreter.  If the first
  44.      two characters of the script file are #!, exec (see exec(2)) expects
  45.         [...]
  46.      parameters are removed in this case.  If the shell command file does
  47.      not have read permission, or if the setuid and/or setgid bits are set
  48.      on the file, the shell executes an agent to set up the permissions and
  49.         [...]"
  50.  
  51.   It is not obvious (I think), but the sentence about setuid __depends__ on 
  52.   the sentence about "#!".  That is, everything (?) below the "#!" sentence
  53.   applies __only__ to "#!" scripts.
  54.  
  55.   [...]
  56.  
  57. -- Ken Mintz
  58.  
  59. DISCLAIMER:  This response does not represent the official position of, or
  60. statement by, the Hewlett-Packard Company.  This response is provided for
  61. informational purposes only and is supplied without warranty of any kind. 
  62.