Re: [PATCHv2 1/2] virFindFileInPath: only find executable non-directory

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

 



On Wed, Jan 12, 2011 at 01:16:51PM -0700, Eric Blake wrote:
> Without this patch, at least tests/daemon-conf (which sticks
> $builddir/src in the PATH) tries to execute the directory
> $builddir/src/qemu rather than a real qemu binary.
> 
> * src/util/util.h (virFileExists): Adjust prototype.
> (virFileIsExecutable): New prototype.
> * src/util/util.c (virFindFileInPath): Reject non-executables and
> directories.  Avoid huge stack allocation.
> (virFileExists): Use lighter-weight syscall.
> (virFileIsExecutable): New function.
> * src/libvirt_private.syms (util.h): Export new function.
> ---
> 
> New in v2: Require S_ISREG, not !S_ISDIR; avoid access(X_OK) and
> instead document that ACLs are disregarded
> 
>  src/libvirt_private.syms |    1 +
>  src/util/util.c          |   53 ++++++++++++++++++++++++++++++---------------
>  src/util/util.h          |    7 +++--
>  3 files changed, 40 insertions(+), 21 deletions(-)

ACK

Daniel

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]