All of the callers either skip these explicitly, skip all entries starting with a dot or match the entry name against stricter patterns. --- src/util/virfile.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 1820e80..2772089 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2809,14 +2809,17 @@ virDirOpenQuiet(DIR **dirp, const char *name) */ int virDirRead(DIR *dirp, struct dirent **ent, const char *name) { - errno = 0; - *ent = readdir(dirp); /* exempt from syntax-check */ - if (!*ent && errno) { - if (name) - virReportSystemError(errno, _("Unable to read directory '%s'"), - name); - return -1; - } + do { + errno = 0; + *ent = readdir(dirp); /* exempt from syntax-check */ + if (!*ent && errno) { + if (name) + virReportSystemError(errno, _("Unable to read directory '%s'"), + name); + return -1; + } + } while (*ent && (STREQ((*ent)->d_name, ".") || + STREQ((*ent)->d_name, ".."))); return !!*ent; } -- 2.7.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list