On Thu, Jan 05, 2017 at 12:27:52PM +0200, Panu Matilainen wrote:
> It looks commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 intends to skip
> symlinks since it filters on S_ISREG(), but since uses fstat()
> on already open()'ed file it ends up stat()'ing the symlink target.
> Flip stat() + open() around and use lstat() instead to fix it.

Oops. You are right.
I think I was trying to guard for TOCTOU (time of check time of use)
issues (where the file might change between the stat check and the open
call.

I think just changing fstat into an lstat without flipping the
open/stat around would also do the right thing (given that the lstat
will be on the diskPath not the fd). But that would be the TOCTOU in
reverse of course. And I assume that if the build dir is still
changing at this point we have other issues creating the file list.

Cheers,

Mark
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to