From 5838507bd70dc6a92660795da0acf919ecc4c8ae Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Mon, 24 Oct 2011 14:35:31 +0000 Subject: [PATCH] Protect NIS client with madvise(2) since this daemon is required for succesful authentication of users. --- usr.sbin/ypbind/ypbind.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 0083cf8667c1..700365f55755 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -465,6 +466,9 @@ main(int argc, char *argv[]) openlog(argv[0], LOG_PID, LOG_DAEMON); + if (madvise(NULL, 0, MADV_PROTECT) != 0) + syslog(LOG_WARNING, "madvise(): %m"); + /* Kick off the default domain */ broadcast(ypbindlist);