Tor segfaults on saveconf if it can't read its torrc file
Hi, in a very weird edge case a controller issuing a saveconf request can terminate Tor. I just reproed this with... Tor v0.2.3.1-alpha-dev (git-e6980faec43504ac)
Repro steps:
- Start tor with an open control port
- Chown the torrc to root so the tor user lacks read/write permissions
- Issue a SAVECONF request
- Tor crashes with... May 10 18:25:39.000 [warn] Could not open "/home/atagar/.tor/torrc": Permission denied Segmentation fault
The permissions on the torrc during the crash... -rw------- 1 root atagar 274 2011-05-10 10:01 .tor/torrc
Here's the quick method for issuing the saveconf request via torctl:
>>> from TorCtl import TorCtl
>>> conn = TorCtl.connect()
>>> conn.sendAndRecv("SAVECONF\r\n")
Cheers! -Damian