Closed Thread Icon

Preserved Topic: CGI OPs- Permissions Pages that link to <a href="https://ozoneasylum.com/backlink?for=12350" title="Pages that link to Preserved Topic: CGI OPs- Permissions" rel="nofollow" >Preserved Topic: CGI OPs- Permissions\

 
Author Thread
Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 08-07-2002 03:27

Just trying to get this straight for the record-

The CGI script itself (the .cgi or whatever file) is to be set to '755'- nothing higher or lower.

Any HTML files or any text files that the script is requred to write to should also be set to '755'- not higher, not lower.

The path to the script or the files to be written to starts at the directory structure I see when I FTP to the site- not at the '/' in 'www.url.com/' nor at the webserver's root dir.

No directory shall be set to '755' except for the CGI-BIN (or equivalent).

--is all this information accurate?


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-07-2002 04:46

Well not necessarily

755 is standard for executables it gives read write and execute permissions to the owner, others can execute the script and read it but can't write to it.

Generally you will have access to your cgis as a user other than the default web user so this means you (say "skull") can write to and execute the script and the web user (usually "apache") can execute the script and read it.

For text files usually 666 (do'h) is fine. this allows read and write privleges for everyone. Since this should have no executable code there should be no reason to give it any execute permissions. Also if this text file is only used by the script (and in fact created by it) the 644 should be fine (read/write for the owner, read only for all others) This method assumes that the file is only maniplated via a web script that will always be run by the default web user (666 is genrally easier for troubleshooting)

Directory question. Actually usually it is the path you see when you ftp however not necessarily (depends on how the server is configured) . When in doubt I usually just drop a php file in the directory with this in it
<?
getcwd()
?>

Which will give you the server path to the file.

as to the cgi-bin question, generally yes only cgi-bin stuff should be 755 as a precaution though many servers these days allow executables in the htdocs directory



.:[ Never resist a perfect moment ]:.

[This message has been edited by bitdamaged (edited 08-07-2002).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-07-2002 06:15

As far as folders are concerned, *default* permissions for them are 755, if you remove execute flag (i.e. change permissions to 666) you won't be able to browse them...


Rahly
Bipolar (III) Inmate

From: Michigan
Insane since: Jul 2002

posted posted 08-08-2002 04:41

actually... all your directories should be set to 777 or whatever needs writable permission to the directory... you need at least execute permissions in order to go INTO the directories... 755 or -rwxr-xr-x are needed for some servers... 777 can also be used but apache can be told not to execute 777 scripts and only 755... its really weird... i came across that the other day myself.

Rahly

Petskull
Maniac (V) Mad Scientist

From: 127 Halcyon Road, Marenia, Atlantis
Insane since: Aug 2000

posted posted 08-11-2002 19:24

Bit, I tried this, but nothing happens, I get a white page...

--------CONTENTS OF cwd.php-------
<?
getcwd()
?>
---END OF CONTENTS OF cwd.php----

can't figure it out... any ideas?


Code - CGI - links - DHTML - Javascript - Perl - programming - Magic - http://www.twistedport.com
ICQ: 67751342

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-11-2002 19:39

You have to print the result returned by getcwd() function:

<?php

print(getcwd());

?>

...or short version:

<?=getcwd()?>


« BackwardsOnwards »

Show Forum Drop Down Menu