weemikey Posted January 9, 2008 Share Posted January 9, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/ Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 666 wont work? Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/#findComment-434783 Share on other sites More sharing options...
weemikey Posted January 9, 2008 Author Share Posted January 9, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/#findComment-434790 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 Move the file after it's uploaded to a secure area. Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/#findComment-434793 Share on other sites More sharing options...
weemikey Posted January 9, 2008 Author Share Posted January 9, 2008 Okay, I'll set something like that up. Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/#findComment-434799 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 Probably different ways, was just a sugestion on my part. Quote Link to comment https://forums.phpfreaks.com/topic/85226-solved-security-and-directory-access/#findComment-434804 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.