Closed ScrumpyJack closed 3 years ago
The problem is with running asn -l in the foreground. It picks up the $TERM, and thus IS_HEADLESS=false Perhaps -l should set IS_HEADLESS=true, instead of looking for TERM=dumb?
Thanks for the analysis, this was broken in commit 7a920ad, when I changed the subshell detecting logic. What is happening is the subshell spawned by the ncat connection handler isn't getting it's $TERM variable set to "dumb" - which it instead does when launched through systemd.
In order to fix it, can you confirm that by manually setting the terminal on line 1907 from this:
INTERNAL_CONNHANDLER_CHILD=true INTERNAL_ASNSERVER_CONNHANDLER=false "$0" "$host" |
to this:
INTERNAL_CONNHANDLER_CHILD=true INTERNAL_ASNSERVER_CONNHANDLER=false TERM=dumb "$0" "$host" |
fixes the issue?
Thanks.
Awesome thanks. that worked
When listening in server mode, I don't get any output from asn.
──────────────────────────────────────────────────────────── WARNING
No IPQualityScore token found, so disabling in-depth threat analysis and IP reputation lookups. Please visit https://github.com/nitefood/asn#ip-reputation-api-token for instructions on how to enable it. ──────────────────────────────────────────────────────────── ./asn: line 1389: $max_msg_size: substring expression < 0 [2021-04-11 18:15:48] COMPLETED Lookup request by client 172.18.0.7 for target github.com (Request ID: 817759845)
./asn: line 1389: $max_msg_size: substring expression < 0
https://github.com/nitefood/asn/blob/d280c0aeaa1edb032e3f5c1fae88cbf42282d637/asn#L1387
It looks like terminal_width is 0 at this point and thus max_msg_size = -23