summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs/union_subr.c
diff options
context:
space:
mode:
authorgleb <gleb@FreeBSD.org>2012-05-16 10:44:09 +0000
committergleb <gleb@FreeBSD.org>2012-05-16 10:44:09 +0000
commit3288f283ffb15bb0d83572220243e790cffe0209 (patch)
tree337ab8d770eb1aa09bec1bd91f8f24f48826aa0e /sys/fs/unionfs/union_subr.c
parent5eb63ec7dd1e2a7728305682d0c7339f0754298c (diff)
downloadFreeBSD-src-3288f283ffb15bb0d83572220243e790cffe0209.zip
FreeBSD-src-3288f283ffb15bb0d83572220243e790cffe0209.tar.gz
Skip directory entries with zero inode number during traversal.
Entries with zero inode number are considered placeholders by libc and UFS. Fix remaining uses of VOP_READDIR in kernel: vop_stdvptocnp, unionfs. Sponsored by: Google Summer of Code 2011
Diffstat (limited to 'sys/fs/unionfs/union_subr.c')
-rw-r--r--sys/fs/unionfs/union_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index dbdaa8e..528271c 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -1184,7 +1184,7 @@ unionfs_check_rmdir(struct vnode *vp, struct ucred *cred, struct thread *td)
edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid];
for (dp = (struct dirent*)buf; !error && dp < edp;
dp = (struct dirent*)((caddr_t)dp + dp->d_reclen)) {
- if (dp->d_type == DT_WHT ||
+ if (dp->d_type == DT_WHT || dp->d_fileno == 0 ||
(dp->d_namlen == 1 && dp->d_name[0] == '.') ||
(dp->d_namlen == 2 && !bcmp(dp->d_name, "..", 2)))
continue;
OpenPOWER on IntegriCloud