Opened 11 years ago

Last modified 7 years ago

#552 closed defect (Fixed)

Mac OS X 0.1.2.18 Tiger Universal Bundle postflight Error

Reported by: mwfong Owned by: phobos
Priority: High Milestone:
Component: Core Tor/Tor Version: 0.1.2.18
Severity: Keywords:
Cc: mwfong, nickm, arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tor.pkg:postflight contains the following code:

# Create the configuration file only if there wasn't one already.
if [ ! -f $TARGET/torrc ]; then

cp $TARGET/torrc.sample $TARGET/torrc.sample

fi

which _should_ read

# Create the configuration file only if there wasn't one already.
if [ ! -f $TARGET/torrc ]; then

cp $TARGET/torrc.sample $TARGET/torrc

fi

[Automatically added by flyspray2trac: Operating System: OSX 10.5 Leopard]

Child Tickets

Change History (17)

comment:1 Changed 11 years ago by arma

Looks like this was addressed in r12309,
http://archives.seul.org/or/cvs/Nov-2007/msg00004.html

It'll be in 0.1.2.19, whenever that comes out. Do you think this
is urgent enough to put out a new stable release sooner?

comment:2 Changed 11 years ago by mwfong

If Tor can function _without_ a torrc file, it's not critical for most
users; if Tor _doesn't_ function properly without a torrc torrc file,
then the current distribution is broken for all Mac users.

When we're installing Tor for our Cyber-TA BotHunter system, the
installer waits for the existence of torrc so it can add
LongLivedPorts -- consequently, this problem causes our installer to
hang. This wasn't a problem with 0.1.2.18, which doesn't have this
bug; however, 0.1.2.18 doesn't work with Mac OS X 10.5 (Leopard), and
I'd rather reference a single Tor distribution for Panther, Tiger, and
Leopard. Thus, from our perspective, it would be nice to have a
stable release, unless the release of 0.1.2.19 is imminent.

comment:3 Changed 11 years ago by mwfong

"This wasn't a problem with 0.1.2.18" should read "This wasn't a problem
with 0.1.2.17". Cheers!

comment:4 Changed 11 years ago by mwfong

In the short term, I'm willing to create a local copy of
Tor-0.1.2.18-tiger-universal-Bundle.dmg that incorporates the
corrected postflight file. However, because I'm unfamilar with how
the disk image was built, is there a script that creates the .dmg file
that you can provide me? Thanks!

comment:5 Changed 11 years ago by phobos

comment:6 Changed 11 years ago by mwfong

As a workaround, I decided to correct the postflight file to create
torrc. However, once I did that, I encountered the following error in
Tor's installer script:

Starting Tor Service
Nov 19 15:44:50.769 [notice] Tor v0.1.2.18. This is experimental software. Do not rely on it for strong anonymity.
Nov 19 15:44:50.775 [notice] Enabling experimental OS X kqueue support with libevent 1.3e. If this turns out to not work, set the environment variable EVENT_NOKQUEUE, and tell the Tor developers.
Nov 19 15:44:50.775 [notice] Initialized libevent version 1.3e using method kqueue. Good.
Nov 19 15:44:50.775 [notice] Opening Socks listener on 127.0.0.1:9050
Nov 19 15:44:50.775 [warn] Couldn't open file for 'Log notice file /var/log/tor/tor.log'
Nov 19 15:44:50.775 [notice] Closing partially-constructed listener Socks listener on 127.0.0.1:9050
Nov 19 15:44:50.776 [warn] Failed to parse/validate config: Failed to init Log options. See logs for details.
Nov 19 15:44:50.776 [err] Reading config failed--see warnings above.

The cause for this error is that the directory, /var/log/tor, was not
created as part of the installation although /var/log/tor.log was (--
I also noticed that torrc/torrc.sample doesn't explicitly specify the
Tor log file path, and thus I'm not too sure _where_ this path is
defined).

As a test, I made these changes to postflight:

TORDIR=$TARGET/var/lib/tor

  • LOGFILE=/var/log/tor/tor.log

