[PATCH 2/3] virdnsmasq: Lookup DNSMASQ in PATH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While it's true that our virCommand subsystem is happy with
non-absolute paths, the dnsmasq capability code is not. For
instance, it does call stat() over the binary to learn its mtime
(and thus decide whether capabilities need to be fetched again or
not).

Therefore, when constructing the capabilities structure look up
the binary path. If DNSMASQ already contains an absolute path
then it is returned (and virFindFileInPath() is a NOP).

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virdnsmasq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index d304929d51..b6ccb9d0a4 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -708,7 +708,7 @@ dnsmasqCapsNewEmpty(void)
         return NULL;
     if (!(caps = virObjectNew(dnsmasqCapsClass)))
         return NULL;
-    caps->binaryPath = g_strdup(DNSMASQ);
+    caps->binaryPath = virFindFileInPath(DNSMASQ);
     return caps;
 }
 
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux