Bad permissions with files create by Gallery

Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sat, 2002-08-24 13:07

(sorry for my bad english, I'm a poor french :wink: )
I've installed Gallery and all seems well. But I have a problem : I can successfully upload photos, but when I look in my album all I see are broken image icons. I'm looking for this problem in FAQ and I found 4.25 but my parameter "Albums URL" is OK.
In fact, after research, I found that my problem is that files (pics) create by Gallery have only permissions : rw- --- --- (600). If I change it to : rw- r-- r-- (644), that's OK ! (I change it with my FTP client).
Why my pics have bad permissions ! How can I correct that ?!...
Thanks for answers and "bravo !" for your application !

 
Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sat, 2002-08-24 20:27

I find an user which had the same problem 7 months ago : http://marc.theaimsgroup.com/?l=gallery-users&m=100900701406149&w=2
and he was equally on FreeBSD (version 4.5 for me). Is it a coincidence or a known problem ? Thanks for answers...

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2002-08-25 17:54

Hmm. Try this: edit platform/fs_unix.php and change this line:

$umask = umask(0133);

to:

$umask = umask(0113);

Let me know if that works and I'll update the code.

 
Poulou

Joined: 2002-08-24
Posts: 7
Posted: Sun, 2002-08-25 19:08

Sorry but your proposal doesn't work. But I find a solution, maybe dirty but which works !...

platform/fs_unix.php, I change :
$umask = umask(0113);
$results = copy($source, $dest);
umask($umask); // I don't understand umask(umask(0133)) ?...
by
$results = copy($source, $dest);
umask(0133);

and in classes/albumItem.php in function setHighlight, line 270, I added :
chmod("$dir/$name.highlight.$tag",0644); // Pb when you change the highlight pic else

And that's OK for me !! Any comments ?
Thanks for your application and your attendance :smile:

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2002-08-25 20:54

the umask is fine, or more people would have problems.
I have a suspicion that the OS has a more restictive umask
setting for creating files that php is not able to bypass. It'd be
interesting to see what the default umask php is seeing is as perhaps
changing the umask is just reducing an already reduced (from 0777)
umask even further. Anyhow, it sounds like either something inherit
in the OS or in their compilation of php rather then anything to do with
Gallery itself.