]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Recover eaten patches
authorHarlan Stenn <stenn@ntp.org>
Mon, 23 Jan 2006 05:09:50 +0000 (00:09 -0500)
committerHarlan Stenn <stenn@ntp.org>
Mon, 23 Jan 2006 05:09:50 +0000 (00:09 -0500)
bk: 43d4651etbvafULekpT4ESRLaUai6w

ntpd/ntpd.c

index 992e4c6946523b8acfac9443e2f8fb8c5dc4fb8c..5468140871d43576c344092b97ab292ba94e719c 100644 (file)
@@ -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 */
        /*