PDA

View Full Version : Umask changes?


Kathleen
11-30-2001, 11:04 PM
Terra,

We're experiencing intermittent umask errors on new files written (as part of a message forum), and the files are coming out 600 rather than the standard 644.

Could you check anything you're doing? It's happened to about 10 files so far today, and two more since I chmod'ed them hours ago, so it's STILL happening.

Help??

Justin
11-30-2001, 11:13 PM
Hi Kathleen,

Nothing on the server has changed that would cause this; I glanced at your scripts, and it doesn't appear they are specifically setting a 'umask' anywhere... you might want to explicitely specify a umask to ensure files are created with the mode you need them to be.

Hope this helps.

Kathleen
12-01-2001, 01:46 AM
But I'm not really a programmer. I know how to *tweak* scripts is all. How would I open the file with a 644 permission all the time. If I make this change, then it won't matter what the default umask is, right?

That would work for me.

Kathleen
12-01-2001, 02:06 AM
I'll just change it when I close it.

Thanks for the direction :P

Terra
12-01-2001, 02:29 AM
Kathleen,

Which script (exact path) and domain in question...

There were no changes made with the Apache servers, however it does warrant further investigation...

--
Terra
sysAdmin
FutureQuest

Kathleen
12-01-2001, 12:02 PM
cgi-bin/Community/virgin/virgin.pl

Sound familiar? :P

I've added the line:

chmod (0644,"$basedir/$mesgdir/$num\.$ext")

after I close the NEWFILE

Hopefully that will override any - creativitiy on your end :)

Terra
12-01-2001, 10:53 PM
Kathleen,

I'm a little confused, we are talking about mosaicminds.org, yes?

I wrote a quick-n-dirty umask printer, however, when I tried to run it I discovered that you have a broken .htaccess file in there...

Try running:
/cgi-bin/Community/virgin/print_umask.pl

It will have a failure due to your use of: AuthDBMUserFile

This was deprecated back when we did the 74GB drive upgrades, and the server overhauls required to handle the drives...

You will need to solve that issue first...

I did temporarily disable it to run my testing script, and the result was:
umask: 022

Which is normal...

--
Terra
--Oh, Hello Mr. Tyler - going down? hehehehe--
FutureQuest

Kathleen
12-01-2001, 11:38 PM
I dunno why that .htaccess was still there. I don't think it was operable, not since whatever changes y'all made that required me to change all those files. I didn't change that one, cuz I didn't even realize it was there.

You're right, the default umask is 022. However, periodically, some files get written 600 not 644. I don't know why, and I can't find anything that we do that would make that difference. It's happened a couple of times. Once it was to all files written. But otherwise, it's only been intermittent. This time was intermittent. I would go change the mode on all of the files in each message directory, and then everything would be fine. But this last time, I changed stuff, and a bit later, *new* files would have the wrong permissions again.

Justin had a good idea. I've changed the scripts now so that after it closes each file (message), I change the permissions on the file to 644.

Hopefully, then I'll override the default, so if the default changes (for any reason), we won't be impacted.

Hopefully. I always have hope :P