Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ufs/ufs_lookup.c
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, | ||||
if (vpp != NULL) | if (vpp != NULL) | ||||
*vpp = NULL; | *vpp = NULL; | ||||
dp = VTOI(vdp); | dp = VTOI(vdp); | ||||
if (dp->i_effnlink == 0) | if (dp->i_effnlink == 0) | ||||
return (ENOENT); | return (ENOENT); | ||||
if (cnp->cn_namelen > UFS_MAXNAMLEN) | |||||
cem: Might want similar checks on other existing filesystems.
NFS already seems to check against… | |||||
return (ENAMETOOLONG); | |||||
/* | /* | ||||
* Create a vm object if vmiodirenable is enabled. | * Create a vm object if vmiodirenable is enabled. | ||||
* Alternatively we could call vnode_create_vobject | * Alternatively we could call vnode_create_vobject | ||||
* in VFS_VGET but we could end up creating objects | * in VFS_VGET but we could end up creating objects | ||||
* that are never used. | * that are never used. | ||||
*/ | */ | ||||
vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread); | vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread); | ||||
▲ Show 20 Lines • Show All 1,252 Lines • Show Last 20 Lines |
Might want similar checks on other existing filesystems.
NFS already seems to check against its own MAXNAMLEN constant. tmpfs I think we can reasonably allow to just support long names. UDF is readonly. msdosfs probably needs a check added. FUSE? Not sure whether we should restrict userspace filesystems or not. ext2fs probably also should verify against EXT2FS_MAXNAMLEN (if it does now, it isn't explicit enough for me to see).