Hi,
I'm trying to setup a multi-developer aegir installation where access to per-site directories is managed via group permissions. That's all fine in theory, but there is one slight problem: aegir (or Drupal?) sets the permissions of sites/uri to 0755 regardless of what umask I set (and regardless of whether I set it via pam_umask or at the start of /usr/bin/drush).
I've done a bit of grepping, but I can't find the code that sets the permissions on this directory. Can anyone point me at where I should be looking to override this directory permission?
Re-opening as a feature request to make this configurable, rather than a hardcoded code change that needs to be re-applied on each new revision.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1615580-9-aegir3-reroll.patch | 5.33 KB | joestewart |
| #3 | 1615580-new-site-perms-3.patch | 5.29 KB | cafuego |
Comments
Comment #1
cafuego commentedNever mind. More grepping has found me an array of things in
_provision_drupal_create_directories()in platform/provision_drupal.drush.incComment #2
cafuego commentedSo I resolved my issue by changing the hardcoded permissions in
_provision_drupal_create_directories(). However, that's an un-ideal solution as the "fix" will go away at the next aegir update.I propose we (or I) make the permissions configurable via the included
provision/example.drushrc.phpfile. I'll have a go at a patch later in the week.Comment #3
cafuego commentedAttached patch should in theory do the trick :-)
Comment #4
anarcat commentedInteresting idea!
If we are going to do this, however, I think we should generalize the concept and allow users to customize not only which permissions to apply, but on which directory too. So we should change the code to be a loop on the options provided so that people could override which directory to set permissions on.
This would, for example, cover the following issues with a more general use case:
* #1397834: Missing support for files/languages folder
* #1569290: Missing support for files/styles folder
* #994210: Add support for some common files/subdirs like css/js/ctools/imagecache
Furthermore:
why not set the default here instead of above? that would remove the need for an array_merge, and that is what the second argument to drush_get_option() is for, iirc. This is nitpicking however.
Also, keep in mind we are considering merging the provisionacl module in core, and maybe we should look at restructuring the code in consequence.
Comment #5
cafuego commentedThe option provides an array of overrides in
directory => modeformat, so it sort of already does. Mind you, the list of directories that are processed is still the hardcoded list in_provision_drupal_create_directories().If I didn't use
array_merge, the option in drushrc.php would need to explicitly include the permissions for all defined directories. Then provision would use either the user-provided array of permissions or the hard-coded defaults. By using array_merge, the user only needs to specify the values they want to override, not the others as well.In my case, I would only need to specify
because the defaults on all other directories are fine. So the second argument to drush_get_option() here basically ensures that there are no overrides to apply if the user doesn't specify any.
Comment #6
anarcat commentedThis is what I mean: I would simplify the code and loop over the array instead of hardcoding each line, would just be cleaner.
Granted, that makes sense.
Same, makes sense.
Comment #6.0
anarcat commentedUpdated issue summary.
Comment #7
ergonlogicNew features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x. Aegir 1.x is essentially deprecated.
Comment #8
cafuego commentedMy patch applies to 6.x-2.x as-is.
Comment #9
joestewart commentedsimple re-roll for 7.x-3.x