Changeset 75143


Ignore:
Timestamp:
Jan 16, 2011, 5:51:02 AM (9 years ago)
Author:
jmr@…
Message:

only try to chown startupitems to root if we are root

File:
1 edited

Legend:

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

    r71486 r75143  
    198198    # Create the startup item directory
    199199    file mkdir ${startupItemDir}
    200     file attributes ${startupItemDir} -owner root -group wheel
     200    if {[getuid] == 0} {
     201        file attributes ${startupItemDir} -owner root -group wheel
     202    }
    201203   
    202204    ########################
    203205    # Generate the startup item script
    204206    set item [open "${startupItemScript}" w 0755]
    205     file attributes "${startupItemScript}" -owner root -group wheel
     207    if {[getuid] == 0} {
     208        file attributes "${startupItemScript}" -owner root -group wheel
     209    }
    206210   
    207211    # Emit the header
     
    367371    # Generate the plist
    368372    set para [open "${startupItemPlist}" w 0644]
    369     file attributes "${startupItemPlist}" -owner root -group wheel
     373    if {[getuid] == 0} {
     374        file attributes "${startupItemPlist}" -owner root -group wheel
     375    }
    370376   
    371377    puts ${para} "\{"
     
    409415   
    410416    file mkdir ${destroot}${itemdir}
    411     file attributes ${destroot}${itemdir} -owner root -group wheel
     417    if {[getuid] == 0} {
     418        file attributes ${destroot}${itemdir} -owner root -group wheel
     419    }
    412420       
    413421    if { [llength ${startupitem.executable}] &&
     
    446454        # Create the wrapper script
    447455        set item [open "${destroot}${wrapper}" w 0755]
    448         file attributes "${destroot}${wrapper}" -owner root -group wheel
     456        if {[getuid] == 0} {
     457            file attributes "${destroot}${wrapper}" -owner root -group wheel
     458        }
    449459
    450460        puts ${item} "#!/bin/sh"
Note: See TracChangeset for help on using the changeset viewer.