LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   file access/permissions (http://www.linuxquestions.org/questions/programming-9/file-access-permissions-404336/)

rblampain 01-17-2006 01:32 AM

file access/permissions
 
We need to have some user files normally readable but writable only through a program (html textarea).
For example the permissions of the files could be 400 or 444 but this program needs to set it to 600 or 660 or 666 (whatever) for the duration of the program which is run by the user.

What's the most convenient way of doing this? (Probably using PHP?)

Thank you for your help.

graemef 01-17-2006 08:03 AM

Hi,

First of all don't make it world writable unless you want to face the security issues that poses. If you are running php then that script will be run by the web server, so give the web server user (apache?) write permissions, either by making it the owner of the file or by belonging to the group.

Second make sure that you properly validate the data before writing it to the file.

graeme.

rblampain 01-18-2006 12:11 AM

Excellent. Thank you.


All times are GMT -5. The time now is 08:37 AM.