* configure.ac: check for <sys/prctl.h>
authorNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 11 May 2004 15:21:45 +0000 (15:21 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 11 May 2004 15:21:45 +0000 (15:21 +0000)
* server_main.c: call prctl(PR_SET_DUMPABLE, 1) if we are dropping root
  permissions.
* sysdep.c: no longer call setrlimit(RLIMIT_CORE, ...); this can be handled
  from a shell script.

citadel/ChangeLog
citadel/configure.ac
citadel/server_main.c
citadel/sysdep.c

index f60055a3feb2fd40ddb04b015fd5ae978f4d7795..a6165622450a5532f35fa51faa3eea443bc59336 100644 (file)
@@ -1,4 +1,11 @@
  $Log$
+ Revision 620.32  2004/05/11 15:21:45  nbryant
+ * configure.ac: check for <sys/prctl.h>
+ * server_main.c: call prctl(PR_SET_DUMPABLE, 1) if we are dropping root
+   permissions.
+ * sysdep.c: no longer call setrlimit(RLIMIT_CORE, ...); this can be handled
+   from a shell script.
+
  Revision 620.31  2004/05/10 01:47:11  error
  * messages.c: Fix crash when trying to use m<Y> next
 
@@ -5755,3 +5762,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index eaa93f0cae05e82598c01e115822b8fe530a922d..80938899103350498986d6a17ae244d54b07882a 100644 (file)
@@ -471,7 +471,7 @@ dnl
 dnl TODO: for the DB header checks, we should check whether the headers
 dnl define db_env_create, somehow
 dnl
-AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h malloc.h termios.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db4/db.h pthread.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h)
+AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h malloc.h termios.h sys/ioctl.h sys/select.h sys/time.h sys/prctl.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db4/db.h pthread.h netinet/in.h arpa/nameser.h arpa/nameser_compat.h)
 
 dnl
 dnl need to check if this is actually compilable, sometimes there are
index 8e784981877c29989dc49b22a09b500e74d93273..ebf85cdf1b39cf16abaa298b6170351a322ad3e5 100644 (file)
@@ -40,6 +40,9 @@
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
 #include "citadel.h"
 #include "server.h"
 #include "serv_extensions.h"
@@ -219,6 +222,9 @@ int main(int argc, char **argv)
                if (setuid(BBSUID) != 0) {
                        lprintf(CTDL_CRIT, "setuid() failed: %s\n", strerror(errno));
                }
+#if defined (HAVE_SYS_PRCTL_H) && defined (PR_SET_DUMPABLE)
+               prctl(PR_SET_DUMPABLE, 1);
+#endif
        }
 
        /* We want to check for idle sessions once per minute */
index 87d25681c3a940f87ea3b7fdff3ae84ca5625d8d..d59464dae87e23304465b3084e7f132be536de1d 100644 (file)
@@ -206,10 +206,6 @@ static RETSIGTYPE signal_cleanup(int signum) {
 void init_sysdep(void) {
        int a;
 
-       /* Enable core dumps */
-       struct rlimit lim = { RLIM_INFINITY, RLIM_INFINITY };
-       setrlimit(RLIMIT_CORE, &lim);
-
 #ifdef HAVE_OPENSSL
        init_ssl();
 #endif