Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!02-newsfeed.univie.ac.at!01-newsfeed.univie.ac.at!Austria.EU.net!EU.net!nntp04.primenet.com!nntp.primenet.com!news.mathworks.com!newsfeed.internetmci.com!in3.uu.net!netnews.worldnet.att.net!newsadm From: ShadowTech Enterprises <shadow@he.net> Newsgroups: comp.unix.bsd.bsdi.misc,comp.unix.misc,comp.programming Subject: Perl Script Permissions Date: Fri, 23 Aug 1996 16:10:15 -0400 Organization: ShadowTech Enterprises Lines: 34 Message-ID: <321E1027.58DB@he.net> Reply-To: shadow@he.net NNTP-Posting-Host: 205.charlotte-1.nc.dial-access.att.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0b5aGold (Win95; I) Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:4695 comp.unix.misc:24730 comp.programming:27756 O.K., I am just learning how unix based systems work but I am having a problem and I just can't figure it out. I am reselling web site hosting space on an internet server on which I have an account. I am setting up accounts for other people as subdirectories to my account. I am trying to write a file managing CGI script in Perl that will allow my customers to access their account, change/create/move file and directories from a web page without issuing them a username or password of their own. They must operate totally under my username. So I have written the Perl code that will authenticate them based on a username/password database in my root directory. I have also written some code that will allow the user to 'cd' 'cp' 'cdup' 'chmod' 'rm' 'mkdir' and 'rmdir' by checking the input received and ensuring that only the files in that users directories are modified. What I am weak on, is the access permission structure of the BSD/OS system I am running on. The script runs fine for 'cd' using the 'chdir' perl command, and but when I try to implement 'chmod' using the perl command 'chmod' or a 'system' call or by using backticks I do not get any result other than a permission denied error for the perl command and oddly enough I get nothing at all when I use system calls or backticks, in fact the script just keeps on running with no effect. I've tried setting the permission on the script to 777 and u+s, with no effect but I don't really know exactly what that's doing. The other commands seem to have the same effect. (I got around it with 'cp' by actually opening, reading, and then writing the file to another file). Also, when I try to run the script from the shell (not from the web) a system ('chmod 755 filename') gives me a different error, something about an invalid file mode. Can someone please explain to me what's going on. I think I have bits and pieces but not the whole story. Can this be done? Does it have something to do with setuid? Any help will be appreciated, if you can, send me an e-mail or just reply. Dave Hagewood shadow@he.net