Opened 6 years ago

Closed 3 years ago

#5678 closed defect (wontfix)

Arm crashes if it lacks write permissons for home directory

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

Description

Arm defaults to putting its data directory in '~/.arm'. However, in at least one reported case they lacked write permissions there resulting in...

Traceback (most recent call last):
  File "/usr/share/arm/starter.py", line 543, in <module>
    cli.controller.startTorMonitor(time.time() - initTime)
  File "/usr/share/arm/cli/controller.py", line 683, in startTorMonitor
    curses.wrapper(drawTorMonitor, startTime)
  File "/usr/lib/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/share/arm/cli/controller.py", line 778, in drawTorMonitor
    cli.wizard.showWizard()
  File "/usr/share/arm/cli/wizard.py", line 313, in showWizard
    relaySelection = RelayType.RESUME if manager.isTorrcAvailable() else RelayType.RELAY
  File "/usr/share/arm/cli/controller.py", line 482, in isTorrcAvailable
    torrcLoc = self.getTorrcPath()
  File "/usr/share/arm/cli/controller.py", line 474, in getTorrcPath
    return self._controller.getDataDirectory() + "torrc"
  File "/usr/share/arm/cli/controller.py", line 401, in getDataDirectory
    if not os.path.exists(dataDir): os.makedirs(dataDir)
  File "/usr/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/ubuntu/.arm/'

We should make arm fall back to not having a data directory at all. This means making the getDataDirectory() callers accept a None response...

atagar@morrigan:~/Desktop/arm$ grep -R "getDataDirectory(" ./*
./release_rpm/src/cli/wizard.py:          dataDir = cli.controller.getController().getDataDirectory()
./release_rpm/src/cli/wizard.py:  dataDir = cli.controller.getController().getDataDirectory()
./release_rpm/src/cli/controller.py:  def getDataDirectory(self):
./release_rpm/src/cli/controller.py:    return self._controller.getDataDirectory() + "torrc"
./src/cli/wizard.py:          dataDir = cli.controller.getController().getDataDirectory()
./src/cli/wizard.py:  dataDir = cli.controller.getController().getDataDirectory()
./src/cli/controller.py:  def getDataDirectory(self):
./src/cli/controller.py:    return self._controller.getDataDirectory() + "torrc"

Bug reported by MoPac.

Child Tickets

Change History (1)

comment:1 Changed 3 years ago by atagar

Resolution: wontfix
Severity: Normal
Status: newclosed

Cleaning up old tickets. Nyx is undergoing a rewrite, if this is still relevant then feel free to reopen.

Note: See TracTickets for help on using tickets.