Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#8509 closed defect (fixed)

Tor/arm crach when run with out root preveliges.

Reported by: Nahita Owned by: atagar
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Archived/Nyx Version: Tor: 0.2.3.25
Severity: Keywords: tor arm
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

So I have been busy the last couple of days trying to get my tor relay back online on my Ubuntu 12.04 64-bit server. But I have encountered a couple of problems I can not solve.

Running arm as a non-root gives me the simple feed back that it can not create a torrc and torrc_bak file because of permission issues and then stop the starting procedure.

Changing the permission of torrc and torrc_bak to allow all users and groups make arm crash with the following stack trace:

(3 different occasions)

sudo -u debian-tor arm
Traceback (most recent call last):

File "/usr/share/arm/starter.py", line 578, in <module>

cli.controller.startTorMonitor(time.time() - initTime)

File "/usr/share/arm/cli/controller.py", line 700, in startTorMonitor

curses.wrapper(drawTorMonitor, startTime)

File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper

return func(stdscr, *args, kwds)

File "/usr/share/arm/cli/controller.py", line 773, in drawTorMonitor

cli.menu.menu.showMenu()

File "/usr/share/arm/cli/menu/menu.py", line 114, in showMenu

cursor.handleKey(key)

File "/usr/share/arm/cli/menu/menu.py", line 46, in handleKey

else: self._isDone = self._selection.select()

File "/usr/share/arm/cli/menu/item.py", line 62, in select

self._callback()

File "/usr/share/arm/cli/wizard.py", line 377, in showWizard

shutil.copy(torrcLocation, torrcLocation + "_bak")

File "/usr/lib/python2.7/shutil.py", line 118, in copy

copymode(src, dst)

File "/usr/lib/python2.7/shutil.py", line 91, in copymode

os.chmod(dst, mode)

OSError: [Errno 1] Operation not permitted: '/home/USER/.arm/torrc_bak'


sudo -u debian-tor arm
Traceback (most recent call last):

File "/usr/share/arm/starter.py", line 578, in <module>

cli.controller.startTorMonitor(time.time() - initTime)

File "/usr/share/arm/cli/controller.py", line 700, in startTorMonitor

curses.wrapper(drawTorMonitor, startTime)

File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper

return func(stdscr, *args, kwds)

File "/usr/share/arm/cli/controller.py", line 795, in drawTorMonitor

cli.wizard.showWizard()

File "/usr/share/arm/cli/wizard.py", line 377, in showWizard

shutil.copy(torrcLocation, torrcLocation + "_bak")

File "/usr/lib/python2.7/shutil.py", line 118, in copy

copymode(src, dst)

File "/usr/lib/python2.7/shutil.py", line 91, in copymode

os.chmod(dst, mode)

OSError: [Errno 1] Operation not permitted: '/home/USER/.arm/torrc_bak'


sudo -u debian-tor arm
'Traceback (most recent call last):

File "/usr/share/arm/starter.py", line 578, in <module>

cli.controller.startTorMonitor(time.time() - initTime)

File "/usr/share/arm/cli/controller.py", line 700, in startTorMonitor

curses.wrapper(drawTorMonitor, startTime)

File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper

return func(stdscr, *args, kwds)

File "/usr/share/arm/cli/controller.py", line 773, in drawTorMonitor

cli.menu.menu.showMenu()

File "/usr/share/arm/cli/menu/menu.py", line 114, in showMenu

cursor.handleKey(key)

File "/usr/share/arm/cli/menu/menu.py", line 46, in handleKey

else: self._isDone = self._selection.select()

File "/usr/share/arm/cli/menu/item.py", line 62, in select

self._callback()

File "/usr/share/arm/cli/wizard.py", line 377, in showWizard

shutil.copy(torrcLocation, torrcLocation + "_bak")

File "/usr/lib/python2.7/shutil.py", line 118, in copy

copymode(src, dst)

File "/usr/lib/python2.7/shutil.py", line 91, in copymode

os.chmod(dst, mode)

OSError: [Errno 1] Operation not permitted: '/home/USER/.arm/torrc_bak'
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):

File "/usr/lib/python2.7/threading.py", line 551, in bootstrap_inner
File "/usr/share/arm/util/connections.py", line 476, in run
File "/usr/lib/python2.7/threading.py", line 141, in release

<type 'exceptions.TypeError'>: 'NoneType' object is not callable

Running arm with "sudo arm" works perfectly, but obviously its not desired.

Child Tickets

Change History (5)

comment:1 Changed 8 years ago by Nahita

Cc: nnahita@… added

comment:2 Changed 8 years ago by Nahita

Cc: nnahita@… removed

comment:3 Changed 8 years ago by Nahita

arm output when running as non-root:

[ARM_ERR] Unable to make torrc: [Errno 13] Permission denied '/home/USER/.arm/torrc'
[ARM_WARN] Unable to backup torrc: [Errno 13] Permission denied '/home/USER/.arm/torrc'

comment:4 Changed 8 years ago by Nahita

Resolution: fixed
Status: newclosed

comment:5 Changed 8 years ago by Nahita

sudo -H -u debian-tor arm
fixed it.

Note: See TracTickets for help on using tickets.