From 713fefe5d96acdff995c922183589eeba2304ae8 Mon Sep 17 00:00:00 2001 From: Nathan Bryant Date: Tue, 11 May 2004 15:21:45 +0000 Subject: [PATCH] * configure.ac: check for * 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 | 8 ++++++++ citadel/configure.ac | 2 +- citadel/server_main.c | 6 ++++++ citadel/sysdep.c | 4 ---- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index f60055a3f..a61656224 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,11 @@ $Log$ + Revision 620.32 2004/05/11 15:21:45 nbryant + * configure.ac: check for + * 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 next @@ -5755,3 +5762,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/configure.ac b/citadel/configure.ac index eaa93f0ca..809388991 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -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 diff --git a/citadel/server_main.c b/citadel/server_main.c index 8e7849818..ebf85cdf1 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -40,6 +40,9 @@ #ifdef HAVE_PTHREAD_H #include #endif +#ifdef HAVE_SYS_PRCTL_H +#include +#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 */ diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 87d25681c..d59464dae 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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 -- 2.39.2