bug in /usr/bin/ntpdig

folkert folkert at vanheusden.com
Sat Aug 29 10:44:05 UTC 2020


Hi,

/usr/bin/ntpdig -j -p 8
produces an invalid json string:

{"time":"2020-08-29T12:37:41.817391-0200","offset":-0.000034,"precision":0.000158,"host":"localhost",ip:"::1","stratum":1,"leap":"no-leap","adjusted":false}

As you can see here, the " before ip: is missing and also the 2nd " is
misplaced.

Patch:

--- /tmp/ntpdig.org	2020-08-29 12:40:27.846037478 +0200
+++ /usr/bin/ntpdig	2020-08-29 12:43:29.106035763 +0200
@@ -216,7 +216,7 @@
 
     if json:
         say('{"time":"%sT%s%s","offset":%f,"precision":%f,"host":"%s",'
-            'ip:"%s","stratum":%s,"leap":"%s","adjusted":%s}\n'
+            '"ip":"%s","stratum":%s,"leap":"%s","adjusted":%s}\n'
             % (date, tod, tz,
                packet.adjust(), packet.synchd(),
                packet.hostname, packet.resolved or packet.hostname,

Folkert van Heusden

-- 
MultiTail er et flexible tool for å kontrolere Logfiles og commandoer.
Med filtrer, farger, sammenføringer, forskeliger ansikter etc.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com


More information about the devel mailing list