[39082] branches/gsoc08-privileges/base/src/port1.0/portutil.tcl

pmagrath at macports.org pmagrath at macports.org
Thu Aug 7 12:51:43 PDT 2008


Revision: 39082
          http://trac.macosforge.org/projects/macports/changeset/39082
Author:   pmagrath at macports.org
Date:     2008-08-07 12:51:42 -0700 (Thu, 07 Aug 2008)
Log Message:
-----------
Use chownAsRoot procedure instead of duplicating code.

Modified Paths:
--------------
    branches/gsoc08-privileges/base/src/port1.0/portutil.tcl

Modified: branches/gsoc08-privileges/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc08-privileges/base/src/port1.0/portutil.tcl	2008-08-07 15:49:58 UTC (rev 39081)
+++ branches/gsoc08-privileges/base/src/port1.0/portutil.tcl	2008-08-07 19:51:42 UTC (rev 39082)
@@ -779,18 +779,7 @@
         close $tmpfd
     
 		# start gsoc08-privileges
-		if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
-		# if started with sudo but have dropped the privileges
-			seteuid $euid	
-			ui_debug "euid changed to: [geteuid]"
-			chown $file ${macportsuser}
-			ui_debug "chowned $file to $macportsuser"
-			seteuid [name_to_uid "$macportsuser"]
-			ui_debug "euid changed to: [geteuid]"
-		} else {
-			ui_debug "no need to chown $file. uid=[getuid]. euid=[geteuid]."
-		}
-			
+		chownAsRoot $file	
 		# end gsoc08-privileges
     
         set attributes [file attributes $file]
@@ -2277,7 +2266,7 @@
 }
 
 ##
-# Recusively chown the given file or directory to the specified user, using root privileges.
+# Recusively chown the given file or directory to $macportsuser, using root privileges.
 #
 # @param path the file/directory to be chowned
 proc chownAsRoot {path} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080807/bbf3ecab/attachment-0001.html 


More information about the macports-changes mailing list