+ LOGDIR=dirname $LOGFILE

:

# Check its permissions.
chown $TORUSER $TORDIR
chgrp daemon $TORDIR
chmod 700 $TORDIR

+ if [ ! -d $LOGDIR ]; then
+ mkdir -p $LOGDIR
+ chown $TORUSER $LOGDIR
+ chgrp daemon $LOGDIR
+ chmod 750 $LOGDIR
+ fi

This seemed to solve the problem, but I'm uncomfortable about the
implicit Tor log file path definition.

(As an aside, I noticed that $TORUSER is implicitly "nobody" -- and I
suspect that this is a consequence of the modifications made to the
Mac OS X-specific addsysuser script which now invokes dscl instead of
niutil.)

P.S.: I found and used the application, DropDMG, to create the .dmg
image.

comment:7 Changed 11 years ago by phobos

The log file for tor wants to be in /var/log/tor.log. There was another bug I can't find right now by a few people asking
for the log file to show up in osx's "console viewer" application. The app can't look in subdirectories, so we moved the
log file to /var/log/ by default.

The tor user should be _tor, not "nobody".

comment:8 Changed 11 years ago by phobos

I can't create a single panther/tiger/leopard package, as apple changes the system between each OS and in some cases,
is breaking backwards capability. Panther also doesn't understand the universal binary. Other than the actual binaries,
the configurations and placements should be the same across all distributions. I'll investigate dscl not creating _tor
as a bug.

comment:9 Changed 11 years ago by phobos

Tor requires a "torrc" because the start script calls one, $TORCMD -f "$TORCONF" If $TORCONF doesn't exist, the script
errors and quits. Otherwise, Tor will start just fine without a start script, but then treats OSX as a generic unix
system, rather than where OSX expects things to live. I supposed I could wrap a if;then around the TORCONF setting. However, as nick pointed out, the installer should put one in place going forward.

comment:10 Changed 11 years ago by mwfong

The log file for tor wants to be in /var/log/tor.log.

Given this, where did the (implicit) reference to /var/log/tor/tor.log
come from?

The tor user should be _tor, not "nobody".

The problem is that _tor's uid is nobody's uid. (Cf., the previous
niutil implementation that assigns an unassigned and unique ID as the
uid.)

Tor requires a "torrc" because the start script calls one, $TORCMD
-f "$TORCONF" If $TORCONF doesn't exist, the script errors and
quits.

Given this, Mac OS X 0.1.2.18 Tiger Universal Bundle is broken and
should be replaced.

comment:11 Changed 11 years ago by phobos

I was hoping to have 0.2.0.13-alpha to test out the changes before updating 0.1.2.18c for osx. Basically, the changes
need more testing on disparate systems.

comment:12 Changed 11 years ago by phobos

I believe I fixed everything in the 0.1.2.18-dev test packages. Please confirm. Thanks!

comment:13 Changed 11 years ago by arma

The packages Andrew talks about are linked from here:
http://archives.seul.org/or/talk/Jan-2008/msg00157.html
Let us know if that works!

comment:14 Changed 11 years ago by mwfong

I've tested against

https://www.torproject.org/dist/osx/Tor-0.1.2.18-dev-tiger-universal-Bundle.dmg

under both Tiger and Leopard and the installations were
successful. (N.b., I _haven't_ tested Panther's

https://www.torproject.org/dist/osx-old/Tor-0.1.2.18-dev-panther-ppc-Bundle.dmg

)

Please give me head's up when 0.1.2.18-dev is officially released. Thanks!

comment:15 Changed 11 years ago by arma

Great. I suggest you subscribe to the or-announce mailing list:
http://archives.seul.org/or/announce/
(send mail to majordomo@… with a body of 'subscribe or-announce')
It's very low traffic, as you can see.

There's also an rss feed for it, if you prefer those:
http://rss.gmane.org/gmane.network.onion-routing.announce

comment:16 Changed 11 years ago by phobos

flyspray2trac: bug closed.

comment:17 Changed 7 years ago by nickm

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