summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypbind
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2011-10-24 14:35:31 +0000
committerglebius <glebius@FreeBSD.org>2011-10-24 14:35:31 +0000
commit62b9f3917a3058cf6c5cd8d3f7d70f0bf7ee2fde (patch)
treea4660ec4b5deedff00378bd7fe9e115598cdf5b2 /usr.sbin/ypbind
parentc8591306ab99d1b74f3453de34382e90888e9a14 (diff)
downloadFreeBSD-src-62b9f3917a3058cf6c5cd8d3f7d70f0bf7ee2fde.zip
FreeBSD-src-62b9f3917a3058cf6c5cd8d3f7d70f0bf7ee2fde.tar.gz
Protect NIS client with madvise(2) since this daemon is required
for succesful authentication of users.
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r--usr.sbin/ypbind/ypbind.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 0083cf8..700365f 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/file.h>
@@ -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);
OpenPOWER on IntegriCloud