Skip Menu |

This queue is for tickets about the CGI-Upload CPAN distribution.

Report information
The Basics
Id: 1854
Status: resolved
Worked: 1.7 hours (100 min)
Priority: 0/
Queue: CGI-Upload

People
Owner: ROBAU [...] cpan.org
Requestors: ivan [...] pechorin.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.04
  • 1.05
Fixed in: (no value)



Subject: bug with null symbol in filename
CGI-Upload-1.04, Perl 5.6.1 supplied with RedHat 7.3, RedHat Linux 7.3, kernel 2.4.18 I've got an error, client tried to upload file named "D:\029_INV.xls". My client uses Windows 98 SE, Internet Explorer 5.0. Filename contains "\0" - backslash and zero, but these 2 symbols where recognized as 1 symbol with ascii code 0 by the file_name method of CGI::Upload. No error or warning messages appeared (script is running with "use strict; use warnings") CGI::Upload 1.05 as far as I know does not contain any significant changes. Server environment: RedHat Linux 7.3, kernel 2.4.18, perl 5.6.1, Apache 1.3.27, mod_perl, mod_ssl I'll try to fix this bug myself.
Thank you for your feedback on this module. Show quoted text
> I've got an error, client tried to upload file named "D:\029_INV.xls". > My client uses Windows 98 SE, Internet Explorer 5.0. > > Filename contains "\0" - backslash and zero, but these 2 symbols where > recognized as 1 symbol with ascii code 0 by the file_name method of > CGI::Upload. > No error or warning messages appeared (script is running with "use > strict; use warnings")
The problem here relates to the determination of the client operating system and file parsing routines based upon the HTTP request headers. From the description of the problem supplied, it appears that the parsing of the filename supplied is defaulting to UNIX file parsing routines - This may be the result of proxy servers between the client and the web server which remove identifying HTTP client information. The solution for this problem may be to incorporate some sanity check for the determination of file parsing routines - I hope to be able to incorporate such code into the next version of CGI::Upload. Regards, Rob [guest - Thu Dec 5 10:59:15 2002]: Show quoted text
> CGI-Upload-1.04, > Perl 5.6.1 supplied with RedHat 7.3, > RedHat Linux 7.3, kernel 2.4.18 > > I've got an error, client tried to upload file named "D:\029_INV.xls". > My client uses Windows 98 SE, Internet Explorer 5.0. > > Filename contains "\0" - backslash and zero, but these 2 symbols where > recognized as 1 symbol with ascii code 0 by the file_name method of > CGI::Upload. > No error or warning messages appeared (script is running with "use > strict; use warnings") > > CGI::Upload 1.05 as far as I know does not contain any significant > changes. > > Server environment: RedHat Linux 7.3, kernel 2.4.18, > perl 5.6.1, Apache 1.3.27, mod_perl, mod_ssl > > I'll try to fix this bug myself.
Subject: bug with null symbol in filename (coderef issue with fs parsing)
From: markstos [...] cpan.org
[ROBAU - Thu Jan 2 22:40:30 2003]: Show quoted text
> Thank you for your feedback on this module. >
> > I've got an error, client tried to upload file named
> "D:\029_INV.xls".
> > My client uses Windows 98 SE, Internet Explorer 5.0. > > > > Filename contains "\0" - backslash and zero, but these 2 symbols
> where
> > recognized as 1 symbol with ascii code 0 by the file_name method
> of
> > CGI::Upload. > > No error or warning messages appeared (script is running with "use > > strict; use warnings")
> > The problem here relates to the determination of the client operating > system and file parsing routines based upon the HTTP request headers. > From the description of the problem supplied, it appears that the > parsing of the filename supplied is defaulting to UNIX file parsing > routines - This may be the result of proxy servers between the client > and the web server which remove identifying HTTP client information. > > The solution for this problem may be to incorporate some sanity check > for the determination of file parsing routines - I hope to be able to > incorporate such code into the next version of CGI::Upload. > > Regards, > Rob
I think the problem with this is the some kind of syntax bug that that 'binmode' has. Here's the affected code: fileparse_set_fstype( sub { my $browser = HTTP::BrowserDetect->new; return 'MSWin32' if $browser->windows; return 'MacOS' if $browser->mac; $^O; } ); The use of an anonymous subroutine like this will always return something like 'CODE(X95496)'. Because this is not a recognized, OS name, it defaults to Unix-style parsing. The fix could be something like this: my $os = $^O; my $browser = HTTP::BrowserDetect->new; $os = 'MSWin32' if $browser->windows; $os = 'MacOS' if $browser->mac; fileparse_set_fstype($os);
From: gabor [...] pti.co.il
I have uploaded 1.06 that should solve this problem
was solved in 1.06