Gossamer Forum
Home : Products : DBMan : Customization :

new files read problem

Quote Reply
new files read problem
Does anyone face this problem as well?

DBMAN works very well but as soon as I make an extra DIR (chmod 777) for files created by users (such as in top 10 mod or text file mod) are not getting the right read/write permissions.
Visitors get errors (permission denied etc).

Am i doing something wrong or does this come from my ISP who prob. changes rights to files which are made by a .cgi program?

Any thoughts ?


Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
Those files should be set at 666 (rw-rw-rw-)...same as the .db, .count, .pass, etc.

Regards,

Quote Reply
Re: new files read problem In reply to
Now how could these rights be set by me?
They are created by the .cgi on the fly.
And they are getting written away as rw- --- ---
Beats me.
I really don't get it......

Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
Use the following codes:

Code:

chmod 0666, $filename;


in the File Upload and Text File subs. Change $filename to the variable of the filename.

Regards,


Quote Reply
Re: new files read problem In reply to
thanx Eliot !

Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
You're welcome.

Regards,

Eliot
Quote Reply
Re: new files read problem In reply to
Eliot, (sorry to bother you again)

I've got this,
$count_up= "$counter_dir/$rec{$db_key}";
Where exactly would I place "chmod 0666" ?

All the things I've tried either gives the file the extension or pretext 'chmod '0666' or the file doesnt get written at all.

$count_up= (chmod 0666, $counter_dir/$rec{$db_key});
or
$count_up= chmod (0666,"$counter_dir/$rec{$db_key}");

doesnt do the trick either, no file is written


got so far (threads in perl/cgi)

$count_up= "$counter_dir/$rec{$db_key}";
chmod (0666,"$count_up");

But this chmod than works after a file is read for de 2d time.
The first time its viewed it remains rw- --- --- untill its viewed again.

Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
I guess the question comes down to thsi:


How do I chmod 0666 a file when its written/created by the .cgi for the first time?

The code in my prev. post chmod 0666 the file after when it was accessesed.


Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
You need to put the CHMOD codes in the sub where the file is first created! Wink

Regards,

Eliot

Quote Reply
Re: new files read problem In reply to
Yes Eliot I got that now.

It was a very steep learning curve but I have got it now.
The trouble for me was how to define the place where the file was created in the first place.
Esp. in the top10 mod by JPD since somehow there was no routine in de db.cgi but in the html.pl file.
I have implemented the mod by The Few and have managed to put the chmod in the routine he wrote for the db.cgi file.

1. searched all the forums here
2. All the online manuals I could find on CGI/PERl
3. 48 hours later I somehow got it together

I must admit, its the best way of learning! Smile
I really wish that someday I could answer some questions here instead of asking them.

Still I am wondering if it wouldnt be a could idea to put that chmod command standard in all the mods in the right places. Or am I the only one with an ISP who writes all the files standard as 0644?

Thanx again for all your help, as always.



Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
It is not an ISP issue...but a server issue...files written by users via web forms are assigned the "Nobody" user and the permission is defaulted to 644 (rw-r--r--). That is why you need to take special care to ensure that the files created are world writeable and readable - 666 (rw-rw-rw-) within your scripts.

Regards,

Eliot

Quote Reply
Re: new files read problem In reply to
Yes, but in the light of your answer I still keep wondering why in the script (mods) that issue is not standard adressed, since most servers seem to behave that way.

I dont mean this as critism to anyone, just was thinking that a lot of users must (have) face(d) this problem.

Anyway I wont rest untill I am a Veteran as well Smile


Close Watch
LyricZ http://www.lyricz.12inter.net
NL
Quote Reply
Re: new files read problem In reply to
Welp...that is an issue to bring up with the Mod Authors. You might want to send JPDeni and other Mod authors of Mods that involve writing new files to suggest that they use CHMOD codes.

Wink

And the scripts that I have installed in my web site that write new files ALL contain CHMOD commands to ensure that they are writable and readable. Wink

Regards,

Eliot Lee

Quote Reply
Re: new files read problem In reply to
Well I first wanted it to check here before I turned to MOD writers. Could have been a long standing isue.
I didnt feel I was or am in the position to tell MOD writers any clues. Maybee they read this thread Smile

Thanx again.

Close Watch
LyricZ http://www.lyricz.12inter.net
NL