svn commit: r233259 - in stable/9/usr.sbin: ypbind ypserv

Gleb Smirnoff glebius at FreeBSD.org
Wed Mar 21 07:05:30 UTC 2012


Author: glebius
Date: Wed Mar 21 07:05:29 2012
New Revision: 233259
URL: http://svn.freebsd.org/changeset/base/233259

Log:
  Merge 226690 and 226725 from head:
    Protect NIS client with madvise(2) since this daemon is required
    for succesful authentication of users.
  
    Protect NIS server with madvise(2) since this daemon is required
    for succesful authentication of users.

Modified:
  stable/9/usr.sbin/ypbind/ypbind.c
  stable/9/usr.sbin/ypserv/yp_main.c
Directory Properties:
  stable/9/usr.sbin/ypbind/   (props changed)
  stable/9/usr.sbin/ypserv/   (props changed)

Modified: stable/9/usr.sbin/ypbind/ypbind.c
==============================================================================
--- stable/9/usr.sbin/ypbind/ypbind.c	Wed Mar 21 07:02:17 2012	(r233258)
+++ stable/9/usr.sbin/ypbind/ypbind.c	Wed Mar 21 07:05:29 2012	(r233259)
@@ -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);
 

Modified: stable/9/usr.sbin/ypserv/yp_main.c
==============================================================================
--- stable/9/usr.sbin/ypserv/yp_main.c	Wed Mar 21 07:02:17 2012	(r233258)
+++ stable/9/usr.sbin/ypserv/yp_main.c	Wed Mar 21 07:05:29 2012	(r233259)
@@ -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>
@@ -526,6 +527,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.
 	 */


More information about the svn-src-stable-9 mailing list