aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_lookup.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-08-01 01:21:40 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-08-01 01:21:40 +0000
commitd03db4290da81fab3420206c870be4b897eb20ca (patch)
tree0593c65f5efd3a5f98e6b736ee3ab9e68faf6dae /sys/kern/vfs_lookup.c
parent6ea48a903ca4ba15fe6c680c1c76af927128ea6a (diff)
downloadsrc-d03db4290da81fab3420206c870be4b897eb20ca.tar.gz
src-d03db4290da81fab3420206c870be4b897eb20ca.zip
Notes
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r--sys/kern/vfs_lookup.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 9c24f5247cfe..e8cabd503ca3 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -40,11 +40,13 @@
*/
#include "opt_ktrace.h"
+#include "opt_mac.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/lock.h>
+#include <sys/mac.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/vnode.h>
@@ -213,6 +215,11 @@ namei(ndp)
error = ELOOP;
break;
}
+#ifdef MAC
+ error = mac_check_vnode_readlink(td->td_ucred, ndp->ni_vp);
+ if (error)
+ break;
+#endif
if (ndp->ni_pathlen > 1)
cp = uma_zalloc(namei_zone, M_WAITOK);
else
@@ -463,6 +470,11 @@ dirloop:
* We now have a segment name to search for, and a directory to search.
*/
unionlookup:
+#ifdef MAC
+ error = mac_check_vnode_lookup(td->td_ucred, dp, cnp);
+ if (error)
+ goto bad;
+#endif
ndp->ni_dvp = dp;
ndp->ni_vp = NULL;
cnp->cn_flags &= ~PDIRUNLOCK;