Jump to content

Recommended Posts

Hey folks. Not fully a PHP question, but I'm looking for some clarification.

 

I'm building a document management system where the files are stored on the server in user-created directories. The directories SEEM to need be to 777 for the user to upload documents. Of course, this seems like a bad idea security wise.

 

Is my best option to chmod the directory BEFORE the user uploads, then chmod it back? I'm not very up to speed on Unix stuff, so I'm not fully sure what the ramifications of the 777 permissions mean in the real world.

 

Any insight would be appreciated.

 

Thanks! Mikey

Link to comment
https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/
Share on other sites

Well, again, I don't really understand the Unix permissions all that well.

 

My understanding is that if I leave read/write permissions open (which 666 still allows) that some random person out on the internet is going to hack in and steal documents or upload files without permission. I would think that the safe permissions would be 755, so that no one can write to the folder. But then I have to code up some chmod stuff to change it when a file needs to be uploaded.

 

This is a brower/session based system and I don't know in the sense of "owner/group/user" where the actual logged in users fit. Does that make sense?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.