Switching Users or Chowning

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Switching Users or Chowning

Post by mchaggis »

Hi,

I have a webserver, that also doubles as a file server. While I can mount the file server side using samba and copy files etc with permission being all correct. I would like to also give the ability to use HTTP Uploads (when I am round a mates house for example) that I can logon to the webserver and upload to my home directory.

Now the problem I face is that of course the webserver runs as nobody and thus has no permission to write to the actual home directory or chown the files (for neatness)

I am using the following to command to authenticate into the box, which works well:
smbclient //localhost/$username $password -U$username -c lcd

and I suppose that I could use:
smbclient //localhost/$username $password -U$username -D $dest_dir -c put $filename

It seems pointless to do this when i have access to the local system directly

I don't think there is a way of switching the user that a script runs as tho :(
devmatch
Forum Newbie
Posts: 19
Joined: Thu Mar 27, 2003 3:58 am

sounds simular

Post by devmatch »

you have to write a script with move_uploaded_file... like the examples from the forum topic: sorry i don`t know the thread:( search,please...
imo it's the simular problem like fileupload under windows:( do you know a solution for changing permissions like r to rw under unix systems?
cu
Post Reply