aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAndrew Lewman <andrew@torproject.org>2007-11-22 17:46:22 +0000
committerAndrew Lewman <andrew@torproject.org>2007-11-22 17:46:22 +0000
commit2075c16e1bff48a38233e1b4899abf95f65fd4d3 (patch)
tree2de2bc1d952e00231d8c39eafec2f584d4b65cd4 /contrib
parent22cd3a4baa17fd2357b3c4e5cd873f6836e6eb30 (diff)
downloadtor-2075c16e1bff48a38233e1b4899abf95f65fd4d3.tar.gz
tor-2075c16e1bff48a38233e1b4899abf95f65fd4d3.zip
Patch from martin fong in flyspray #555, backport candidate once
tested. Update torbutton version in TorPostFlight. svn:r12554
Diffstat (limited to 'contrib')
-rw-r--r--contrib/osx/TorPostflight2
-rwxr-xr-xcontrib/osx/addsysuser109
2 files changed, 62 insertions, 49 deletions
diff --git a/contrib/osx/TorPostflight b/contrib/osx/TorPostflight
index ddcb0a79c4..b9b34fcc84 100644
--- a/contrib/osx/TorPostflight
+++ b/contrib/osx/TorPostflight
@@ -46,7 +46,7 @@ TORGROUP=daemon
TARGET=$2/Library/Tor
TORDIR=$TARGET/var/lib/tor
LOGFILE=/var/log/tor.log
-TORBUTTON_VERSION="1.1.9.1-alpha"
+TORBUTTON_VERSION="1.1.11-alpha"
# Check defaults for TARGET
if [ "$TARGET" == "//Library/Tor" ]; then
diff --git a/contrib/osx/addsysuser b/contrib/osx/addsysuser
index 21f62eb8ef..50797f1ab0 100755
--- a/contrib/osx/addsysuser
+++ b/contrib/osx/addsysuser
@@ -11,60 +11,73 @@
ROOTPROP=/
if [ "`whoami`" != "root" ]; then
-echo "You must be root to execute this script."
-exit
+ echo "You must be root to execute this script."
+ exit
fi
if [ "x$3" = "x" ]; then
-echo 'Usage: addsysuser <username> "<full name>" <homedir>'
-exit 0
+ echo 'Usage: addsysuser <username> "<full name>" <homedir>'
+ exit 0
fi
+
username=$1
realname=$2
homedir=$3
+
if [ -x /usr/bin/dscl ]; then
- # Determine the gid of the daemon group
- gid=`dscl . -read /groups/daemon gid`
- if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then
- echo The account $username already exists.
- exit 0
- fi
- # home is the local path to the home directory
- home=/Users/$username
- echo Creating account for $username...
- dscl . -create /users/$username
- dscl . -create /users/$username _writers_tim_passwd $username
- dscl . -create /users/$username realname $realname
- dscl . -create /users/$username _writers_passwd $username
- dscl . -create /users/$username gid $gid
- dscl . -create /users/$username home $homedir
- dscl . -create /users/$username name $username
- dscl . -create /users/$username passwd '*'
- dscl . -create /users/$username shell /dev/null
+ # Determine the gid of the daemon group
+ gid=`dscl . -read /groups/daemon gid`
+ if [ "x`dscl . -list /users|cut -f2 -d' '|grep $username`" != "x" ]; then
+ echo The account $username already exists.
+ exit 0
+ fi
+ if [ -x /usr/bin/nidump ]; then
+ uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
+ else
+ _tmp=/tmp/_dsexport_tmp.txt.$$
+ rm -f $_tmp
+ dsexport $_tmp '/Local/Default' 'dsRecTypeStandard:Users' > /dev/null 2>&1
+ uiddef=`cat $_tmp | sed 's/\\\://g' | cut -d: -f6 | grep '^[0-9]' | sort -n | grep -v '^[56789]..' | grep -v '^....$' | tail -n 1`
+ rm -f $_tmp
+ fi
+ uiddef=`echo $uiddef + 1 | bc`
+ dscl . -create /users/$username uid $uiddef
+ # home is the local path to the home directory
+ home=/Users/$username
+ echo Creating account for $username...
+ dscl . -create /users/$username
+ dscl . -create /users/$username _writers_tim_passwd $username
+ dscl . -create /users/$username realname $realname
+ dscl . -create /users/$username _writers_passwd $username
+ dscl . -create /users/$username gid $gid
+ dscl . -create /users/$username home $homedir
+ dscl . -create /users/$username name $username
+ dscl . -create /users/$username passwd '*'
+ dscl . -create /users/$username shell /dev/null
else
- # Determine the gid of the daemon group
- gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
- if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
- echo The account $username already exists.
- exit 0
- fi
- # home is the local path to the home directory
- home=/Users/$username
- # defhome is what goes into NetInfo
- defhome="/Network/Servers/MyServer/Users"
- #echo "Determining next available system uid (please be patient)..."
- # Uids over 500 are for system users.
- uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
- uiddef=`echo $uiddef + 1 |bc`
- echo Creating account for $username...
- niutil -create $ROOTPROP /users/$username
- niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username
- niutil -createprop $ROOTPROP /users/$username realname $realname
- niutil -createprop $ROOTPROP /users/$username _writers_passwd $username
- niutil -createprop $ROOTPROP /users/$username uid $uiddef
- #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
- niutil -createprop $ROOTPROP /users/$username gid $gid
- niutil -createprop $ROOTPROP /users/$username home $homedir
- niutil -createprop $ROOTPROP /users/$username name $username
- niutil -createprop $ROOTPROP /users/$username passwd '*'
- niutil -createprop $ROOTPROP /users/$username shell /dev/null
+ # Determine the gid of the daemon group
+ gid=`niutil -readprop $ROOTPROP /groups/daemon gid`
+ if [ "x`niutil -list $ROOTPROP /users|cut -f2 -d' '|grep $username`" != "x" ]; then
+ echo The account $username already exists.
+ exit 0
+ fi
+ # home is the local path to the home directory
+ home=/Users/$username
+ # defhome is what goes into NetInfo
+ defhome="/Network/Servers/MyServer/Users"
+ #echo "Determining next available system uid (please be patient)..."
+ # Uids over 500 are for system users.
+ uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '^[56789]..' |grep -v '^....$' | tail -n 1`
+ uiddef=`echo $uiddef + 1 |bc`
+ echo Creating account for $username...
+ niutil -create $ROOTPROP /users/$username
+ niutil -createprop $ROOTPROP /users/$username _writers_tim_passwd $username
+ niutil -createprop $ROOTPROP /users/$username realname $realname
+ niutil -createprop $ROOTPROP /users/$username _writers_passwd $username
+ niutil -createprop $ROOTPROP /users/$username uid $uiddef
+ #niutil -createprop $ROOTPROP /users/$username home_loc "<home_dir><url>afp://afp.server.com/Users/</url><path>$username</path></home_dir>"
+ niutil -createprop $ROOTPROP /users/$username gid $gid
+ niutil -createprop $ROOTPROP /users/$username home $homedir
+ niutil -createprop $ROOTPROP /users/$username name $username
+ niutil -createprop $ROOTPROP /users/$username passwd '*'
+ niutil -createprop $ROOTPROP /users/$username shell /dev/null
fi