Date: Thu, 8 Apr 2010 12:07:40 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r206397 - head/crypto/openssh Message-ID: <201004081207.o38C7eiK014299@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu Apr 8 12:07:40 2010 New Revision: 206397 URL: http://svn.freebsd.org/changeset/base/206397 Log: Enhance r199804 by marking the daemonised child as immune to OOM instead of short-living parent. Only mark the master process that accepts connections, do not protect connection handlers spawned from inetd. Submitted by: Mykola Dzham <i levsha me> Reviewed by: attilio MFC after: 1 week Modified: head/crypto/openssh/sshd.c Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Thu Apr 8 09:01:20 2010 (r206396) +++ head/crypto/openssh/sshd.c Thu Apr 8 12:07:40 2010 (r206397) @@ -1330,10 +1330,6 @@ main(int ac, char **av) /* Initialize configuration options to their default values. */ initialize_server_options(&options); - /* Avoid killing the process in high-pressure swapping environments. */ - if (madvise(NULL, 0, MADV_PROTECT) != 0) - debug("madvise(): %.200s", strerror(errno)); - /* Parse command-line arguments. */ while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:C:dDeiqrtQRT46")) != -1) { switch (opt) { @@ -1749,6 +1745,10 @@ main(int ac, char **av) /* Reinitialize the log (because of the fork above). */ log_init(__progname, options.log_level, options.log_facility, log_stderr); + /* Avoid killing the process in high-pressure swapping environments. */ + if (!inetd_flag && madvise(NULL, 0, MADV_PROTECT) != 0) + debug("madvise(): %.200s", strerror(errno)); + /* Initialize the random number generator. */ arc4random_stir();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004081207.o38C7eiK014299>