Set GIDs concurrently, to avoid MacOS bug
authorJamie Cameron <jcameron@webmin.com>
Mon, 30 Jul 2007 20:34:49 +0000 (20:34 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 30 Jul 2007 20:34:49 +0000 (20:34 +0000)
proc/proc-lib.pl

index 16648bc..7e46f9f 100644 (file)
@@ -158,14 +158,13 @@ else {
                if ($_[1]) {
                        if (defined($_[2])) {
                                # switch to given UID and GID
-                               $( = $_[2]; $) = "$_[2] $_[2]";
+                               ($(, $)) = ($_[2], "$_[2] $_[2]");
                                ($>, $<) = ($_[1], $_[1]);
                                }
                        else {
                                # switch to UID and all GIDs
                                local @u = getpwuid($_[1]);
-                               $( = $u[3];
-                               $) = "$u[3] ".join(" ", $u[3], &other_groups($u[0]));
+                               ($(, $)) = ($u[3], "$u[3] ".join(" ", $u[3], &other_groups($u[0])));
                                ($>, $<) = ($u[2], $u[2]);
                                }
                        }