[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #13807 [Stem]: Use fstat connection resolution (was: Arm fails to list connections on OpenBSD due to lsof permissions error)



#13807: Use fstat connection resolution
-------------------------+-------------------------------------------------
     Reporter:  mmcc     |      Owner:  atagar
         Type:  defect   |     Status:  new
     Priority:  normal   |  Milestone:
    Component:  Stem     |    Version:
   Resolution:           |   Keywords:  OpenBSD, lsof, fstat, files,
Actual Points:           |  permissions
       Points:           |  Parent ID:
-------------------------+-------------------------------------------------
Changes (by atagar):

 * component:  arm => Stem


Comment:

 Hi mmcc. I'm gonna swap this to Stem. You're right that arm is being
 rewritten, and one of the bits that's already moved to Stem is connection
 resolution...

 https://stem.torproject.org/tutorials/east_of_the_sun.html#connection-
 resolution
 https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/connection.py

 If Stem supports fstat connection resolution then the next release of arm
 will take advantage of it too. That said, I don't have an OpenBSD system
 nor am I familiar with fstat. In the past I've made VMs or got ssh access
 to FreeBSD and Gentoo systems to track down this sort of issue. It was
 painful though to say the least, and left me swearing 'never again'.

 Since then I've taken a 'patches welcome' approach. Fantastic folks
 stepped forward to add FreeBSD sockstat/procstat support and I'd be
 delighted to get patches for OpenBSD fstat support too.

 If you'd care to take this on then it shouldn't be too hard. I expect it
 would involve...

 1. Adding a new
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/connection.py#l55
 BSD_FSTAT Resolver enumeration] and RESOLVER_COMMAND.
 1. Use this as the
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/connection.py#l235
 type of resolver used on OpenBSD] (just need to
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/system.py#l144
 check platform.system()]).
 1. Teach Stem to
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/connection.py#l132
 parse the fstat output].
 1. Add a
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/test/unit/util/connection.py
 unit test for the resolver]. Naturally feel free to tweak anything you
 think is private, but please try to keep it looking as close to real
 output as you can.

 On a side note I'm a little curious if
 [https://stem.torproject.org/faq.html#how-do-i-run-the-tests Stem's integ
 tests] pass on your platform. I'm a little suspicious that we could
 improve OpenBSD support in
 [https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/util/system.py
 stem.util.system] which gets things like system resource usage. Not sure.
 OpenBSD is one of the least tested platforms for both Stem and arm. I'd
 **love** to have someone maintain Stem for OpenBSD.

 Cheers! -Damian

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13807#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs