Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#344 closed Enhancement (fixed)

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

Reported by: Nicolas Owned by: 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 (1)

cache_no_umask_needed.diff (674 bytes) - added by Nicolas 17 years ago.
Patch to cache.inc to make it set correct permissions

Download all attachments as: .zip

Change History (4)

Changed 17 years ago by Nicolas

Attachment: cache_no_umask_needed.diff added

Patch to cache.inc to make it set correct permissions

comment:1 Changed 17 years ago by Nicolas

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

Add patch availability to ticket title.

comment:2 Changed 17 years ago by Nicolas

Keywords: patch added

comment:3 Changed 16 years ago by davea

Resolution: fixed
Status: newclosed

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

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

Note: See TracTickets for help on using tickets.