Allow devfs path rules to work on directories. Without this fix,

devfs rule add path fd unhide
is a no-op, while it should unhide the fd subdirectory.

Approved by: phk, rwatson (mentor)
PR: kern/60897
This commit is contained in:
cperciva 2004-01-21 16:43:29 +00:00
parent 4f19a2bf30
commit f2970382f1

View File

@ -633,7 +633,8 @@ devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de)
dev = devfs_rule_getdev(de);
if (dev != NULL)
pname = dev->si_name;
else if (de->de_dirent->d_type == DT_LNK)
else if (de->de_dirent->d_type == DT_LNK ||
de->de_dirent->d_type == DT_DIR)
pname = de->de_dirent->d_name;
else
return (0);