Opened 11 years ago

Last modified 5 years ago

#443 closed defect (Implemented)

niutil and nidump are no longer existant in 10.5 leopard, so you should use dscl instead

Reported by: dave Owned by: phobos
Priority: Low Milestone: 0.1.2.15
Component: Core Tor/Tor Version: 0.1.2.14
Severity: Keywords:
Cc: nickm, phobos, dave Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

as the niutil tool does not exist in osx 10.5 leopard installation of tor fails,
because the user _tor is not created.

instead of nidump you could maybe create the user via dscl

[Automatically added by flyspray2trac: Operating System: OSX 10.4 Tiger]

Child Tickets

Change History (18)

comment:1 Changed 11 years ago by nickm

Oh, crap. I'm the one who adapted the "addsysuser" script, but I don't have a copy of leopard. Do you know how to
do the same things addsysuser does, but using dscl or whatever replaces niutil?

comment:2 Changed 11 years ago by dave

i dont really know if i am allowed to tell, but actually dscl is included in 10.4 tiger, too so it should be no problem.
in fact you could just change the 10.4 version of tor to use dscl and it should play with 10.5, too.

this -should- work:

sudo dscl localhost -create /NetInfo/root/Users/_tor
sudo dscl localhost -create /NetInfo/root/Users/_tor uid the_uid
sudo dscl localhost -create /NetInfo/root/Users/_tor gid the_gid
sudo dscl localhost -create /NetInfo/root/Users/_tor home /the_homedir
sudo dscl localhost -create /NetInfo/root/Users/_tor passwd "*"

Now to finish up and add the group that we put the _tor user into.

sudo dscl localhost -create /NetInfo/root/Groups/_tor
sudo dscl localhost -create /NetInfo/root/Groups/_tor gid the_gid

this is not tested, but it should work.
if it works on a 10.4 system it should work with 10.5, too.

this could be helpful, too:
http://managingosx.wordpress.com/2006/09/15/add-a-user-to-the-admin-group-via-command-line-20/

comment:3 Changed 11 years ago by phobos

I'll test this out. For some reason we didn't use dscl.

comment:4 Changed 11 years ago by dave

Hi.

maybe this is helpfull, too. it's how the openfire jabber server installer does it:

+ #create user
+ dscl . -create /Users/wildfire
+
+ #set properties
+ dscl . -create /Users/wildfire PrimaryGroupID $WILDFIRE_GID
+ dscl . -create /Users/wildfire UniqueID $WILDFIRE_UID
+ dscl . -create /Users/wildfire UserShell /usr/bin/false
+ dscl . -create /Users/wildfire NFSHomeDirectory /usr/local/wildfire/
+ dscl . -create /Users/wildfire RealName "Jive Wildfire"
+ dscl . -passwd /Users/wildfire '*'

also i heard/read, that one should use dseditgroup.
it will allow one to add users to group records without having to have internal knowledge of the group schema.
(man dseditgroup for more information).

comment:5 Changed 11 years ago by dave

if you have a working version of tor installed this could be helpful, too in order to see how the "_tor" user has been created

1.) dscl
2.) read /NetInfo/Users/_tor

comment:6 Changed 11 years ago by phobos

I've started working on this. It should show up in a near future 0.2.0.x-alpha release. Thanks for bringing this up as an issue.

comment:7 Changed 11 years ago by phobos

Check out revision 10578. It works for me on osx 10.4 (tiger) reliably.

comment:8 Changed 11 years ago by dave

just saw your comment. will try it tonight and provide you with feedback.
best regards.

comment:9 Changed 11 years ago by dave

maybe something is wrong with the provided syntax in /doc/osx/tor-osx-dmg-creation.txt

the following command looks incorrect:

CONFDIR=/Library/Tor ./configure --prefix=/Library/Tor \
--bindir=/Library/Tor --sysconfdir=/Library \
--enable-static --disable-shared

and it is not executable as configure is not found.

comment:10 Changed 11 years ago by dave

actually config.guess, config.sub and install.sh seem to be missing, too.

comment:11 Changed 11 years ago by dave

lol. actually autogen.sh did the job ;-)
it works fine on both 10.4 and 10.5

comment:12 Changed 10 years ago by phobos

Great. I've tested this on 3 versions of OSX and it seems to work as well. Thanks!

comment:13 Changed 10 years ago by weasel

dave requested this bug be reopened

comment:14 Changed 10 years ago by phobos

Why is this re-opened? It appears to work just fine.

comment:15 Changed 10 years ago by nickm

My guess would be that it's re-opened because 0.1.2.x still uses the old script.

Is it time to backport?

comment:16 Changed 10 years ago by phobos

backported.

comment:17 Changed 10 years ago by phobos

flyspray2trac: bug closed.

comment:18 Changed 5 years ago by nickm

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