dnsmasqCapsRefreshInternal(dnsmasqCaps *caps)
{
g_autoptr(virCommand) vercmd = NULL;
- g_autoptr(virCommand) helpcmd = NULL;
- g_autofree char *help = NULL;
g_autofree char *version = NULL;
- g_autofree char *complete = NULL;
/* Make sure the binary we are about to try exec'ing exists.
* Technically we could catch the exec() failure, but that's
if (virCommandRun(vercmd, NULL) < 0)
return -1;
- helpcmd = virCommandNewArgList(caps->binaryPath, "--help", NULL);
- virCommandSetOutputBuffer(helpcmd, &help);
- virCommandAddEnvPassCommon(helpcmd);
- virCommandClearCaps(helpcmd);
- if (virCommandRun(helpcmd, NULL) < 0)
- return -1;
-
- complete = g_strdup_printf("%s\n%s", version, help);
-
- return dnsmasqCapsSetFromBuffer(caps, complete);
+ return dnsmasqCapsSetFromBuffer(caps, version);
}
static dnsmasqCaps *
int ret = 0;
g_autoptr(dnsmasqCaps) full = NULL;
- full = dnsmasqCapsNewFromBuffer("Dnsmasq version 2.67\n--bind-dynamic\n--ra-param");
+ full = dnsmasqCapsNewFromBuffer("Dnsmasq version 2.67");
#define DO_TEST(xname, xcaps) \
do { \