[tor-bugs] #4896 [Stem]: Chroot set up for stem

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu Jan 12 21:04:42 UTC 2012


#4896: Chroot set up for stem
-------------------------+--------------------------------------------------
 Reporter:  gsathya      |          Owner:  atagar
     Type:  enhancement  |         Status:  new   
 Priority:  normal       |      Milestone:        
Component:  Stem         |        Version:        
 Keywords:               |         Parent:        
   Points:               |   Actualpoints:        
-------------------------+--------------------------------------------------

Comment(by atagar):

 As mentioned on irc I'm juggling a few things so I haven't been able to
 look too closely at the code, but I can discuss a few things I spotted
 here...

 > In stem/socket.py, Define a stripping_function(original_recv, prefix,
 control_file)...

 In the current master branch there's a "test/mocking.py" which I'll be
 using to make monkey patching more readable and less error prone (via a
 'revert all monkey patching' function).

 The stripping_function isn't of use to stem users so it should be in
 test/mocking.py instead.

 > original_recv is the original function...

 On first thought I'm not sure why you'd need this arg since there's only a
 single recv that we might be wanting to overwrite, though maybe this'll
 make sense when I look closer at the branch...

 > Add a constant CHROOT_ENV that is set by run_tests.py when the --chroot
 arg is used.

 I'm not sure why this needs to be a global rather than just an arg to
 start(). Also, as mentioned on irc this should probably be done via
 something like "--target ATTR_CHROOT" rather than adding a new
 run_tests.py arg.

 I have another attribute that I'm about to add, so I'd imagine that we'll
 have an ATTR_ALL later. With this the user could say "--
 target=CONN_ALL,ATTR_ALL" to run all connection types with every
 combination of run attributes. A damn lengthy integ test but it would be a
 good workout for tor. :)

 > Define a function strip(self, prefix) in ControlMessage.

 From a coding point of view that does sound much nicer. However, it's a
 bad idea to introduce testing code into the library. There was one spot
 where I broke that rule (an override function for
 "stem.util.system.call()") and I'm currently trying to remove it...

 > If I didn't really make much sense, I blame it on my insomnia trying to
 get this to work. And also it's almost midnight here.

 Ack! I didn't mean for this to disrupt your sleep. If you'd like I can
 write an alternate patch that uses 'mocking.py' and you can see if you
 like it better or not.

 I'll try to look into the code in the next few days unless something in
 the above helps you zero in on an ideal solution.

 Cheers! -Damian

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4896#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list