Date: Wed, 21 Mar 2012 07:05:30 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r233259 - in stable/9/usr.sbin: ypbind ypserv Message-ID: <201203210705.q2L75UbS058802@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203210705.q2L75UbS058802>