[Bug 665535] New: apache mod_perl PUT STDIN read failure
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c0 Summary: apache mod_perl PUT STDIN read failure Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Apache AssignedTo: bnc-team-apache@forge.provo.novell.com ReportedBy: dbahi@novell.com QAContact: qa@suse.de CC: dwestervelt@novell.com Found By: --- Blocker: --- Created an attachment (id=409129) --> (http://bugzilla.novell.com/attachment.cgi?id=409129) cgi script with instructions to reproduce the issue we've been using apache, mod_perl, PUT requests, and STDIN with read() since SLES 10 SP2 and it has been failing in opensuse 11.3 since GA (even with all updates) and still failing in 11.4 M5 + factory tested finally reduce our complex cgi to a simpler script suitable for reproducing - attached with some directions for usage within the script. when placed in /srv/www/cgi-bin on a working system - PUT using curl as instructed in the script will upload a file to the server. i've tested this and it works in sles 11 sp1 and fails in opensuse > 11.2 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c David Bahi <dbahi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Apache |Apache Version|Final |Factory Product|openSUSE 11.3 |openSUSE 11.4 Target Milestone|--- |Factory -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c David Bahi <dbahi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Component|Apache |Apache Version|Factory |Final Product|openSUSE 11.4 |openSUSE 11.3 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c1 --- Comment #1 from David Bahi <dbahi@novell.com> 2011-02-28 02:36:02 UTC --- Created an attachment (id=416441) --> (http://bugzilla.novell.com/attachment.cgi?id=416441) not a fix - just difference in perl CGI.pm between os 11.2 and 11.3 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c2 David Bahi <dbahi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Apache |Basesystem AssignedTo|bnc-team-apache@forge.provo |bnc-team-screening@forge.pr |.novell.com |ovo.novell.com --- Comment #2 from David Bahi <dbahi@novell.com> 2011-02-28 02:44:35 UTC --- compared apache2-mod_perl from opensuse standard 11.2 and 11.3 repos also compared apache2 from those same repos unable to locate anything that I think relates to this perl CGI PUT STDIN issue so compared perl-5.10 from 11.2 and perl-5.12 from 11.3 and found the attached difference in perl/lib/CGI.pm there are definite changes to perl CGI PUT and STDIN handling in the patch block around line 650 on a system running opensuse 11.4 RC2 I replaced perl/lib/CGI.pm and lib/CGI/* with the files from opensuse 11.2 and the attached upload puttest / inventory script worked just fine. re-categorizing this issues as part of basesystem (that includes perl, right?) thanks for looking into this - for a proper fix - hope can be addressed before 11.4... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c Andreas Jaeger <aj@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |vcizek@novell.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c3 Vitezslav Cizek <vcizek@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmueller@novell.com --- Comment #3 from Vitezslav Cizek <vcizek@novell.com> 2011-03-03 12:23:13 UTC --- Adding Dirk Muller to CC, as he is listed as the maintainer of perl-CGI. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c6 --- Comment #6 from Michael Schröder <mls@novell.com> 2011-03-03 15:29:56 UTC --- I don't think it's correct to read from STDIN until you reach an eof, you should read at max $ENV{CONTENT_LENGTH} if it is set. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c7 Michael Schröder <mls@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution| |INVALID --- Comment #7 from Michael Schröder <mls@novell.com> 2011-03-03 15:38:52 UTC --- Also, newer versions of the CGI module read the PUT data for you, so you mustn't read from STDIN in your code. The data should be available via: my $data = $query->param('PUTDATA'); Anyway, closing with INVALID. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c8 --- Comment #8 from David Bahi <dbahi@novell.com> 2011-03-03 15:47:26 UTC --- and we're sure it's 'PUTDATA' and not 'DATA' - from looking at the diff it's not clear which to use with the PUT -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c9 --- Comment #9 from Michael Schröder <mls@novell.com> 2011-03-03 15:51:58 UTC --- The diff has: my($param) = $meth . 'DATA' ; $self->add_parameter($param) ; push (@{$self->{param}{$param}},$query_string); Thus, it's PUTDATA for a PUT method. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c10 David Bahi <dbahi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #409129|0 |1 is obsolete| | --- Comment #10 from David Bahi <dbahi@novell.com> 2011-03-10 05:28:09 UTC --- Created an attachment (id=418450) --> (http://bugzilla.novell.com/attachment.cgi?id=418450) cleaner script to reproduce PUT issue Nope - there does not seem to be a $query->param('PUTDATA') -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c11 David Bahi <dbahi@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|INVALID | --- Comment #11 from David Bahi <dbahi@novell.com> 2011-03-10 05:30:17 UTC --- suggested param('PUTDATA') in #c7 does not work in 11.4 new cleaner script to reproduce attached - output from script for put to follow -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c12 --- Comment #12 from David Bahi <dbahi@novell.com> 2011-03-10 05:32:07 UTC --- Created an attachment (id=418451) --> (http://bugzilla.novell.com/attachment.cgi?id=418451) output from cgi script so drop the cgitest script in /srv/www/cgi-bin (with mod_perl.conf enabled) and do the curl command in the comment for the PUT and you'll get this output. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c13 --- Comment #13 from David Bahi <dbahi@novell.com> 2011-03-15 19:57:24 UTC --- Created an attachment (id=419505) --> (http://bugzilla.novell.com/attachment.cgi?id=419505) in order to get content_length > 0 for meth 'PUT' in the PUTDATA - need this well, likely can be done cleaner earlier but here's my attempt at a fix. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c14 --- Comment #14 from David Bahi <dbahi@novell.com> 2011-03-15 20:02:16 UTC --- Created an attachment (id=419507) --> (http://bugzilla.novell.com/attachment.cgi?id=419507) new puttest output from cgitest script above showing the fix works for this PUT at least compare to attachment #418450 to see that here the WHOLE file is avail as PUTDATA - not chopped up because it has an '=' in the content and assigned to param -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c15 --- Comment #15 from David Bahi <dbahi@novell.com> 2011-03-15 20:05:10 UTC --- (From update of attachment 419507) sorry - compare to attachment #418451 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c16 --- Comment #16 from Michael Schröder <mls@novell.com> 2011-03-16 13:13:24 UTC --- I think you just need to set a Content-Type, i.e. add -H 'Content-Type: application/octet-stream' to your curl call. (I wonder why curl doesn't do this by itself.) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c17 --- Comment #17 from David Bahi <dbahi@novell.com> 2011-03-16 14:13:41 UTC --- Created an attachment (id=419689) --> (http://bugzilla.novell.com/attachment.cgi?id=419689) patch used in obs://systemsmanagement:baracus/perl-CGI you are suggesting this because of the 10/19/2001 xml block before the PARAM arg parsing block: if (!$is_xforms && ($meth eq 'POST' || $meth eq 'PUT') && defined($ENV{'CONTENT_TYPE'}) && $ENV{'CONTENT_TYPE'} !~ m|^application/x-www-form-urlencoded| && $ENV{'CONTENT_TYPE'} !~ m|^multipart/form-data| ) { that doesn't pay attention to octet-stream and why would that be required anyway? perhaps the location of this patch will better clarify that with the rework introduced with 3.44, for PUT, nothing will set the PUTDATA if it has $content_length > 0 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c18 --- Comment #18 from David Bahi <dbahi@novell.com> 2011-03-16 14:37:57 UTC --- hum, in that conditional i was looking at the content_type regex matching as =~ instead of the coded !~ so yes - i suppose if i force the sending of any content-type that's not one of those two - (why isn't $is_xforms initialized to 0?) - with curl it will get that block to set PUTDATA. but, again, PUT worked fine when i was reading STDIN pre 3.44 w/o the setting of content-type so isn't this an unnecessary regression/requirement? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c19 --- Comment #19 from Michael Schröder <mls@novell.com> 2011-03-16 14:54:49 UTC --- Well, the CGI module authors have added a feature (putdata handling) that is incompatible to older versions. This might be called an regression, but I doubt that reading from STDIN was a supported scenario for the module authors. Such changes happen from time to time, there's not much you can do in that case but adapting your code so that it also works with the new version. Regarding the content type check, I don't know why the code doesn't treat the absence of a content type as "application/octet-stream". I can ask the author, but I'm not sure if it's worth the hassle. It's cleaner to send a Content-Type with the data anyways. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=665535 https://bugzilla.novell.com/show_bug.cgi?id=665535#c21 Michael Schröder <mls@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CLOSED Resolution| |WONTFIX --- Comment #21 from Michael Schröder <mls@novell.com> 2011-03-24 17:38:00 UTC --- Closing again with WONTFIX ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com