VirtualBox

Changeset 88527 in vbox for trunk/src/VBox/Installer/darwin


Ignore:
Timestamp:
Apr 15, 2021 11:46:26 AM (4 years ago)
Author:
vboxsync
Message:

Autostart/darwin: As part of shell script best practices enclose variable
references with double quotes to prevent reinterpretation of any special
characters within the quoted string. Observed when investigating
Linux autostart-service.sh issues in bugref:9987.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh

    r82968 r88527  
    2424    for user in `dscl . -list /Users`
    2525    do
    26         HOMEDIR=`dscl . -read /Users/${user} | grep NFSHomeDirectory | sed 's/NFSHomeDirectory: //g'`
    27         USERSHELL=`dscl . -read /Users/${user} | grep UserShell | sed 's/UserShell: //g'`
     26        HOMEDIR=`dscl . -read /Users/"${user}" NFSHomeDirectory | sed 's/NFSHomeDirectory: //g'`
     27        USERSHELL=`dscl . -read /Users/"${user}" UserShell | sed 's/UserShell: //g'`
    2828
    2929        # Check for known home directories and shells for daemons
     
    3737            start)
    3838                # Start the daemon
    39                 su ${user} -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --start --background --config ${CONFIG}"
     39                su "${user}" -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --start --background --config ${CONFIG}"
    4040                ;;
    4141            stop)
    42                 # Start the daemon
    43                 su ${user} -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --stop --config ${CONFIG}"
     42                # Stop the daemon
     43                su "${user}" -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --stop --config ${CONFIG}"
    4444                ;;
    4545               *)
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