mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
Remove redundant virFileIsExecutable check
Remove unnecessary virFileIsExecutable check after virFindFileInPath.
Since the commit 9ae992f
virFindFileInPath will reject non-executables.
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
65a372d6e0
commit
327ae930a4
@ -179,8 +179,6 @@ virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps)
|
|||||||
binary = virFindFileInPath("grub-bhyve");
|
binary = virFindFileInPath("grub-bhyve");
|
||||||
if (binary == NULL)
|
if (binary == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
if (!virFileIsExecutable(binary))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
cmd = virCommandNew(binary);
|
cmd = virCommandNew(binary);
|
||||||
virCommandAddArg(cmd, "--help");
|
virCommandAddArg(cmd, "--help");
|
||||||
@ -315,8 +313,6 @@ virBhyveProbeCaps(unsigned int *caps)
|
|||||||
binary = virFindFileInPath("bhyve");
|
binary = virFindFileInPath("bhyve");
|
||||||
if (binary == NULL)
|
if (binary == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
if (!virFileIsExecutable(binary))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if ((ret = bhyveProbeCapsRTC_UTC(caps, binary)))
|
if ((ret = bhyveProbeCapsRTC_UTC(caps, binary)))
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -649,16 +649,10 @@ virQEMUCapsFindBinary(const char *format,
|
|||||||
char *binary = NULL;
|
char *binary = NULL;
|
||||||
|
|
||||||
if (virAsprintf(&binary, format, archstr) < 0)
|
if (virAsprintf(&binary, format, archstr) < 0)
|
||||||
goto out;
|
return NULL;
|
||||||
|
|
||||||
ret = virFindFileInPath(binary);
|
ret = virFindFileInPath(binary);
|
||||||
VIR_FREE(binary);
|
VIR_FREE(binary);
|
||||||
if (ret && virFileIsExecutable(ret))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
VIR_FREE(ret);
|
|
||||||
|
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user