summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_getcwd.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-11-17 18:57:20 +0000
committerrwatson <rwatson@FreeBSD.org>2003-11-17 18:57:20 +0000
commit9ade8a4b037bfeef40687525cd8e9efdbe35784b (patch)
treec0cdc46a9f69b75b52f98b71c543e7048f112c3f /sys/compat/linux/linux_getcwd.c
parent3172dd04e4121272d5c2b16c9678d2b57052090c (diff)
downloadFreeBSD-src-9ade8a4b037bfeef40687525cd8e9efdbe35784b.zip
FreeBSD-src-9ade8a4b037bfeef40687525cd8e9efdbe35784b.tar.gz
Add a MAC check for VOP_LOOKUP() in the Linux getwcd() implementation.
Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/compat/linux/linux_getcwd.c')
-rw-r--r--sys/compat/linux/linux_getcwd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_getcwd.c b/sys/compat/linux/linux_getcwd.c
index de5fb00..e3d9236 100644
--- a/sys/compat/linux/linux_getcwd.c
+++ b/sys/compat/linux/linux_getcwd.c
@@ -162,7 +162,11 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bufp, td)
* At this point, lvp is locked and will be unlocked by the lookup.
* On successful return, *uvpp will be locked
*/
- error = VOP_LOOKUP(lvp, uvpp, &cn);
+#ifdef MAC
+ error = mac_check_vnode_lookup(td->td_ucred, lvp, &cn);
+ if (error == 0)
+#endif
+ error = VOP_LOOKUP(lvp, uvpp, &cn);
if (error) {
vput(lvp);
*lvpp = NULL;
OpenPOWER on IntegriCloud