Mac OS X 0.1.2.18 Tiger Universal Bundle addsysuser RFE
One side-effect of the 2007-06-12 modifications to addsysuser for Mac OS X 10.5 (Leopard) is that the "_tor" account is no longer assigned an explicit uid. Cf., the statement in "else" clause that executes
uiddef=nidump passwd / | cut -d: -f3 | sort -n | grep -v '!^[56789]..' |grep -v '!^....$' | tail -n 1
However, these modifications now cause the "else" clause that employs nidump to never be executed even for older versions of the Mac OS X (including 10.2 through 10.4) because they (too) have /usr/bin/dscl. Therefore, I suggest that something along the following be added within the "if [ -x /usr/bin/dscl ]; then" clause:
if [ -x /usr/bin/nidump ]; then
uiddef=`nidump passwd / | cut -d: -f3 | sort -n | grep -v '!^[56789]..' |grep -v '!^....$' | tail -n 1`
else
set _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
(Note that the "if [ -x /usr/bin/nidump ]; then" protection exists because OSes prior to 10.5 do not have /usr/bin/dsexport (sigh).)
[Automatically added by flyspray2trac: Operating System: OSX 10.5 Leopard]
Trac:
Username: mwfong