I want users to be able to upload files to a central file server via my PHP script. I mounted the file server's shared volume using this command:
sudo mount -t cifs //192.168.1.8/share local_dir -o username=user,password=pass
Whilst I could
sudo chmod my way to write access, there are hundreds of directories which already exist:
drwxr-xr-x 1 root root 0 2011-03-30 15:59 dir1 drwxr-xr-x 1 root root 0 2011-04-04 16:27 dir2 drwxr-xr-x 1 root root 0 2011-04-04 18:07 dir3 drwxr-xr-x 1 root root 0 2011-04-06 13:41 dir4 drwxr-xr-x 1 root root 0 2011-04-06 13:39 dir5 ....etc
I may need to create a new directory or move the uploaded file to an existing directory.
Is there anything I can do to make this share writeable by any user? The only other solution I can think of is to have Apache run as root. I won't be doing that.