From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a1fe009cb39103d4 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-03-08 09:26:32 PST Path: bga.com!news.sprintlink.net!cs.utexas.edu!swrinde!gatech!udel!news.mathworks.com!solaris.cc.vt.edu!csugrad.cs.vt.edu!csugrad.cs.vt.edu!not-for-mail From: msimons@csugrad.cs.vt.edu (Mike Simons) Newsgroups: comp.unix.osf.osf1 Subject: Re: Help: Set-user-ID Date: 8 Mar 1995 11:02:02 -0500 Organization: Virginia Tech Computer Science Dept, Blacksburg, VA Distribution: world Message-ID: <3jkkdq$pbs@csugrad.cs.vt.edu> References: NNTP-Posting-Host: csugrad.cs.vt.edu X-Newsreader: TIN [version 1.2 PL2] Robert Blake (rpblake@ASSP01.open.ac.uk) wrote: : I've been trying to write a shell script that other users can run and appear : to be me for the duration of the command. I'm using Alpha OSF/1 v1.3. : I've written a very simple shell script called fred: : #!/bin/sh : echo Hi!! : whoami : rm /usr/user1/temp/test~ : test~ is a file that only user1 has write permission to. Having written this as : user1, I then 'chmod 4655 fred' so the permissions look thus: : -rwSr-xr-x 1 user1 physics 117 Mar 07 14:53 fred : Anyone any idea what I'm doing wrong? Well... If I understand things correctly OSF ignores the set UID and GID bits for script files of any type. Basically if binary file then it checks the UID and GID bits... and sets the appropriate permissions on the process otherwise it runs with the permissions of the user who invoked the script. Apparently SID and GID script files have been and are a real big security whole on Unix systems... so OSF decided to do away with the whole problem. What I would recommend (and what I was told) is to write a short c-program to do whatever you were going to do, compile it, and then set UID on that. Hope that helps, Mike Simons msimons@csugrad.cs.vt.edu