CaliDog / Axeman

Axeman is a utility to retrieve certificates from Certificate Transparency Lists (CTLs)
MIT License
217 stars 71 forks source link

Re-enabled the output directory functionality #8

Closed okoeroo closed 4 years ago

okoeroo commented 5 years ago

The -o flag did not work. By default all output is written to /tmp, which is now fixed by forwarding the command line arguments to the retrieve_certificates function.

thpts commented 5 years ago

These changes alone do not appear to resolve the matter of the output directory as the folders are created but no certificates are written out and instead an execption is raised, for example:

========= EXCEPTION =========                                                                                   
Traceback (most recent call last):                                                                              
  File "axeman/core.py", line 229, in process_worker
    with open(csv_file, 'w') as f:                                                                              
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/certificates/ct.googleapis.com_logs_argon2019/1024-1281.csv'
[Errno 2] No such file or directory: '/tmp/certificates/ct.googleapis.com_logs_argon2019/1024-1281.csv'
=============================

This appears to be happening because axeman.core.process_worker is not invoked with the output_dir argument provided and instead falls back to the default defined of the kwarg of /tmp as AioPool.coro_map does not appear to support having additional args or kwargs passed through.

I have fixed this in my own fork which, in addition to including your fixes replaces the call of AioPool.coro_map with AioPool.coro_apply. As I intend my fork's changes to extend beyond this change, you're welcome to use this approach to update your pull request.

Fitblip commented 4 years ago

Howdy, I think this is fixed in #10. Feel free to open if not!