From: Harlan Stenn Date: Mon, 23 Jan 2006 05:09:50 +0000 (-0500) Subject: Recover eaten patches X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb6d883f47334ef746c133a12a5721cb1c3aab55;p=thirdparty%2Fntp.git Recover eaten patches bk: 43d4651etbvafULekpT4ESRLaUai6w --- diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 992e4c6946..5468140871 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -449,6 +449,15 @@ ntpdmain( } #endif +#ifdef OPENSSL + if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L) { + msyslog(LOG_ERR, + "ntpd: OpenSSL version mismatch. Built against %lx, you have %lx\n", + OPENSSL_VERSION_NUMBER, SSLeay()); + exit(1); + } +#endif + #ifdef SYS_WINNT /* * Initialize the time structures and variables @@ -611,6 +620,18 @@ ntpdmain( "Cannot adjust stack limit for mlockall: %m"); } } +# ifdef RLIMIT_MEMLOCK + /* + * The default RLIMIT_MEMLOCK is very low on Linux systems. + * Unless we increase this limit malloc calls are likely to + * fail if we drop root privlege. To be useful the value + * has to be larger than the largest ntpd resident set size. + */ + rl.rlim_cur = rl.rlim_max = 32*1024*1024; + if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) { + msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m"); + } +# endif /* RLIMIT_MEMLOCK */ } # endif /* HAVE_SETRLIMIT */ /*