Author: glebius
Date: Tue Oct 25 10:33:26 2011
New Revision: 226725
URL: http://svn.freebsd.org/changeset/base/226725

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

Modified:
  head/usr.sbin/ypserv/yp_main.c

Modified: head/usr.sbin/ypserv/yp_main.c
==============================================================================
--- head/usr.sbin/ypserv/yp_main.c      Tue Oct 25 08:35:30 2011        
(r226724)
+++ head/usr.sbin/ypserv/yp_main.c      Tue Oct 25 10:33:26 2011        
(r226725)
@@ -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.
         */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to