Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

99% working, but.. new .html are 600 Do I need ?? umask()

Quote Reply
99% working, but.. new .html are 600 Do I need ?? umask()
Just installed Links2 today - works beautifully out of the box. Awesome.

Just one glitch.
All new index.html files in my public directory are created with 600 permissions, even though my directories are 777.

I have to change them manually to 666 so they can be seen. This is irritating. Can I put a umask() command somewhere so the new files always get generated with 666 permissions??

Thanks in advance.
Quote Reply
Re: 99% working, but.. new .html are 600 Do I need ?? umask() In reply to
 
Quote:
All new index.html files in my public directory are created with 600 permissions

This is odd, since the files should be created with 644 permissions (rw-r--r--).

Quote:
I have to change them manually to 666 so they can be seen.

This is wrong...you should have your index.html files created with 644 permissions.

Out-of-the box, LINKS does this...I think it may be a problem with your server configurations.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: 99% working, but.. new .html are 600 Do I need ?? umask() In reply to
Good...but you really don't need the unmask codes since LINKS by default sets the permission of built files to 644.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: 99% working, but.. new .html are 600 Do I need ?? umask() In reply to
Thanks for this.

I am sure you are correct - I have similar problems with other scripts. I will check with my ISP (Demon UK) but suspect they won't be able/willing to do anything!

I have had to add umask() commands to circumvent this issue.
Quote Reply
Re: 99% working, but.. new .html are 600 Do I need ?? umask() In reply to
Thanks for these comments. I checked today with my ISP (Demon UK) who are a bit paranoid about security.

They have confirmed that their implementation of Apache is set to create new files in public directories with a default of 600. Hence this is what happens despite the intention of the Links script.

They tell me the best way to overcome this is to add something like

Code:
CHMOD 644 filename

(syntax probably not correct!) commands at the appropriate points in the script. I am not a programmmer, but can hack the script with a bit of a "guiding hand". Can you advise me where to insert such a command, and in which script?

Thanks in advance.


P.S.

Since then, I have "hacked" into nph-build.cgi and added three lines into the code

Code:
# Crete the new page, and do a bit of HTML work for the main page.
if ($build_span_pages) {

$umask = umask ();
umask (02);


open (NEW, ">$build_new_path/$date$build_extension") or cgierr ("unable to open what's new page: $build_new_path/$build_index. Reason: $!");
$use_html ?
print qq|\tNew Links for <a href="$build_new_url/$date$build_extension" TARGET="_blank">$date</a>: $total\n| :
print qq|\tNew Links for $date: $total\n|;
print NEW &site_html_new;
close NEW;

umask($umask);


$main_link_results .= qq|<li><a href="$build_new_url/$date$build_extension">$long_date</a> ($total).|;
$main_total += $total;
}
else {
$link_results .= "</blockquote>";
}
}

if ($build_span_pages) {
$link_results = "<ul>$main_link_results</ul>";
$total = $main_total;
}
$title_linked = &build_linked_title ("New");


and hey presto, my What's New daily file comes out with permission 664, which is OK. Is there a more elegant way to achieve this?



[This message has been edited by tony_macdonnell (edited April 25, 2000).]