[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how do I use UID setting?



I think this is an incredibly basic question.  I want to use a cgi-bin 
executable behind https security (i.e. fairly secure) that will copy 
files uploaded using ftp (insecure) into my www document 
directories (not an area I want open for write access!).  The issue 
seems to be my failure to understand the "first" chmod byte setting 
of the owner = user bit with chmod 4755.

Apache is running as nobody according to httpd.conf (is this why I 
it shows using ps ax but not using ps axl?)  I have a program, cp, 
chmod 4755 and owner chris, i.e. owned by the owner who has 
write permissions in the www root.  

However, when I execute this program after su nobody the copy 
reports it doesn't have the permissions to do the create side of the 
copy built in.  Here's the listing:

1 -rwsr-xr-x 1 chris root 59 359 Feb 6 22:47 cp

Here's the program:

#!/bin/sh
DATE=/bin/date
echo Content-type: text/plain
echo
whoami
ps axl
cp -Rv /usr1/philftp/main/* /var/www/visped
whoami
ps axl

The whoami reports "nobody" not "chris" (is that what you'd expect 
gurus?), the cp, which is what I want, reports insufficient 
permissions to create the files in the copy.  

If I su chris the copies take place fine and I've confirmed that file 
and directory permissions for the target of the copy (in the www 
root directories) are O.K.

Someone point me to the right answer and/or the right 
documentation!  

TIA,


Chris





PSYCTC: Psychotherapy, Psychology, Psychiatry, Counselling
   and Therapeutic Communities; practice, research, 
   teaching and consultancy.
Chris Evans & Jo-anne Carlyle  Tel/fax.:(+44|0)181-671 0868 
http://psyctc.org/ Email: chris@psyctc.org


Reply to: