]> git.ipfire.org Git - thirdparty/libvirt.git/commit
dnsmasq: Fix parsing of the version number
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Dec 2012 11:25:50 +0000 (12:25 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:53:42 +0000 (16:53 -0500)
commit0617864e2ca191a644429e26403e3e2b3bbd32d9
treea2e150a8ff2f03cdbf3f5da80db0e9c0da1eb433
parent9b625cbcf036e042989b6af9cb1e470cf53e1924
dnsmasq: Fix parsing of the version number

If the debugging is enabled, the virCommand subsystem catches debug
messages in the command output as well. In that case, we can't assume
the string corresponding to command's stdout will start with specific
prefix. But the prefix can be moved deeper in the string. This bug
shows itself when parsing dnsmasq output:

2012-12-06 11:18:11.445+0000: 18491: error :
dnsmasqCapsSetFromBuffer:664 : internal error cannot parse
/usr/sbin/dnsmasq version number in '2012-12-06 11:11:02.232+0000:
18492: debug : virFileClose:72 : Closed fd 22'

We can clearly see that the output of dnsmasq --version
doesn't start with expected "Dnsmasq version " string but a libvirt
debug output.
(cherry picked from commit 5114431396fd125b6ebe4d1a20a981111f948ee7)
src/util/dnsmasq.c