Changeset 147064 for trunk/base


Ignore:
Timestamp:
Mar 24, 2016, 9:52:48 PM (4 years ago)
Author:
cal@…
Message:

base: portutil: Improve msg for privilege handling

Let's have one line per privilege escalation and one line per privilege drop in
the log file, rather than two for escalation and three for the drop.
Additionally, format the messages in a similar way so it is easier to see that
they are related.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r146729 r147064  
    29852985    if { [getuid] == 0 && [geteuid] != 0 } {
    29862986    # if started with sudo but have dropped the privileges
    2987         ui_debug "Can't run $action on this port without elevated privileges. Escalating privileges back to root."
    29882987        seteuid $euid
    29892988        setegid $egid
    2990         ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
     2989        ui_debug "elevating privileges for $action: euid changed to [geteuid], egid changed to [getegid]."
    29912990    } elseif { [getuid] != 0 } {
    29922991        return -code error "MacPorts requires root privileges for this action"
     
    30023001        if { [catch {
    30033002                if {[name_to_uid "$macportsuser"] != 0} {
    3004                     ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
    3005 
    30063003                    #seteuid [name_to_uid [file attributes $workpath -owner]]
    30073004                    #setegid [name_to_gid [file attributes $workpath -group]]
     
    30093006                    setegid [uname_to_gid "$macportsuser"]
    30103007                    seteuid [name_to_uid "$macportsuser"]
    3011                     ui_debug "egid changed to: [getegid]"
    3012                     ui_debug "euid changed to: [geteuid]"
     3008                    ui_debug "dropping privileges: euid changed to [geteuid], egid changed to [getegid]."
    30133009                }
    30143010            }]
Note: See TracChangeset for help on using the changeset viewer.