Date: Fri, 17 Sep 2004 12:02:02 +0200 (CEST) From: Martin Blapp <mb@imp.ch> To: ports@freebsd.org, "" <portsmgr@freebsd.org>, "" <portmgr@freebsd.org> Subject: [PATCH] Please decide, p5-MIME-Tools Message-ID: <20040917115051.A37464@cvs.imp.ch>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1469491-1095415322=:37464 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi Portsmgr, I ask for permission to fix this port so it users installing 5.3 can actually use it with perl < 5.6.1. If we don't do anything a lot of users will complain ! http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71525 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71593 Either we update the port to p5-MIME-Tools 5.413: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71810 or we apply those two patches here: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71360 (Fix package List) and replace the patch p5-MIME-Tools/files/patch-Filer.pm-whitespace with (This is the Filer.pm which is in p5-MIME-Tools 5.413) This fixes ports/71525 and ports/71593. --- lib/MIME/Parser/Filer.pm Thu Nov 23 06:04:03 2000 +++ lib/MIME/Parser/Filer.pm Thu Aug 26 00:42:18 2004 @@ -328,7 +328,9 @@ * it is empty * it is a string of dots: ".", "..", etc. - * it contains a known "path" character: '/' '\' ':' '[' ']' + * it contains characters not in the set: "A" - "Z", "a" - "z", + "0" - "9", "-", "_", "+", "=", ".", ",", "@", "#", + "$", and " ". * it is too long If you just want to change this behavior, you should override @@ -357,11 +359,11 @@ $self->debug("is this evil? '$name'"); return 1 if (!defined($name) or ($name eq '')); ### empty + return 1 if ($name =~ m{(^\s)|(\s+\Z)}); ### leading/trailing whitespace return 1 if ($name =~ m{^\.+\Z}); ### dots - return 1 if ($name =~ tr{\\/:[]}{}); ### path characters + return 1 if ($name =~ /[^-A-Z0-9_+=.,@\#\$\% ]/i); # Only allow good chars return 1 if ($self->{MPF_MaxName} and (length($name) > $self->{MPF_MaxName})); - $self->debug("it's ok"); 0; } @@ -402,6 +404,9 @@ my ($root, $ext) = (($last =~ /^(.*)\.([^\.]+)\Z/) ? ($1, $2) : ($last, '')); + ### Delete leading and trailing whitespace + $root =~ s/^\s+//; + $ext =~ s/\s+$//; $root = substr($root, 0, ($self->{MPF_TrimRoot} || 14)); $ext = substr($ext, 0, ($self->{MPF_TrimExt} || 3)); $ext =~ /^\w+$/ or $ext = "dat"; @@ -411,6 +416,13 @@ return $trunc; } + ### Remove all bad characters + $trunc =~ s/([^-A-Z0-9_+=.,@\#\$ ])/sprintf("%%%02X", unpack("C", $1))/ige; + if (!$self->evil_filename($trunc)) { + $self->debug("looks like I can use a munged version of the truncated last path element"); + return $trunc; + } + ### Hope that works: undef; } @@ -918,5 +930,5 @@ =head1 VERSION -$Revision: 5.406 $ +$Revision: 1.5 $ Martin Martin Blapp, <mb@imp.ch> <mbr@FreeBSD.org> ------------------------------------------------------------------ ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH Phone: +41 61 826 93 00 Fax: +41 61 826 93 01 PGP: <finger -l mbr@freebsd.org> PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E ------------------------------------------------------------------ --0-1469491-1095415322=:37464 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="patch-Filer.pm-whitespace" Content-Transfer-Encoding: BASE64 Content-ID: <20040917120202.B37464@cvs.imp.ch> Content-Description: Content-Disposition: attachment; filename="patch-Filer.pm-whitespace" LS0tIGxpYi9NSU1FL1BhcnNlci9GaWxlci5wbQlUaHUgTm92IDIzIDA2OjA0 OjAzIDIwMDANCisrKyBsaWIvTUlNRS9QYXJzZXIvRmlsZXIucG0JVGh1IEF1 ZyAyNiAwMDo0MjoxOCAyMDA0DQpAQCAtMzI4LDcgKzMyOCw5IEBADQogDQog ICAgICogaXQgaXMgZW1wdHkNCiAgICAgKiBpdCBpcyBhIHN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3M6DQogICAgIHVuZGVmOw0KIH0NCkBAIC05 MTgsNSArOTMwLDUgQEANCiANCiA9aGVhZDEgVkVSU0lPTg0KIA0KLSRSZXZp c2lvbjogNS40MDYgJA0KKyRSZXZpc2lvbjogMS41ICQNCiANCg== --0-1469491-1095415322=:37464--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040917115051.A37464>