diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 7274ea788007..5892ef73d7cd 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -54,6 +54,8 @@ * IBCS2 system calls that are implemented differently in BSD are * handled here. */ +#include "opt_mac.h" + #include #include #include @@ -61,6 +63,7 @@ #include #include #include +#include #include #include /* Must come after sys/malloc.h */ #include @@ -348,6 +351,12 @@ ibcs2_getdents(td, uap) cookies = NULL; } +#ifdef MAC + error = mac_check_vnode_readdir(td->td_ucred, vp); + if (error) + goto out; +#endif + /* * First we read into the malloc'ed buffer, then * we massage it into user space, one record at a time. @@ -503,6 +512,12 @@ ibcs2_read(td, uap) cookies = NULL; } +#ifdef MAC + error = mac_check_vnode_readdir(td->td_ucred, vp); + if (error) + goto out; +#endif + /* * First we read into the malloc'ed buffer, then * we massage it into user space, one record at a time.