Use more specific privilege PRIV_VFS_GENERATION
authorMichael Neumann <mneumann@ntecs.de>
Tue, 16 Dec 2008 21:46:10 +0000 (21:46 +0000)
committerMichael Neumann <mneumann@ntecs.de>
Tue, 16 Dec 2008 21:46:10 +0000 (21:46 +0000)
sys/kern/vfs_vnops.c

index db2c1ec..cf0ca8e 100644 (file)
@@ -945,7 +945,9 @@ vn_stat(struct vnode *vp, struct stat *sb, struct ucred *cred)
        }
        
        sb->st_flags = vap->va_flags;
-       if (priv_check_cred(cred, PRIV_ROOT, 0))
+
+       error = priv_check_cred(cred, PRIV_VFS_GENERATION, 0);
+       if (error)
                sb->st_gen = 0;
        else
                sb->st_gen = (u_int32_t)vap->va_gen;