*BSD News Article 67327


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!odin.oar.net!malgudi.oar.net!imci4!newsfeed.internetmci.com!portal.gmu.edu!bugs.aditech.com!gmann
From: gmann@bugs.aditech.com (Glen W. Mann)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Does setuid work???
Date: 29 Apr 1996 22:08:29 GMT
Organization: ADI Technology Corporation Alexandria VA
Lines: 18
Message-ID: <4m3ekt$7ar@portal.gmu.edu>
NNTP-Posting-Host: 206.5.164.100
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Newsreader: TIN [version 1.2 PL2]

I have a script (perl 5) which needs to reset owner and permissions for
a directory tree and its (harmless nuisance) files.  I've got the script 
set to

  -rwsr-xr-x  1 root   bin     1234 somedate/time FixFiles

The script starts with #!/usr/bin/perl
that is no switches.  I'm using the perl chmod and chown functions.  The 
script only works if I run it as root.  As another user, it does nothing
(unless of course the permissions allow it).
Perhaps I am ignorant to the ways of setuid?  The documentation is a
little sketchy for this. Can I do what I want?

Any help for setuid?

Thanks
-Glen
gmann@bugs.aditech.com