[Whonix-devel] python-stem might mess up permissions in /var/lib/tor folder?

Patrick Schleizer adrelanos at riseup.net
Fri Jun 10 23:05:22 CEST 2016


Hello Damian,

I would very much appreciate your help. I may have a misunderstanding of
how python-stem works or perhaps found a bug. It is race condition
happening in Qubes-Whonix related to backups. I might be able to
reproduce it in plain Debian, but perhaps you already know what is going
on here.

Steps to reproduce:

sudo su

service tor at default stop

rm /var/lib/tor/*

run a small python-stem based script [1] as user "user":

/usr/lib/anon-shared-helper-scripts/tor_bootstrap_check.py 127.0.0.1 9050 1

Unexpected behavior:

sudo ls -la /var/lib/tor

total 10988
drwx--S---  3 sdwdate kvm     4096 Jun 10 20:28 .
drwxr-xr-x 50 root    root    4096 Jun 10 20:50 ..
-rw-------  1 sdwdate kvm    20442 Jun  5 05:14 cached-certs
-rw-------  1 sdwdate kvm  1405911 Jun 10 20:25 cached-microdesc-consensus
-rw-------  1 sdwdate kvm  7440585 Jun  6 19:11 cached-microdescs
-rw-------  1 sdwdate kvm  2359137 Jun 10 20:25 cached-microdescs.new
-rw-------  1 sdwdate kvm        0 Jun 10 18:58 lock
-rw-------  1 sdwdate kvm     3535 Jun 10 20:28 state
drwxrwsr-x  2 sdwdate kvm     4096 Jun 10 18:31 .tor

Why of everything it picks sdwdate:kvm as owner:group is a mystery to
me. Folder /var/lib/tor/.tor is entirely undesired. Worse are the messed
up folder permissions.

python-stem should not result in changes in the file system? It should
just connect to Tor using ControlPort / ControlSocket? How can these
permission issues be avoided?

By answering to this mail, your reply will be shown on the whonix-devel
public mailing list for others to profit from it.

Cheers,
Patrick

[1]
https://github.com/Whonix/anon-shared-helper-scripts/blob/master/usr/lib/anon-shared-helper-scripts/tor_bootstrap_check.py


More information about the Whonix-devel mailing list