VirtualBox

Changeset 58687 in vbox


Ignore:
Timestamp:
Nov 13, 2015 2:15:52 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104114
Message:

Solaris/Installer: safer quoting.

Location:
trunk/src/VBox/Installer/solaris
Files:
3 edited

Legend:

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

    r58669 r58687  
    4141    fi
    4242    $BIN_PKGINFO $BASEDIR_OPT "$1" >/dev/null 2>&1
    43     if test $? -eq 0; then
     43    if test "$?" -eq 0; then
    4444        return 0
    4545    fi
     
    5656    # using "list" without "-a" only lists installed pkgs which is what we need
    5757    $BIN_PKG $BASEDIR_OPT list "$1" >/dev/null 2>&1
    58     if test $? -eq 0; then
     58    if test "$?" -eq 0; then
    5959        return 0
    6060    fi
     
    7171    # using "list" without "-a" only lists installed pkgs which is what we need
    7272    $BIN_PKG $BASEDIR_OPT list "$1" >/dev/null 2>&1
    73     if test $? -eq 0; then
     73    if test "$?" -eq 0; then
    7474        return 0
    7575    fi
    7676    $BIN_PKG $BASEDIR_OPT list "$2" >/dev/null 2>&1
    77     if test $? -eq 0; then
     77    if test "$?" -eq 0; then
    7878        return 0
    7979    fi
     
    110110# Nothing to check for non-global zones
    111111currentzone=`zonename`
    112 if test "$currentzone" != "global"; then
     112if test "x$currentzone" != "xglobal"; then
    113113    exit 0
    114114fi
     
    147147fi
    148148
    149 if test "$PKG_MISSING_IPS" != "" && test "$PKG_MISSING_SVR4" != ""; then
     149if test "x$PKG_MISSING_IPS" != "x" && test "x$PKG_MISSING_SVR4" != "x"; then
    150150    if test ! -x "$BIN_PKG" && test ! -x "$BIN_PKGINFO"; then
    151151        errorprint "Missing or non-executable binaries: pkg ($BIN_PKG) and pkginfo ($BIN_PKGINFO)."
  • trunk/src/VBox/Installer/solaris/preremove.sh

    r56299 r58687  
    2020
    2121currentzone=`zonename`
    22 if test "$currentzone" = "global"; then
     22if test "x$currentzone" = "xglobal"; then
    2323    echo "Removing VirtualBox services and drivers..."
    2424    ${PKG_INSTALL_ROOT:=/}/opt/VirtualBox/vboxconfig.sh --preremove
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r58678 r58687  
    8181infoprint()
    8282{
    83     if test "$ISSILENT" != "$SILENTOP"; then
     83    if test "x$ISSILENT" != "x$SILENTOP"; then
    8484        echo 1>&2 "$1"
    8585    fi
     
    8888subprint()
    8989{
    90     if test "$ISSILENT" != "$SILENTOP"; then
     90    if test "x$ISSILENT" != "x$SILENTOP"; then
    9191        echo 1>&2 "   - $1"
    9292    fi
     
    9595warnprint()
    9696{
    97     if test "$ISSILENT" != "$SILENTOP"; then
     97    if test "x$ISSILENT" != "x$SILENTOP"; then
    9898        echo 1>&2 "   * Warning!! $1"
    9999    fi
     
    275275                # worth trying to bring more order to chaos as it's clear that the version numbering is subject to breakage
    276276                # as it has been seen in the past.
    277                 if test "$STR_KERN_MAJOR" = "5.12"; then
     277                if test "x$STR_KERN_MAJOR" = "x5.12"; then
    278278                    HOST_OS_MAJORVERSION="12"
    279                 elif test "$STR_KERN_MAJOR" = "0.5.11" || test "$STR_KERN_MAJOR" = "5.11"; then
     279                elif test "x$STR_KERN_MAJOR" = "x0.5.11" || test "x$STR_KERN_MAJOR" = "x5.11"; then
    280280                    HOST_OS_MAJORVERSION="11"
    281281                else
     
    288288                    BRANCH_VERSION=$STR_KERN_MAJOR
    289289                    HOST_OS_MAJORVERSION=`echo "$BRANCH_VERSION" | cut -f2 -d'-' | cut -f1,2 -d'.'`
    290                     if test "$HOST_OS_MAJORVERSION" = "5.12"; then
     290                    if test "x$HOST_OS_MAJORVERSION" = "x5.12"; then
    291291                        HOST_OS_MAJORVERSION="12"
    292292                        HOST_OS_MINORVERSION=`echo "$BRANCH_VERSION" | cut -f2 -d'-' | cut -f6 -d'.'`
     
    327327    else
    328328        HOST_OS_MAJORVERSION=`uname -r`
    329         if test -z "$HOST_OS_MAJORVERSION" || test "$HOST_OS_MAJORVERSION" != "5.10";  then
     329        if test -z "$HOST_OS_MAJORVERSION" || test "x$HOST_OS_MAJORVERSION" != "x5.10";  then
    330330            # S11 without 'pkg'?? Something's wrong... bail.
    331331            errorprint "Solaris $HOST_OS_MAJORVERSION detected without executable $BIN_PKG !? I are confused."
     
    348348
    349349            REMOTE_S10=`$BIN_PKGCHK -l -p /kernel/amd64/genunix $BASEDIR_PKGOPT 2> /dev/null | grep SUNWckr | tr -d ' \t'`
    350             if test ! -z "$REMOTE_S10" && test "$REMOTE_S10" = "SUNWckr"; then
     350            if test ! -z "$REMOTE_S10" && test "x$REMOTE_S10" = "xSUNWckr"; then
    351351                HOST_OS_MAJORVERSION="10"
    352352                HOST_OS_MINORVERSION=""
     
    365365{
    366366    currentzone=`zonename`
    367     if test "$currentzone" != "global"; then
     367    if test "x$currentzone" != "xglobal"; then
    368368        errorprint "This script must be run from the global zone."
    369369        exit 1
     
    376376{
    377377    currentisa=`uname -i`
    378     if test "$currentisa" = "i86xpv"; then
     378    if test "x$currentisa" = "xi86xpv"; then
    379379        errorprint "VirtualBox cannot run under xVM Dom0! Fatal Error, Aborting installation!"
    380380        exit 1
     
    387387{
    388388    cputype=`isainfo -k`
    389     if test "$cputype" != "amd64" && test "$cputype" != "i386"; then
     389    if test "x$cputype" != "xamd64" && test "x$cputype" != "xi386"; then
    390390        errorprint "VirtualBox works only on i386/amd64 hosts, not $cputype"
    391391        exit 1
     
    459459
    460460    if test -n "$modperm"; then
    461         if test "$nullop" = "$NULLOP"; then
     461        if test "x$nullop" = "x$NULLOP"; then
    462462            $BIN_ADDDRV $BASEDIR_OPT -m"$modperm" $modname  >/dev/null 2>&1
    463463        else
     
    465465        fi
    466466    else
    467         if test "$nullop" = "$NULLOP"; then
     467        if test "x$nullop" = "x$NULLOP"; then
    468468            $BIN_ADDDRV $BASEDIR_OPT $modname >/dev/null 2>&1
    469469        else
     
    472472    fi
    473473
    474     if test $? -ne 0; then
     474    if test "$?" -ne 0; then
    475475        subprint "Adding: $moddesc module ...FAILED!"
    476         if test "$fatal" = "$FATALOP"; then
     476        if test "x$fatal" = "x$FATALOP"; then
    477477            exit 1
    478478        fi
     
    499499    if test "$?" -eq 0; then
    500500        UPDATEBOOTARCHIVE=1
    501         if test "$ISIPS" != "$IPSOP"; then
     501        if test "x$ISIPS" != "x$IPSOP"; then
    502502            $BIN_REMDRV $BASEDIR_OPT $modname
    503503        else
     
    510510        else
    511511            subprint "Removing: $moddesc  ...FAILED!"
    512             if test "$fatal" = "$FATALOP"; then
     512            if test "x$fatal" = "x$FATALOP"; then
    513513                exit 1
    514514            fi
     
    539539    if test -n "$modid"; then
    540540        $BIN_MODUNLOAD -i $modid
    541         if test $? -eq 0; then
     541        if test "$?" -eq 0; then
    542542            subprint "Unloaded: $moddesc module"
    543543        else
     
    546546            # Our automated tests are probably too quick... Fix properly later.
    547547            #
    548             result=$?
     548            result="$?"
    549549            if test "$retry" -eq 1; then
    550550                cmax=15
     
    559559                    fi
    560560                    $BIN_MODUNLOAD -i $modid
    561                     result=$?
     561                    result="$?"
    562562                done
    563563            fi
     
    565565            if test "$result" -ne 0; then
    566566                subprint "Unloading: $moddesc module ...FAILED!"
    567                 if test "$fatal" = "$FATALOP"; then
     567                if test "x$fatal" = "x$FATALOP"; then
    568568                    exit 1
    569569                fi
     
    596596    fatal=$3
    597597    $BIN_MODLOAD -p $modname
    598     if test $? -eq 0; then
     598    if test "$?" -eq 0; then
    599599        return 0
    600600    else
    601601        subprint "Loading: $moddesc module ...FAILED!"
    602         if test "$fatal" = "$FATALOP"; then
     602        if test "x$fatal" = "x$FATALOP"; then
    603603            exit 1
    604604        fi
     
    659659    if test "$REMOTEINST" -eq 0; then
    660660        /usr/sbin/devfsadm -i "$MOD_VBOXDRV"
    661         if test $? -ne 0 || test ! -h "/dev/vboxdrv" || test ! -h "/dev/vboxdrvu" ; then
     661        if test "$?" -ne 0 || test ! -h "/dev/vboxdrv" || test ! -h "/dev/vboxdrvu" ; then
    662662            errorprint "Failed to create device link for $MOD_VBOXDRV."
    663663            exit 1
     
    713713        fi
    714714    fi
    715     if test "$try_vboxusb" = "yes"; then
     715    if test "x$try_vboxusb" = "xyes"; then
    716716        # Add a group "vboxuser" (8-character limit) for USB access.
    717717        # All users which need host USB-passthrough support will have to be added to this group.
     
    731731        if test "$REMOTEINST" -eq 0; then
    732732            /usr/sbin/devfsadm -i  "$MOD_VBOXUSBMON"
    733             if test $? -ne 0; then
     733            if test "$?" -ne 0; then
    734734                errorprint "Failed to create device link for $MOD_VBOXUSBMON."
    735735                exit 1
     
    900900        if test "$?" -eq 1; then
    901901            subprint "Terminating: $procname  ...FAILED!"
    902             if test "$fatal" = "$FATALOP"; then
     902            if test "x$fatal" = "x$FATALOP"; then
    903903                exit 1
    904904            fi
     
    926926
    927927    $BIN_SVCS "$3" >/dev/null 2>&1
    928     while test $? -ne 0;
     928    while test "$?" -ne 0;
    929929    do
    930930        sleep 1
     
    982982    if test "$HOST_OS_MAJORVERSION" -gt 11 || (test "$HOST_OS_MAJORVERSION" -eq 11 && test "$HOST_OS_MINORVERSION" -gt 174); then
    983983        vanityname=`dladm show-phys -po link,device | grep vboxnet0 | cut -f1 -d':'`
    984         if test $? -eq 0 && test ! -z "$vanityname" && test "$vanityname" != "vboxnet0"; then
     984        if test "$?" -eq 0 && test ! -z "$vanityname" && test "x$vanityname" != "xvboxnet0"; then
    985985            dladm rename-link "$vanityname" vboxnet0
    986             if test $? -ne 0; then
     986            if test "$?" -ne 0; then
    987987                errorprint "Failed to rename vanity interface ($vanityname) to vboxnet0"
    988988            fi
     
    10241024                sed -e '/#VirtualBox_SectionStart/,/#VirtualBox_SectionEnd/d' $nmaskfile > $nmaskbackupfile
    10251025
    1026                 if test $recreatelink -eq 1; then
     1026                if test "$recreatelink" -eq 1; then
    10271027                    # Check after removing our settings if /etc/netmasks is identifcal to /etc/inet/netmasks
    10281028                    anydiff=`diff $nmaskbackupfile "$PKG_INSTALL_ROOT/etc/inet/netmasks"`
     
    10361036                inst=0
    10371037                networkn=56
    1038                 while test $inst -ne 1; do
     1038                while test "$inst" -ne 1; do
    10391039                    echo "192.168.$networkn.0 255.255.255.0" >> $nmaskbackupfile
    10401040                    inst=`expr $inst + 1`
     
    10451045
    10461046                # Recreate /etc/netmasks as a link if necessary
    1047                 if test $recreatelink -eq 1; then
     1047                if test "$recreatelink" -eq 1; then
    10481048                    cp -f "$PKG_INSTALL_ROOT/etc/netmasks" "$PKG_INSTALL_ROOT/etc/inet/netmasks"
    10491049                    ln -sf ./inet/netmasks "$PKG_INSTALL_ROOT/etc/netmasks"
    1050                 elif test $recreatelink -eq 2; then
     1050                elif test "$recreatelink" -eq 2; then
    10511051                    warnprint "/etc/netmasks is a symlink (to /etc/inet/netmasks) that older"
    10521052                    warnprint "VirtualBox installers incorrectly overwrote. Now the contents"
     
    10731073    # use ipadm for Solaris 12 and newer
    10741074    if test "$HOST_OS_MAJORVERSION" -ge 12; then
    1075         while test $inst -ne $MOD_VBOXNET_INST; do
     1075        while test "$inst" -ne $MOD_VBOXNET_INST; do
    10761076            vboxnetup=`$BIN_IPADM show-addr -p -o addrobj vboxnet$inst >/dev/null 2>&1`
    10771077            if test "$?" -eq 0; then
     
    10801080                if test "$?" -ne 0; then
    10811081                    errorprint "VirtualBox NetAdapter 'vboxnet$inst' couldn't be removed (probably in use)."
    1082                     if test "$fatal" = "$FATALOP"; then
     1082                    if test "x$fatal" = "x$FATALOP"; then
    10831083                        exit 1
    10841084                    fi
     
    10901090    else
    10911091        inst=0
    1092         while test $inst -ne $MOD_VBOXNET_INST; do
     1092        while test "$inst" -ne $MOD_VBOXNET_INST; do
    10931093            vboxnetup=`$BIN_IFCONFIG vboxnet$inst >/dev/null 2>&1`
    10941094            if test "$?" -eq 0; then
     
    10961096                if test "$?" -ne 0; then
    10971097                    errorprint "VirtualBox NetAdapter 'vboxnet$inst' couldn't be unplumbed (probably in use)."
    1098                     if test "$fatal" = "$FATALOP"; then
     1098                    if test "x$fatal" = "x$FATALOP"; then
    10991099                        exit 1
    11001100                    fi
     
    11081108                if test "$?" -ne 0; then
    11091109                    errorprint "VirtualBox NetAdapter 'vboxnet$inst' IPv6 couldn't be unplumbed (probably in use)."
    1110                     if test "$fatal" = "$FATALOP"; then
     1110                    if test "x$fatal" = "x$FATALOP"; then
    11111111                        exit 1
    11121112                    fi
     
    12041204                inst=0
    12051205                networkn=56
    1206                 while test $inst -ne 1; do
     1206                while test "$inst" -ne 1; do
    12071207                    echo "vboxnet$inst  static 192.168.$networkn.1" >> $nwambackupfile
    12081208                    inst=`expr $inst + 1`
Note: See TracChangeset for help on using the changeset viewer.

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