summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2010-12-10 20:34:35 (GMT)
committeranarcat2010-12-10 20:37:10 (GMT)
commit98fb236fc5a6373031dbf7d3eb3f5ea03e38137c (patch)
tree0775c528528966746501e2a06593df53da8b1739
parent95239c4e03af5eb33d6da8bbdf872a1e09546a0f (diff)
do not attempt to chown files/ dir during verification
the rationale here is that we're not running as root, and therefore chown is likely to fail, unless the file already has the right owner, in which case a chown is not necessary. To quote chown(2): Only a privileged process (Linux: one with the CAP_CHOWN capability) may change the owner of a file. The owner of a file may change the group of the file to any group of which that owner is a member. A privileged process (Linux: with CAP_CHOWN) may change the group arbitrarily. So this was just a cause of trouble without any possible benefit unless we run with capabilities, and we shouldn't assume this (right now?).
-rw-r--r--platform/provision_drupal.drush.inc13
1 files changed, 0 insertions, 13 deletions
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index c41d03f..482677d 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -171,37 +171,29 @@ function _provision_drupal_create_directories($url = NULL, $profile = NULL) {
"sites/$url/libraries" => 02775, # http://drupal.org/node/496240
);
- $chown = array();
$chgrp = array();
// special case: platform. do not handle files dir
if ($url != 'all') {
$mkdir["sites/$url/files"] = 02770;
- $chown["sites/$url/files"] = d('@server_master')->script_user;
$chgrp["sites/$url/files"] = d('@server_master')->web_group;
$mkdir["sites/$url/files/tmp"] = 02770;
- $chown["sites/$url/files/tmp"] = d('@server_master')->script_user;
$chgrp["sites/$url/files/tmp"] = d('@server_master')->web_group;
$mkdir["sites/$url/files/images"] = 02770;
- $chown["sites/$url/files/images"] = d('@server_master')->script_user;
$chgrp["sites/$url/files/images"] = d('@server_master')->web_group;
$mkdir["sites/$url/files/pictures"] = 02770;
- $chown["sites/$url/files/pictures"] = d('@server_master')->script_user;
$chgrp["sites/$url/files/pictures"] = d('@server_master')->web_group;
// d7 support
$mkdir["sites/$url/private"] = 02770;
- $chown["sites/$url/private"] = d('@server_master')->script_user;
$chgrp["sites/$url/private"] = d('@server_master')->web_group;
$mkdir["sites/$url/private/files"] = 02770;
- $chown["sites/$url/private/files"] = d('@server_master')->script_user;
$chgrp["sites/$url/private/files"] = d('@server_master')->web_group;
$mkdir["sites/$url/private/temp"] = 02770;
- $chown["sites/$url/private/temp"] = d('@server_master')->script_user;
$chgrp["sites/$url/private/temp"] = d('@server_master')->web_group;
}
@@ -228,11 +220,6 @@ function _provision_drupal_create_directories($url = NULL, $profile = NULL) {
->succeed('Changed permissions of <code>@path</code> to @perm')
->fail('Could not change permissions <code>@path</code> to @perm');
}
- foreach ($chown as $path => $owner) {
- provision_file()->chown($path, $owner, !in_array($path, $not_recursive))
- ->succeed('Changed ownership of <code>@path</code> to @uid')
- ->fail('Could not change ownership <code>@path</code>', 'DRUSH_PERM_ERROR');
- }
foreach ($chgrp as $path => $group) {
provision_file()->chgrp($path, $group, !in_array($path, $not_recursive))
->succeed('Changed group ownership of <code>@path</code> to @gid')