Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!sdd.hp.com!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.wizards Subject: Re: setuid? Message-ID: <1990May7.172952.25097@iwarp.intel.com> Date: 7 May 90 17:29:52 GMT References: <1990May7.020504.26757@icase.edu> <3830@castle.ed.ac.uk> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 37 In-Reply-To: egnu02@castle.ed.ac.uk (M Rae) In article <3830@castle.ed.ac.uk>, egnu02@castle (M Rae) writes: | In article <1990May7.020504.26757@icase.edu> arras@icase.edu (Michael Arras) writes: | > | > I have a shell script I would like other users to run as myself. I | >tried: | > | >% chmod +s myfile | > | | Use chmod giving the octal permission values | | % chmod 4711 myfile | | which gives -rws--x--x permissions. | REAL wizards always do it this way :) But REAL wizards wouldn't have asked this question in c.u.w, because it is *inappropriate*. And, a real wizard would also tell you that (1) setuid shell scripts are pretty durn dangerous (and anybody that can't even handle turning on the setuid bit almost certainly shouldn't be turning it on in a SHELL script), and (2) setuid shell scripts don't work on most earlier UNIXes, because the shell is interpreting the script. (You need a '#!'-convention, or that other hack that S5 threw in to get setuid shells to work.) Besides, fledgling wizards should be taught to type: chmod u+s myfile until they get their octal down pat. Just another UNIX wizard, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/