From 6b12f0288ff76de0aefc505f0d3abd01873dc879 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 7 Jan 2003 12:56:18 +0000 Subject: [PATCH] - added session-unregister patch to avoid httpd SEGVs with msession module (it's something strange - in Ra, on startup apache initializes modules, then shutdowns them and initializes again; session module wasn't prepared for that (didn't shutdown other session modules cleanly). I couldn't reproduce such problems on newer software, but still with apache 1.3.27) Changed files: php-session-unregister.patch -> 1.1 php.spec -> 1.234 --- php-session-unregister.patch | 69 ++++++++++++++++++++++++++++++++++++ php.spec | 4 +-- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 php-session-unregister.patch diff --git a/php-session-unregister.patch b/php-session-unregister.patch new file mode 100644 index 0000000..07cbb2d --- /dev/null +++ b/php-session-unregister.patch @@ -0,0 +1,69 @@ +--- php-4.3.0/ext/session/php_session.h.orig Thu Oct 3 08:45:15 2002 ++++ php-4.3.0/ext/session/php_session.h Tue Jan 7 12:45:39 2003 +@@ -181,6 +181,7 @@ + int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC); + + PHPAPI int php_session_register_module(ps_module *); ++PHPAPI int php_session_unregister_module(const char *name); + + PHPAPI int php_session_register_serializer(const char *name, + int (*encode)(PS_SERIALIZER_ENCODE_ARGS), +--- php-4.3.0/ext/session/session.c.orig Thu Dec 5 21:42:05 2002 ++++ php-4.3.0/ext/session/session.c Tue Jan 7 12:45:38 2003 +@@ -208,12 +208,33 @@ + ps_modules[i] = ptr; + ret = 0; + break; +- } ++ } else if((ps_modules[i]->name != NULL) && (ptr->name != NULL) && ++ !strcasecmp(ps_modules[i]->name, ptr->name)) { ++ /* avoid double registration */ ++ ret = 0; ++ break; ++ } + } + + return ret; + } + ++PHPAPI int php_session_unregister_module(const char *name) ++{ ++ int ret = -1; ++ int i; ++ ++ for (i = 0; i < MAX_MODULES; i++) { ++ if (ps_modules[i] && ps_modules[i]->name && !strcasecmp(ps_modules[i]->name, name)) { ++ ps_modules[i] = 0; ++ ret = 0; ++ break; ++ } ++ } ++ ++ return ret; ++} ++ + PHP_MINIT_FUNCTION(session); + PHP_RINIT_FUNCTION(session); + PHP_MSHUTDOWN_FUNCTION(session); +--- php-4.3.0/ext/session/mod_mm.c.orig Thu Dec 5 21:42:05 2002 ++++ php-4.3.0/ext/session/mod_mm.c Tue Jan 7 12:46:21 2003 +@@ -291,6 +291,7 @@ + + PHP_MSHUTDOWN_FUNCTION(ps_mm) + { ++ php_session_unregister_module("mm"); + if (ps_mm_instance) { + ps_mm_destroy(ps_mm_instance); + return SUCCESS; +--- php-4.3.0/ext/msession/msession.c.orig Thu Aug 22 15:29:50 2002 ++++ php-4.3.0/ext/msession/msession.c Tue Jan 7 12:46:50 2003 +@@ -188,6 +188,9 @@ + + PHP_MSHUTDOWN_FUNCTION(msession) + { ++#ifdef HAVE_PHP_SESSION ++ php_session_unregister_module("msession"); ++#endif + return SUCCESS; + } + diff --git a/php.spec b/php.spec index d2bc7a4..af1f470 100644 --- a/php.spec +++ b/php.spec @@ -1,7 +1,5 @@ # # TODO: -# - msession module causes SEGV during phpinfo() -# (only in Ra? doesn't happen in my environment) # - pear - isn't built now, what is still needed??? # - fastcgi option in cgi SAPI? or separate fcgi SAPI? # @@ -95,6 +93,7 @@ Patch15: %{name}-build_modules.patch Patch16: %{name}-sapi-ini-file.patch Patch17: %{name}-dl-zlib.patch Patch18: %{name}-dl-pcre.patch +Patch19: %{name}-session-unregister.patch #Patch17: %{name}-%{name}_iconv_string_declaration.patch #Patch18: %{name}-pear-cosmetic.patch #Patch19: %{name}-mnogosearch.patch @@ -1372,6 +1371,7 @@ Repozytorium Aplikacji. Ten pakiet zawiera aplikacje potrzebne do %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 #%patch17 -p1 -- obsolete #%patch18 -p1 -- obsolete? - no such file #%patch19 -p1 -- obsolete -- 2.44.0