VirtualBox

Changeset 25644 in vbox


Ignore:
Timestamp:
Jan 5, 2010 8:46:59 AM (15 years ago)
Author:
vboxsync
Message:

Solaris/Installer: more compatible id usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r25143 r25644  
    4343BIN_SVCCFG=/usr/sbin/svccfg
    4444BIN_IFCONFIG=/sbin/ifconfig
     45BIN_ID=/usr/bin/id
    4546
    4647# "vboxdrv" is also used in sed lines here (change those as well if it ever changes)
     
    121122    BIN_IFCONFIG=`which ifconfig 2> /dev/null`
    122123    BIN_SVCS=`which svcs 2> /dev/null`
    123 
     124    BIN_ID=`which id 2> /dev/null`
     125
     126    check_bin_path "$BIN_ID"
    124127    check_bin_path "$BIN_ADDDRV"
    125128    check_bin_path "$BIN_REMDRV"
     
    139142check_root()
    140143{
    141     idbin=/usr/xpg4/bin/id
    142     if test ! -x "$idbin"; then
    143         found=`which id 2> /dev/null`
    144         if test ! -x "$found"; then
    145             errorprint "Failed to find a suitable user id executable."
    146             exit 1
    147         else
    148             idbin=$found
    149         fi
    150     fi
    151 
    152     if test `$idbin -u` -ne 0; then
     144    # Don't use "-u" option as some id binaries don't support it, instead
     145    # rely on "uid=101(username) gid=10(groupname) groups=10(staff)" output
     146    curuid=`$BIN_ID | cut -f 2 -d '=' | cut -f 1 -d '('`
     147    if test "$curuid" -ne 0; then
    153148        errorprint "This script must be run with administrator privileges."
    154149        exit 1
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette