Changeset 61313


Ignore:
Timestamp:
Dec 8, 2009, 4:02:03 PM (10 years ago)
Author:
jmr@…
Message:

only use autoconf'd macportsuser as fallback for when it is not set in macports.conf, create work symlink before dropping privileges, make sure priveleges are not dropped when opening log files

Location:
trunk/base
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/doc/macports.conf.in

    r60372 r61313  
    66
    77# Set the user to run MacPorts compiles, etc as when privileges are dropped during an install
    8 macportsuser            @RUNUSR@
     8#macportsuser           @RUNUSR@
    99
    1010# Where to store MacPorts working data
  • trunk/base/src/macports1.0/macports.tcl

    r60883 r61313  
    5353        registry.path registry.format registry.installtype portarchivemode portarchivepath \
    5454        portarchivetype portautoclean porttrace keeplogs portverbose destroot_umask rsync_server \
    55         rsync_options rsync_dir startupitem_type place_worksymlink \
     55        rsync_options rsync_dir startupitem_type place_worksymlink macportsuser \
    5656        mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
    5757        applications_dir current_stage frameworks_dir developer_dir universal_archs build_arch $user_options"
     
    112112    global ::debuglog ::debuglogname macports::channels macports::portdbpath
    113113
     114    if {[getuid] == 0 && [geteuid] != 0} {
     115        seteuid 0
     116    }
    114117    set logspath [file join $macports::portdbpath logs]
    115118    if {([file exists $logspath] && ![file writable $logspath]) || (![file exists $logspath] && ![file writable $macports::portdbpath])} {
     
    723726        set macports::buildmakejobs 0
    724727    }
    725    
     728
     729    # default user to run as when privileges can be dropped
     730    if {![info exists macports::macportsuser]} {
     731        set macports::macportsuser $macports::autoconf::macportsuser
     732    }
     733
    726734    # Default Xcode Tools path
    727735    if {![info exists macports::developer_dir]} {
  • trunk/base/src/macports1.0/macports_autoconf.tcl.in

    r51849 r61313  
    3838    variable macports_version "@MACPORTS_VERSION@"
    3939    variable macports_user_dir "~/.macports"
     40    variable macportsuser "@RUNUSR@"
    4041    variable open_path "@OPEN@"
    4142    variable rsync_path "@RSYNC@"
  • trunk/base/src/port1.0/port_autoconf.tcl.in

    r60262 r61313  
    7070        variable install_group "@DSTGRP@"
    7171        variable prefix "@prefix_expanded@"
    72         variable macportsuser "@RUNUSR@"
    7372}
  • trunk/base/src/port1.0/portdestroot.tcl

    r54706 r61313  
    8989proc portdestroot::destroot_start {args} {
    9090    global UI_PREFIX prefix name porturl destroot os.platform destroot.clean portsharepath
    91     global destroot.umask destroot.asroot macportsuser euid egid
     91    global destroot.umask destroot.asroot euid egid
    9292    global applications_dir frameworks_dir
    9393    variable oldmask
  • trunk/base/src/port1.0/portmain.tcl

    r61253 r61313  
    4545
    4646# define options
    47 options prefix macportsuser name version revision epoch categories maintainers
     47options prefix name version revision epoch categories maintainers
    4848options long_description description homepage license provides conflicts replaced_by
    4949options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target
     
    7777
    7878# Configure settings
    79 default macportsuser {${portutil::autoconf::macportsuser}}
    8079default install.user {${portutil::autoconf::install_user}}
    8180default install.group {${portutil::autoconf::install_group}}
  • trunk/base/src/port1.0/portutil.tcl

    r60372 r61313  
    15061506        file mkdir $workpath
    15071507        chownAsRoot $portbuildpath
     1508        # Create a symlink to the workpath for port authors
     1509        if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
     1510            ui_debug "Attempting ln -sf $workpath $worksymlink"
     1511            ln -sf $workpath $worksymlink
     1512        }
    15081513    }
    15091514   
     
    15511556            }
    15521557        }
    1553     }
    1554 
    1555     # Create a symlink to the workpath for port authors
    1556     if {[tbool place_worksymlink] && ![file isdirectory $worksymlink]} {
    1557         ui_debug "Attempting ln -sf $workpath $worksymlink"
    1558         ln -sf $workpath $worksymlink
    15591558    }
    15601559
Note: See TracChangeset for help on using the changeset viewer.