diff options
author | glebius <glebius@FreeBSD.org> | 2011-10-25 10:33:26 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2011-10-25 10:33:26 +0000 |
commit | a159358a0a00aef4c056ed3e6a3c410d70dbabd4 (patch) | |
tree | b671bb61c550eb2ae6b95c164fa2610cd65b0e2b /usr.sbin/ypserv/yp_main.c | |
parent | 494b43166414a072c5316416429f29708ec81927 (diff) | |
download | FreeBSD-src-a159358a0a00aef4c056ed3e6a3c410d70dbabd4.zip FreeBSD-src-a159358a0a00aef4c056ed3e6a3c410d70dbabd4.tar.gz |
Protect NIS server with madvise(2) since this daemon is required
for succesful authentication of users.
Diffstat (limited to 'usr.sbin/ypserv/yp_main.c')
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 057174b..7473e6f 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); */ #include <sys/types.h> +#include <sys/mman.h> #include <sys/queue.h> #include <sys/socket.h> #include <sys/wait.h> @@ -525,6 +526,9 @@ main(int argc, char *argv[]) unregister(); } + if (madvise(NULL, 0, MADV_PROTECT) != 0) + _msgout("madvise(): %s", strerror(errno)); + /* * Create RPC service for each transport. */ |