created file permissions
created file permissions
We really need a way to specify the permissions of files that s9y creates. So far, when s9y creates a file on my server, it gets set rw-rw-rw- ... ie, world readable and writable! This is not good in shared hosting environments!
Last edited by planigan on Tue Oct 03, 2006 3:33 am, edited 1 time in total.
If .htaccess does not exist when you change the URL rewriting options, s9y attempts to create it. If / when it creates the file, it creates it with world readable file permissions.
Before setting URL rewrite options...
After setting URL rewrite options...
Of course, if you create your own .htaccess file and set the permissions yourself this doesn't matter.
Before setting URL rewrite options...
Code: Select all
pat@freestd ~/domains/patricklanigan.org/public_html $ ls -l .htaccess
ls: .htaccess: No such file or directory
Code: Select all
pat@freestd ~/domains/patricklanigan.org/public_html $ ls -l .htaccess
-rw-rw-rw- 1 apache apache 1866 Sep 28 22:52 .htaccess
Of course, if you create your own .htaccess file and set the permissions yourself this doesn't matter.
I found another case... the media library creates thumbnails with "apache:apache rw-rw-rw-" permissions as well. I understand that s9y probably just creates the file with whatever default permissions our system uses, but those of us in shared hosting environments have little control over the default umask.
Immediately after creating the file, s9y should call PHP's chmod function to set the file permissions correctly. This could be wrapped in an API function, which could also take into account a global setting that allows users to specify the permissions for created files (G2 does somthing similar). All plugin writers should be encouraged to use this API in order to provide uniform file behavior.
Immediately after creating the file, s9y should call PHP's chmod function to set the file permissions correctly. This could be wrapped in an API function, which could also take into account a global setting that allows users to specify the permissions for created files (G2 does somthing similar). All plugin writers should be encouraged to use this API in order to provide uniform file behavior.
I think this is a good idea, and I'll look into it.
We will, however, get some grief from misconfigured servers. We've already found that safe_mode can interfere with SPARTACUS, for instance. So if the umask is set to create world-writeable files, and safe_mode is on, we won't be able to change the permissions. Then the users will get mad at us. Again.
But it's still the best thing to do, in my opinion.
We will, however, get some grief from misconfigured servers. We've already found that safe_mode can interfere with SPARTACUS, for instance. So if the umask is set to create world-writeable files, and safe_mode is on, we won't be able to change the permissions. Then the users will get mad at us. Again.
But it's still the best thing to do, in my opinion.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I'd vote for an approach like Spartacus; make the chmod/chown optional. Users who then enable that will need to take care that their server supports it...?
Regards,
Garvin
I'd vote for an approach like Spartacus; make the chmod/chown optional. Users who then enable that will need to take care that their server supports it...?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/