]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virfirewall: use virFindFileInPath instead of virFileIsExecutable
authorPavel Hrdina <phrdina@redhat.com>
Thu, 15 Apr 2021 18:46:53 +0000 (20:46 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 21 Apr 2021 12:18:39 +0000 (14:18 +0200)
Following patches will make this change necessary as we will stop
detecting the full path during compile time.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virfirewall.c

index 78aa7e580e1d4bd4d0a3d47de508ebea74ef45d2..e79fe52ac86fd529b57c158f75f6bfd7664db3f7 100644 (file)
@@ -104,7 +104,9 @@ virFirewallValidateBackend(virFirewallBackend backend)
     size_t i;
 
     for (i = 0; i < G_N_ELEMENTS(commands); i++) {
-        if (!virFileIsExecutable(commands[i])) {
+        g_autofree char *path = virFindFileInPath(commands[i]);
+
+        if (!path) {
             virReportSystemError(errno,
                                  _("%s not available, firewall backend will not function"),
                                  commands[i]);