Gossamer Forum
Home : Products : Links 2.0 : Customization :

Permissions!! Once and for ALL!!

Quote Reply
Permissions!! Once and for ALL!!
Hi,
In the past I've had permissions problems..like when doing a mod sometimes instead of the cgi script running, in ie, the viewer will be prompted to download the whole cgi script...

So I want to ask, what is the general rule about permissions on files and directories?

My understanding is that cgi-bin and similar directories should be chmod'ed to 755, and the same for any scripts...this would mean that the owner can read, write and execute, and the group and the world can only read and execute, but not write. Am I correct?

But if the world can "read" all files, then will it be possible to stop them from reading cgi?

This is such a confusing topic because the behaviour in reality appears to be different than the many articles, books I've read dealing with this topic!

One final question...why is it necessary for a directory to have a permission? Doesn't the file's permission override the directory's permission? THANKS!
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
usually when it downloads teh file it's cause you don't have a content type header..

like:

print "Content-type: text/plain\n\n";

or

print "Content-type: text/html\n\n";
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
755 rwx r-x r-x

for cgi-bin and .cgi files.. this lets them execute the file.. that is why cgi files "download" if it contains any content..

but if you put a content type.. it will change the format from an executable to a text format.. and it prints it out instead of "executing" and downloading it..

get that?

Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
Yes, thanks..very interesting...was wondering about meaning of the content type...

what about the need for a directory to have a permission?
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
if the dir is chmod 755.. it will execute whatever needs to be executed in it.. doesn't mean that much though..

777 it will let you write new files or write to files in it..

rwx rwx rwx.. the difference is the Writes for the world and the users...

jerry
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
Cool...so even if a file is world writable, if the directory is not world writable, then that directory cannot be written to?
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
not sure about that.. but i think if the dir is 777 then all the files are writeable.. if it's 755 only the files that are 666 are writeable..

understand?

cause 666 is rw- rw- rw-.. they never get executed..

jerry
Quote Reply
Re: Permissions!! Once and for ALL!! In reply to
This is really the wrong forum for this discussion. It doesn't apply to any Links mod; it is only dealing with permissions of files and directories.

------------------
Bob Connors, Moderator
Links Modification Forum
Moderator Email: moderator@orphanage.com
Personal Email: bobsie@orphanage.com
goodstuff.orphanage.com/