Opened 13 years ago

Last modified 8 years ago

#555 closed enhancement (Implemented)

Mac OS X Tiger Universal Bundle addsysuser RFE

Reported by: mwfong Owned by: phobos
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: mwfong Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


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


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


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]

Child Tickets

Change History (4)

comment:1 Changed 13 years ago by mwfong


set _tmp=/tmp/_dsexport_tmp.txt.$$

should read


comment:2 Changed 13 years ago by phobos

tested quickly and committed as r12554. I'll do some more extensive testing against panther and tiger. Thanks!

comment:3 Changed 13 years ago by phobos

flyspray2trac: bug closed.

comment:4 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.