Ticket #344 (closed Enhancement: fixed)

Opened 10 months ago

Last modified 5 months ago

Set correct permissions on html/cache, without needing umask [patch]

Reported by: Nicolas Assigned to: Rytis
Priority: Minor Milestone: Undetermined
Component: Web - Project Version:
Keywords: permissions umask patch Cc:

Description

When trying to run the upgrade script on my recently-installed project, or manually delete the html/cache directory, it errors with Permission denied. The cache directory is owned by user www-data, group www-data, permissions 0740 (drwxr-x---, note no group write). Both 'www-data' and 'boincadm' belong to group 'boinc'. Looking at cache.inc, it seems it's creating the directories with permissions 0770 (with group write), but with the umask at its default 0022, it ends up being 0740.

ServerIntro#permissions mentions setting umasks on both boincadm and apache users to allow group write (but there is no further instructions on how to do that). The old GroupPermissions page mentions umasks as part of an alternative and non-recommended permission configuration. Additionally, the server admin said:

I've been reading a few bits about setting umask for apache and it's not at all straight-forward - really not recommended


I attach a patch for cache.inc that chmods the directory after creation, forcing it to have the correct permissions. That makes it work without the need for umask. I will have a look later for other PHP-created files or directories that may need similar handling.

Attachments

cache_no_umask_needed.diff (0.7 kB) - added by Nicolas on 07/17/07 19:50:03.
Patch to cache.inc to make it set correct permissions

Change History

07/17/07 19:50:03 changed by Nicolas

  • attachment cache_no_umask_needed.diff added.

Patch to cache.inc to make it set correct permissions

10/09/07 19:06:27 changed by Nicolas

  • summary changed from Set correct permissions on html/cache, without needing umask to Set correct permissions on html/cache, without needing umask [patch].

Add patch availability to ticket title.

10/20/07 17:28:50 changed by Nicolas

  • keywords changed from permissions umask to permissions umask patch.

12/21/07 13:01:14 changed by davea

  • status changed from new to closed.
  • resolution set to fixed.

(In [14435]) - user web: when creating cache dir, chmod() so that

protections are right regardless of umask. From Nicolas Alvarez; fixes #344


If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.