Changeset 98c44f1


Ignore:
Timestamp:
Sep 13, 2011 1:16:12 AM (10 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
667e434
Parents:
b0718f6
Message:

Abort by default if I2P is attempted to be started as root; allow setting
ALLOW_ROOT to override.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/i2prouter

    rb0718f6 r98c44f1  
    5959# Location of the pid file.
    6060PIDDIR="$I2PTEMP"
     61
     62# If you'd like to run I2P as root (not recommended), uncomment the
     63# following line
     64#ALLOW_ROOT=true
    6165
    6266# FIXED_COMMAND tells the script to use a hard coded action rather than
     
    15441548}
    15451549
     1550checkifstartingasroot() {
     1551    if [ ! `grep ^RUN_AS_USER $0` ] && [ ! `grep ^ALLOW_ROOT $0` ] && [ `id -ur` = '0' ]; then
     1552        echo "Running I2P as the root user is *not* recommended."
     1553        showsetusermesg
     1554        echo
     1555        echo "If you'd like to run as root anyway you can edit"
     1556        echo "$0 and set ALLOW_ROOT=true instead."
     1557        exit 1
     1558    fi
     1559    }
    15461560docommand() {
    15471561    case "$COMMAND" in
    15481562        'console')
     1563            checkifstartingasroot
    15491564            checkUser touchlock "$@"
    15501565            if [ ! -n "$FIXED_COMMAND" ] ; then
     
    15551570
    15561571        'start')
     1572            checkifstartingasroot
    15571573            if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
    15581574                macosxstart
Note: See TracChangeset for help on using the changeset viewer.