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

[tor-bugs] #4127 [Torflow]: get_search_urls_for_filetype(self, filetype, number) does not return a tuple



#4127: get_search_urls_for_filetype(self, filetype, number) does not return a
tuple
---------------------+------------------------------------------------------
 Reporter:  aagbsn   |          Owner:  mikeperry
     Type:  defect   |         Status:  new      
 Priority:  normal   |      Milestone:           
Component:  Torflow  |        Version:           
 Keywords:           |         Parent:           
   Points:           |   Actualpoints:           
---------------------+------------------------------------------------------
 get_search_urls_for_filetype(self, filetype, number) does not return a
 tuple and is used inconsistently
 {{{
 #!python
   def refill_targets(self):
     for ftype in self.scan_filetypes:
       targets_needed = self.results_per_type -
 len(self.targets.bykey(ftype))
       if targets_needed > 0:
         plog("NOTICE", self.proto+" scanner short on "+ftype+" targets.
 Adding more")
         map(self.add_target,
 self.get_search_urls_for_filetype(ftype,targets_needed))
 }}}

 for comparison, see SearchBasedHTTPTest.get_targets():

 {{{
 #!python
   def get_targets(self):
     '''
     construct a list of urls based on the wordlist, filetypes and
 protocol.
     '''
     plog('INFO', 'Searching for relevant sites...')

     urllist = set([])
     for filetype in self.scan_filetypes:
       urllist.update(map(lambda x: (x, filetype),
 self.get_search_urls_for_filetype(filetype,

     return list(urllist)
 }}}

 Testing the following modification:

 {{{
 #!python
 index be0dde0..aabb3e4 100755
 --- a/NetworkScanners/ExitAuthority/soat.py
 +++ b/NetworkScanners/ExitAuthority/soat.py
 @@ -1883,9 +1883,12 @@ class SearchBasedHTTPTest(SearchBasedTest,
 BaseHTTPTest):
    def refill_targets(self):
      for ftype in self.scan_filetypes:
        targets_needed = self.results_per_type -
 len(self.targets.bykey(ftype))
 +      urllist = set([])
        if targets_needed > 0:
          plog("NOTICE", self.proto+" scanner short on "+ftype+" targets.
 Adding more")
 -        map(self.add_target,
 self.get_search_urls_for_filetype(ftype,targets_needed))
 +        #map(self.add_target,
 self.get_search_urls_for_filetype(ftype,targets_needed))
 +        urllist.update(map(lambda x: (x, ftype),
 self.get_search_urls_for_filetype(ftype, tar
 +        map(self.add_target, urllist)
 }}}

 This issue was raised in #4097 but should have its own ticket.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4127>
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