]> git.notmuchmail.org Git - notmuch/commit
notmuch new: Fix regression preventing recursion through symlinks.
authorCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 18:09:17 +0000 (10:09 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 18:32:06 +0000 (10:32 -0800)
commit49f09958df22f80e4058b6f2892f6224a80c3d6d
tree6565edc80b01ad3486f5ec59e293485efc9d1264
parentbd72d95bac894b3611bb4467e10c9481af0456bf
notmuch new: Fix regression preventing recursion through symlinks.

In commit 3df737bc4addfce71c647792ee668725e5221a98 we switched from
using stat() to using the d_type field in the result of scandir() to
determine whether a filename is a regular file or a directory. This
change introduced a regression in that the recursion would no longer
traverse through a symlink to a directory. (Since stat() would resolve
the symlink but with scandir() we see a distinct DT_LNK value in
d_type).

We fix this for directories by allowing both DT_DIR and DT_LNK values
to recurse, and then downgrading the existing not-a-directory check
within the recursion to not be an error. We also add a new
not-a-directory check outside the recursion that is an error.
notmuch-new.c