|
|
Choosing A Webhost: |
[mp1 bug] mp_preload_module() bustage: msg#00128apache.mod-perl.devel
After squirrelling down some source code, tracking something completely unrelated, I came to notice something I believe is busted. mp_preload_module(char **name) gets called in perl_config.c whenever processing a directive like Perl*Handler. Like this bit: CHAR_P perl_cmd_push_handlers(char *hook, PERL_CMD_TYPE **cmd, char *arg, pool *p) { SV *sva; /* XXX ---> */ mp_preload_module(&arg); sva = newSVpv(arg,0); [...] static void mp_preload_module(char **name) { if(ind(*name, ' ') >= 0) return; if(**name == '-' && ++*name) return; if(**name == '+') ++*name; else if(!PERL_AUTOPRELOAD) return; if(!PERL_RUNNING()) return; if(!perl_module_is_loaded(*name)) { MP_TRACE_d(fprintf(stderr, "mod_perl: attempting to pre-load module `%s'\n", *name)); perl_require_module(*name,NULL); } } The extra logic at the top of mp_preload_module fixes up the module name when calling PerlLogHandler (+|-)My::Handler. Problem happens when you do either: PerlLogHandler My::Module->somehandler or PerlLogHandler $My::Obj->somehandler Each of those 2 cases will fall through to: perl_require_module("My::Module->somehandler", NULL); or perl_require_module("$My::Obj->somehandler", NULL); And that does little more than eval "require My::Module->somehandler"; or eval "require $My::Obj->somehandler"; In both cases, you have multiple problems... First of them is that My::Module->somehandler gets called on startup (or once per request if in a .htaccess) without a valid $r as argument. Second one, the require call itself will most likely fail, trying to require the value of Apache::OK. I propose to fix mp_preload_module to be a bit smarter and skip those odd cases... But I wonder how come this issue hasn't been reported already? Am I missing something terribly simple here? Gozer out. -- -- ----------------------------------------------------------------------------- Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B) http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5 Q: It is impossible to make anything foolproof because fools are so ingenious. perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | error in Apache::SizeLimit for BSD, Vivek Khera |
|---|---|
| Next by Date: | Re: [mp1 bug] mp_preload_module() bustage, Geoffrey Young |
| Previous by Thread: | error in Apache::SizeLimit for BSD, Vivek Khera |
| Next by Thread: | Re: [mp1 bug] mp_preload_module() bustage, Geoffrey Young |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |