Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: mcvax!olsen!nagler@uunet.uu.net (Robert Nagler) Newsgroups: comp.sys.sun Subject: s[et]uid doesn't work Message-ID: <8901251251.AA22111@klaus.olsen.uucp> Date: 31 Jan 89 20:45:57 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu Original-Date: Wed, 25 Jan 89 13:51:33 +0100 X-Sun-Spots-Digest: Volume 7, Issue 130, message 10 of 17 Loki Jorgenson writes: > I have set a root owned sh or csh script file with the mode 4755 > and tried to execute it as user..... but this doesn't work.... Had a similar problem recently. Here's a clip from the "csh" manual: -b Force a "break" from option processing. Subsequent command-line arguments are not interpreted as C-Shell options. This allows the passing of options to a script without confusion. The shell does not run a set-user-ID script unless this option is present. I don't know why this is required, but it was sure difficult to find. Therefore you must do what the moderator suggests with a twist for csh scripts: Put "#!/bin/csh -b" at the top of the file. [[ Oh yeah. That tripped me up, too, awhile ago. Can't believe I forgot it, because I was pretty mad (at the time) when I finally figured it out. Sun actually made that change quite awhile ago: you need "-b" under 3.2, for example. I'm not sure, but I think the change was made in version 3 (that is, starting with 3.0). --wnl ]]