Forum Moderators: coopster

Message Too Old, No Replies

permissions tutorial

         

scorpion

9:07 pm on Apr 28, 2003 (gmt 0)

10+ Year Member



If you do an fopen with 'w' on an existing file and it is overwritten later with fwrite, is the permission of the new file the same as the old, or it defaults?

Also, is there a tutorial on how to setup PHP scripts on you server such that they are secure, operational and how to set file permissions properly? This is causing me a big headache!

daisho

10:14 pm on Apr 28, 2003 (gmt 0)

10+ Year Member



If you do an fopen with 'w' it truncates it. Meaning that the file is never deleted only emptied out. Theirfore the permissions stay the same.

As for a security tutorial what is your platform?

scorpion

10:17 pm on Apr 28, 2003 (gmt 0)

10+ Year Member



I think its a unix box running apache 1.3.xx. The shell is bash.

daisho

1:55 pm on Apr 29, 2003 (gmt 0)

10+ Year Member



Unix or Linux?

If it's on linux rather than reinventing the wheel I would check out [hackinglinuxexposed.com...]

2 articles in perticular "Linux File Permission Confusion" and "Linux File Permission Confusion pt 2". That will be a good start.

Might I suggest if this thread is going to continue we may want to do it in the Linux/Unix forum rather than the scripting forum.

daisho