Changeset 72237


Ignore:
Timestamp:
Oct 8, 2010, 2:47:32 AM (10 years ago)
Author:
jmr@…
Message:

regain root privileges when mportexec'ing dependencies in portmpkg (#26463)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/package1.0/portmpkg.tcl

    r72234 r72237  
    8787
    8888proc portmpkg::make_one_package {portname portversion destination} {
    89         global prefix package.destpath package.flat
     89        global prefix package.destpath package.flat macportsuser
    9090        if {[catch {set res [mport_lookup $portname]} result]} {
    9191                global errorInfo
     
    9393                ui_error "port lookup failed: $result"
    9494                return 1
     95        }
     96        if {[getuid] == 0 && [geteuid] != 0} {
     97                setegid 0; seteuid 0
     98                set deprivileged 1
    9599        }
    96100        foreach {name array} $res {
     
    105109                }
    106110                unset portinfo
     111        }
     112        if {[info exists deprivileged]} {
     113                setegid [uname_to_gid "$macportsuser"]
     114                seteuid [name_to_uid "$macportsuser"]
    107115        }
    108116}
Note: See TracChangeset for help on using the changeset viewer.