From 928b2f01177c40be013139c657d79c631790a916 Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Wed, 2 Nov 2011 13:17:15 -0500 Subject: [PATCH] Errno does not escape archname With a @ or $ or % character in the user-choosen archname, Errno fails. I usually use @ to denote git tags in the archlib. E.g. Possible unintended interpolation of @khwtk in string at ../lib/Errno.pm line 12 --- ext/Errno/Errno_pm.PL | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 7cd7a24..439f254 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; use Config; use strict; -our $VERSION = "1.14"; +our $VERSION = "1.15"; my %err = (); my %wsa = (); @@ -316,6 +316,10 @@ EOF } } + # escape $Config{'archname'} + my $archname = $Config{'archname'}; + $archname =~ s/([@%\$])/\\\1/g; + # Write Errno.pm print <<"EDQ"; @@ -330,8 +334,8 @@ use Config; use strict; "\$Config{'archname'}-\$Config{'osvers'}" eq -"$Config{'archname'}-$Config{'osvers'}" or - die "Errno architecture ($Config{'archname'}-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})"; +"$archname-$Config{'osvers'}" or + die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})"; our \$VERSION = "$VERSION"; \$VERSION = eval \$VERSION; -- 2.7.4