$NetBSD: patch-ab,v 1.2 2007/06/28 01:20:52 lkundrak Exp $ Part of fix for CVE-2007-3304 Denial of Service. --- server/mpm_common.c.orig 2007-06-28 02:53:52.000000000 +0200 +++ server/mpm_common.c @@ -126,6 +126,10 @@ static int reclaim_one_pid(pid_t pid, ac apr_proc_t proc; apr_status_t waitret; + if (!MPM_VALID_PID(pid)) { + return 1; + } + proc.pid = pid; waitret = apr_proc_wait(&proc, NULL, NULL, APR_NOWAIT); if (waitret != APR_CHILD_NOTDONE) { @@ -305,6 +309,16 @@ void ap_relieve_child_processes(void) cur_extra = next; } } + +apr_status_t ap_mpm_safe_kill(pid_t pid, int sig) +{ + if (MPM_VALID_PID(pid)) { + return kill(pid, sig) ? errno : APR_SUCCESS; + } + else { + return APR_EINVAL; + } +} #endif /* AP_MPM_WANT_RECLAIM_CHILD_PROCESSES */ #ifdef AP_MPM_WANT_WAIT_OR_TIMEOUT @@ -468,7 +482,7 @@ AP_DECLARE(gid_t) ap_gname2id(const char #ifndef HAVE_INITGROUPS int initgroups(const char *name, gid_t basegid) { -#if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || defined(TPF) || defined(__TANDEM) || defined(OS2) || defined(WIN32) || defined(NETWARE) +#if defined(QNX) || defined(MPE) || defined(BEOS) || defined(_OSD_POSIX) || defined(TPF) || defined(__TANDEM) || defined(OS2) || defined(WIN32) || defined(NETWARE) || defined(__INTERIX) /* QNX, MPE and BeOS do not appear to support supplementary groups. */ return 0; #else /* ndef QNX */