[PATCH v5 2/2] io: Use gnulib fts implementation (BZ 22944, BZ 20331)
Florian Weimer
fweimer@redhat.com
Fri Apr 10 19:06:05 GMT 2026
* Collin Funk:
> Collin Funk <collin.funk1@gmail.com> writes:
>
>> It would be helpful to see if ftsent->fts_info before and after the
>> change. I suspect it may have been returning FTS_D before and is now
>> returning FTS_NS now. This would explain why it did not pick up
>> hv_storvsc from under the scsi subdirectory.
>
> Oops, I meant FTS_NSOK instead of FTS_NSOK. I think it would be safer
> for dracut to do something like this since it is using FTS_NOSTAT:
>
> /* Get the file type if it could not be determined without stat. */
> int info = fts_info;
> if (info == FTS_NSOK)
> {
> fts_set (fts, ent, FTS_AGAIN);
> fts_read (fts);
> info = ent->fts_info;
> }
>
> I don't think it was ever safe to assume that fts_info would be set to
> FTS_D (or another file type) when FTS_NOSTAT was used.
Thanks for looking into this. I wonder how common this misuse is. Is
this another example?
<https://sources.debian.org/src/rpki-client/9.7-1/src/repo.c>
Florian
More information about the Libc-alpha
mailing list