Skip Menu |

This queue is for tickets about the Term-Cap CPAN distribution.

Report information
The Basics
Id: 63269
Status: resolved
Priority: 0/
Queue: Term-Cap

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.12
Fixed in: (no value)



Subject: breaks under taint mode
When taint checks are turned on and $ENV{PATH} is tainted, the eval block for running "infocmp -C" will throw an unhandled exception. The user only gets the general 'Can't find a valid termcap file' error with no indication of the real problem. Proposed patch attached. I'd add a test for this but it's rather hard to inject taint tests in the current Test::More setup. Originally reported by Anthony DeRobertis in http://bugs.debian.org/507228 Thanks for your work, -- Niko Tyni ntyni@debian.org
Subject: 0002-Issue-a-warning-when-eval-infocmp-C-dies.patch
From b49952983067ad9ad0127fcd70ade9ac2b25c89a Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Tue, 23 Nov 2010 15:04:42 +0200 Subject: [PATCH 2/2] Issue a warning when eval { `infocmp -C` } dies When taint checks are turned on and $ENV{PATH} is tainted, the eval block for running "infocmp -C" will throw an unhandled exception. The user only gets the general 'Can't find a valid termcap file' error with no indication of the real problem. Originally reported by Anthony DeRobertis in http://bugs.debian.org/507228 --- Cap.pm | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/Cap.pm b/Cap.pm index 004a03c..483c99d 100644 --- a/Cap.pm +++ b/Cap.pm @@ -296,6 +296,7 @@ sub Tgetent $entry = $tmp; } }; + warn "Can't run infocmp to get a termcap entry: $@" if $@; } else { -- 1.7.2.3
On Tue Nov 23 08:20:24 2010, ntyni@iki.fi wrote: Show quoted text
> When taint checks are turned on and $ENV{PATH} is tainted, > the eval block for running "infocmp -C" will throw an unhandled > exception. > > The user only gets the general 'Can't find a valid termcap file' > error with no indication of the real problem. > > Proposed patch attached. I'd add a test for this but it's rather hard to > inject taint tests in the current Test::More setup. > > Originally reported by Anthony DeRobertis in http://bugs.debian.org/507228 > > Thanks for your work,
Thanks, belatedly applied with https://github.com/jonathanstowe/Term-Cap/commit/46d190315310b4226ab39ed9788ccf9ac8cd68e3