Closed (won't fix)
Project:
ImageCache
Version:
5.x-2.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2008 at 10:34 UTC
Updated:
24 May 2012 at 07:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
dopry commentedcheck your system and php umask... this can be forced outside of mkdir...
Comment #2
alvinet commentedi'm using suPHP. In configuration file i change umask settings from 0077 to 0020.
Now folders is created with 755 permission but files with 775.
This value may be correct for this hosting, but for others?
Someone know the right solution for the umask value?
Comment #3
adamo commentedI also ran into problems with the suPHP umask defaulting to 0077.
Setting umask to "0002" in suphp.conf did the trick for me.
Comment #4
drewish commentedComment #6
stella commentedI ran into the same issue, and as changing the server's umask wasn't an option, I patched the module so it does a chmod() just after the directory is created, see attached patch.
Comment #7
NoRandom commentedI'm having problems too with imagecache folder permissions. In my case they are created with 744 and your patch doesn't help.
I've checked a lot of posts about this issue and I think I'm getting mad.
Kind regards.
Comment #8
NoRandom commented...and still doesn't work with last update 2.5.
In a server with:
Where should I change the umask setting? I don't konw almost anything about web servers.
Kind regards.
Comment #9
adamo commented@Macarro: If you are using suPHP, find the umask in your suphp.conf file. If you are using mod_php, I believe it inherits the umask from Apache, which typically inherits the system umask. If you don't want to change your system umask you can edit the Apache init script and set it there using the umask command. There may be other ways to do it depending on your setup, but you're probably going to have to do some digging to find out what they are.
Comment #10
NoRandom commentedHi
I've solved the problem patching the module but I don't know yet where is the problem.
In my site folder/file creation works perfectly for other modules and I've also created text files from my own php code simply saving a new file and they appear with the right permissions. So I assume it's not a server configuration error or problem (just an assumption).
My server admin told me the I'm working on a virtual apache server without any umask restriction. So, to check it I simply print the umask with "print umask()"... and I got 27 as result... So there was the problem. I don't know almost anything about this kind of issues but if this was right I would be impossible to get 705 permissions and that's not my case.
This way the simply solution was to modify the module (2.5 version) about at line 463 to force umask(0) during folder creation:
Maybe I should put umask modification inside the if loop for security reasons... I don't know.
Kind regards and thanks for your answer, adamo.
Comment #11
adamo commentedIf modifying the module is the solution, it would be better to call chmod() after the file is created than to use umask(). From the PHP manual:
http://us.php.net/manual/en/function.umask.php
Comment #12
NoRandom commentedThanks for the note, adamo.
I think I tried it and it didn't work in my case. Anyway I have to check it, I'll put here my results.
Comment #13
tazus commentedsubscribe
Comment #14
NoRandom commentedJust in case it helps, I've recently upgraded to Drupal 6 and Imagecache works perfectly now, there is no folder permissions problem.
Comment #15
fizk commented