Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@www.apache.org Received: (qmail 3306 invoked from network); 14 Feb 2004 01:38:06 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 14 Feb 2004 01:38:06 -0000 Received: (qmail 25159 invoked by uid 500); 14 Feb 2004 01:37:50 -0000 Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 25143 invoked by uid 500); 14 Feb 2004 01:37:50 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 25130 invoked by uid 500); 14 Feb 2004 01:37:50 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org Date: 14 Feb 2004 01:38:05 -0000 Message-ID: <20040214013805.3302.qmail@minotaur.apache.org> From: stas@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0 Changes X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N stas 2004/02/13 17:38:05 Modified: src/modules/perl modperl_config.c . Changes Log: Fix the corruption of the httpd process argv[0], caused by $0 manipulating Revision Changes Path 1.76 +13 -2 modperl-2.0/src/modules/perl/modperl_config.c Index: modperl_config.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -u -r1.75 -r1.76 --- modperl_config.c 12 Feb 2004 02:05:28 -0000 1.75 +++ modperl_config.c 14 Feb 2004 01:38:05 -0000 1.76 @@ -178,8 +178,19 @@ #ifdef MP_USE_GTOP scfg->gtop = modperl_gtop_new(p); #endif - - modperl_config_srv_argv_push((char *)ap_server_argv0); + + /* must copy ap_server_argv0, because otherwise any read/write of + * $0 corrupts process' argv[0] (visible with 'ps -ef' on most + * unices). This is due to the logic of calculating PL_origalen in + * perl_parse, which is later used in set_mg.c:Perl_magic_set() to + * truncate the argv[0] setting. remember that argv[0] passed to + * perl_parse() != process's real argv[0]. + * + * as a copying side-effect, changing $0 now doesn't affect the + * way the process is seen from the outside. + */ + modperl_config_srv_argv_push(apr_pstrmemdup(p, ap_server_argv0, + strlen(ap_server_argv0))); MP_TRACE_d(MP_FUNC, "new scfg: 0x%lx\n", (unsigned long)scfg); 1.330 +3 -0 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.329 retrieving revision 1.330 diff -u -u -r1.329 -r1.330 --- Changes 13 Feb 2004 22:32:23 -0000 1.329 +++ Changes 14 Feb 2004 01:38:05 -0000 1.330 @@ -12,6 +12,9 @@ =item 1.99_13-dev +Fix the corruption of the httpd process argv[0], caused by $0 +manipulating [Stas] + ModPerl::MethodLookup::lookup_method now handles sub-classed objects [Stas]