When MAC is enabled, warn if getnewvnode() is asked to produce a vnode

without a mountpoint.  In this scenario, there's no useful source for
a label on the vnode, since we can't query the mountpoint for the
labeling strategy or default label.
This commit is contained in:
Robert Watson 2004-10-22 11:04:58 +00:00
parent ff7c5a4880
commit b0e86f6ac2

View File

@ -858,6 +858,8 @@ getnewvnode(tag, mp, vops, vpp)
mac_init_vnode(vp);
if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0)
mac_associate_vnode_singlelabel(mp, vp);
else if (mp == NULL)
printf("NULL mp in getnewvnode()\n");
#endif
delmntque(vp);
if (mp != NULL) {