VirtualBox

Changeset 36759 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
Apr 20, 2011 4:40:13 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71302
Message:

Additions/linux/Installer: use only pkexec, sudo and su for the autorun function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/runasroot.sh

    r36681 r36759  
    5757esac
    5858
    59 case "$DISPLAY" in ?*)
    60     KDESUDO="`mywhich kdesudo`"
    61     case "$KDESUDO" in ?*)
    62         eval "`quotify "$KDESUDO"` --comment `quotify "$DESCRIPTION"` -- $COMMAND"
    63         exit
     59case "$HAS_TERMINAL" in "")
     60    case "$DISPLAY" in ?*)
     61        KDESUDO="`mywhich kdesudo`"
     62        case "$KDESUDO" in ?*)
     63            eval "`quotify "$KDESUDO"` --comment `quotify "$DESCRIPTION"` -- $COMMAND"
     64            exit
     65            ;;
     66        esac
     67
     68        KDESU="`mywhich kdesu`"
     69        case "$KDESU" in ?*)
     70            "$KDESU" -c "$COMMAND"
     71            exit
     72            ;;
     73        esac
     74
     75        GKSU="`mywhich gksu`"
     76        case "$GKSU" in ?*)
     77            # Older gksu does not grok --description nor '--' and multiple args.
     78            # @todo which versions do?
     79            # "$GKSU" --description "$DESCRIPTION" -- "$@"
     80            # Note that $GKSU_SWITCHES is NOT quoted in the following
     81            "$GKSU" $GKSU_SWITCHES "$COMMAND"
     82            exit
     83            ;;
     84        esac
    6485        ;;
    65     esac
    66 
    67     GKSU="`mywhich gksu`"
    68     case "$GKSU" in ?*)
    69         # Older gksu does not grok --description nor '--' and multiple args.
    70         # @todo which versions do?
    71         # "$GKSU" --description "$DESCRIPTION" -- "$@"
    72         # Note that $GKSU_SWITCHES is NOT quoted in the following
    73         "$GKSU" $GKSU_SWITCHES "$COMMAND"
    74         exit
    75         ;;
    76     esac
     86    esac # $DISPLAY
    7787    ;;
    78 esac # $DISPLAY
     88esac # ! $HAS_TERMINAL
    7989
    8090# pkexec may work for ssh console sessions as well if the right agents
     
    93103
    94104case "$HAS_TERMINAL" in ?*)
     105        USE_SUDO=
     106        grep Ubuntu /etc/lsb-release && USE_SUDO=true
     107        # On Ubuntu we need sudo instead of su.  Assume this works, and is only
     108        # needed for Ubuntu until proven wrong.
     109        case $USE_SUDO in true)
     110            SUDO_COMMAND="`quotify "$SUDO"` -- $COMMAND"
     111            eval "$SUDO_COMMAND"
     112            exit
     113            ;;
     114        esac
     115
    95116    SU="`mywhich su`"
    96117    case "$SU" in ?*)
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