Forum Moderators: coopster
it happens that I'm coding a script that parses html documents and alters them.
Lets say I have all them under
/home/user/htdocs/site.com/content/
and I have chmod 777 this folder with my FTP client.
The problem comes when a new folder is created within this one, when a user uploads new documents thru FTP.
Such users own the folder and documents, and the permission of them becomes 755.
Askin the users to chmod their uploaded folders to 777 everytime they do upload something is not a practical sollution...
So, the question is:
how can I make that all folders that user creates within the content/ folder are automatically writable by everyone?
thx!
make the content/ folder owned by php.
So I chmod'ed to 0777 the parent folder, and made
a php script that creates a new folder called content.
The problem is that the script can't set chmod this folder to 0777. Does not allow me to set the folder to be writable by everyone. (If not doing so, user can't upload files to that folder thru ftp... )
Any ideas on why php can't create a folder and set it to 0777? note: safe_mode is disabled in the server.
thx!
But not tht the php user is the owner of content/ folder, when an user uploads something in a new subfolder, such user is the owner of that folder with permission 0755 by default, so the script still can't write there...
Anyone has any ideas?
Secondly, you want to set the setuid bit on the directory permission.
Directories with this bit set will force all files and sub-directories created in them to be owned by the directory owner and not by the uid of the creating process
All new files and directories will then automatically be owned by the owner of the content/ directory.
So you're looking for something like chmod 4755 content/
So insead chmod ("folder", 4777);
it would be
chmod ("folder", 04777);
But even when I have done this, seems to have no effect in the FressBSD 4.7 server. As it is mounted in a nfs partition, perhaps it has disabled the setuid support...