Closed ayerlock closed 2 years ago
Correcting for this issue would be trivial. But does the upstream project want to have this particular condition handled?
Thank you
I'd be delighted to merge a patch if it's correct. On first glance nyx's split()
call should be fine with tabs...
>>> "hello world".split()
['hello', 'world']
>>> "hello\tworld".split()
['hello', 'world']
May have been too hasty in pinning it as the wrong delimiter with string-splitting. That is not the issue.
It appears when nyx retrieves the log path using the stem library functions get_conf/get_conf_map the value gets mangled when tab-delimited in torrc
notice\\tfile\\t/var/log/tor
This is why splitting of the tokens fail.
Raw ControlPort access with the GETCONF command shows the response is normally escaped so I suspect the issue involves string handling when the response is already escaped.
Thank you
Thanks, makes sense. I'd be delighted to merge a patch that addresses it.
Did some more tracing.
When the message is received by stem the string-formatting of Python double-escapes any escaped tabs in the response so the issue probably could be fixed by un-escaping the value. The question is if to fix it when retrieving the log path or globally for all messages received using stem. Only caveat with suggesting the latter is that the concern with unforeseen breakage exists.
Thank you.
Thanks h3xagonal! Sorry for the long delay.
Performing the conversion within nyx is a bit of a hack but I merged this because...
I no longer work with tor so opting for the simple approach and merged this. ;)
Happy to have provided assistance.
I no longer work with tor so opting for the simple approach and merged this. ;)
Off-topic question but is the status of nyx unmaintained or will others be able to merge pull-requests for correction of issues or new features and issue new releases?
Good luck to other ventures.
Thank you.
is the status of nyx unmaintained or will others be able to merge pull-requests for correction of issues or new features and issue new releases?
I continue to merge pull requests for Nyx and Stem but my chief reason for leaving tor was their disinterest in my projects so nope, further releases aren't presently in the cards. Sorry to disappoint.
If nyx encounters a 'Log' entry in the torrc file that is spaced out with tabs rather than spaces it crashes. i.e.
Log<TAB>info<TAB>file<TAB>/var/log/tor/info.log
will cause nyx to crash with the following error: