Commit 7e1d72ad authored by anarcat's avatar anarcat Committed by anarcat
Browse files

try harder to set the permissions in provision_path_chgrp(), because unknown...

try harder to set the permissions in provision_path_chgrp(), because unknown groups may come through with the ITK extensions

See: #334416
parent e4b22fb4
...@@ -183,9 +183,9 @@ function provision_path_chown($path, &$owner, &$reason) { ...@@ -183,9 +183,9 @@ function provision_path_chown($path, &$owner, &$reason) {
return provision_posix_username(fileowner($path)); return provision_posix_username(fileowner($path));
} }
function provision_path_chgrp($path, &$group, &$reason) { function provision_path_chgrp($path, &$gid, &$reason) {
if ($group = provision_posix_groupname($group)) { if ($group = provision_posix_groupname($gid)) {
if (provision_user_in_group(PROVISION_SCRIPT_USER, $group)) { if (provision_user_in_group(PROVISION_SCRIPT_USER, $gid)) {
if (chgrp($path, $group)) { if (chgrp($path, $group)) {
return $group; return $group;
} }
...@@ -197,7 +197,7 @@ function provision_path_chgrp($path, &$group, &$reason) { ...@@ -197,7 +197,7 @@ function provision_path_chgrp($path, &$group, &$reason) {
$reason = dt("@user is not in @group group", array("@user" => PROVISION_SCRIPT_USER, "@group" => $group)); $reason = dt("@user is not in @group group", array("@user" => PROVISION_SCRIPT_USER, "@group" => $group));
} }
} }
else { elseif (!@chgrp($path, $gid)) { # try to change the group anyways
$reason = dt("the group does not exist"); $reason = dt("the group does not exist");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment