[70140] trunk/base/src/port1.0/portutil.tcl

jmr at macports.org jmr at macports.org
Fri Jul 30 03:31:11 PDT 2010


Revision: 70140
          http://trac.macports.org/changeset/70140
Author:   jmr at macports.org
Date:     2010-07-30 03:31:10 -0700 (Fri, 30 Jul 2010)
Log Message:
-----------
make sure euid=0 in adduser and addgroup

Modified Paths:
--------------
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2010-07-30 10:25:51 UTC (rev 70139)
+++ trunk/base/src/port1.0/portutil.tcl	2010-07-30 10:31:10 UTC (rev 70140)
@@ -2031,6 +2031,8 @@
         ui_warn "adduser only works when running as root."
         ui_warn "The requested user '$name' was not created."
         return
+    } elseif {[geteuid] != 0} {
+        seteuid 0; setegid 0
     }
 
     set passwd {*}
@@ -2072,6 +2074,8 @@
         ui_warn "addgroup only works when running as root."
         ui_warn "The requested group '$name' was not created."
         return
+    } elseif {[geteuid] != 0} {
+        seteuid 0; setegid 0
     }
 
     set gid [nextgid]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100730/8afddc4d/attachment.html>


More information about the macports-changes mailing list