Re: [PATCH] virDirRead: Fix d_type if needed

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

 



On Tue, Apr 02, 2019 at 02:17:35PM +0200, Michal Privoznik wrote:
> Some of our code iterates over a directory and does some
> decisions based on entry type (e.g. if it's not a regular file
> continue with next iteration). This is done by looking at
> ent->d_type struct member. However, in some cases (e.g. for some
> filesystems) the d_type can be set to DT_UNKNOWN which
> effectively defeats the aforementioned checks. For instance, some
> XFS' (depending on how they were created) might not bother
> filling the member.
> 
> Fix this by running stat() and filling in the member ourselves.
> If needed.

We really don't want to do this. It adds an extra syscall for every
single file in the directory. I've got an alternative patch that
simply puts a stat call into the firmware code & also adds a syntax
check rule to blacklist use of d_type.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

  Powered by Linux