Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2011 14:35:32 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226690 - head/usr.sbin/ypbind
Message-ID:  <201110241435.p9OEZWkb048039@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Mon Oct 24 14:35:31 2011
New Revision: 226690
URL: http://svn.freebsd.org/changeset/base/226690

Log:
  Protect NIS client with madvise(2) since this daemon is required
  for succesful authentication of users.

Modified:
  head/usr.sbin/ypbind/ypbind.c

Modified: head/usr.sbin/ypbind/ypbind.c
==============================================================================
--- head/usr.sbin/ypbind/ypbind.c	Mon Oct 24 14:23:40 2011	(r226689)
+++ head/usr.sbin/ypbind/ypbind.c	Mon Oct 24 14:35:31 2011	(r226690)
@@ -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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110241435.p9OEZWkb048039>