Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 21620
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: lwp-request should use stderr for auth
If using lwp-request http://some/url/with/basic/auth > downloaded_file then the authentication dialog ("Enter username ...", "Password") will be printed to STDOUT, thus invisible for the user. It's better to use STDERR instead. See the attached patch fixing this problem. I also changed another print in the POST content dialog to use STDERR. Regards, Slaven
On Fri Sep 22 17:14:41 2006, SREZIC wrote: Show quoted text
> If using > > lwp-request http://some/url/with/basic/auth > downloaded_file > > then the authentication dialog ("Enter username ...", "Password") will > be printed to STDOUT, thus invisible for the user. It's better to use > STDERR instead. > > See the attached patch fixing this problem. > > I also changed another print in the POST content dialog to use STDERR. >
It seems that the patch was missing. Now attached.
From 9592f989308305c3daf5901f42c2e554714762b0 Mon Sep 17 00:00:00 2001 From: Slaven Rezic <srezic@iconmobile.com> Date: Thu, 19 Mar 2009 18:09:37 +0100 Subject: [PATCH] lwp-request should use stderr for auth --- bin/lwp-request | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/lwp-request b/bin/lwp-request index 7faaaa6..2b4b9d1 100755 --- a/bin/lwp-request +++ b/bin/lwp-request @@ -231,15 +231,15 @@ use HTTP::Date qw(time2str str2time); } elsif (-t) { my $netloc = $uri->host_port; - print "Enter username for $realm at $netloc: "; + print STDERR "Enter username for $realm at $netloc: "; my $user = <STDIN>; chomp($user); return (undef, undef) unless length $user; - print "Password: "; + print STDERR "Password: "; system("stty -echo"); my $password = <STDIN>; system("stty echo"); - print "\n"; # because we disabled echo + print STDERR "\n"; # because we disabled echo chomp($password); return ($user, $password); } @@ -362,7 +362,7 @@ if ($allowed_methods{$method} eq "C") { die "$progname: Illegal Content-type format\n" unless $options{'c'} =~ m,^[\w\-]+/[\w\-.+]+(?:\s*;.*)?$, } - print "Please enter content ($options{'c'}) to be ${method}ed:\n" + print STDERR "Please enter content ($options{'c'}) to be ${method}ed:\n" if -t; binmode STDIN unless -t or $options{'a'}; $content = join("", <STDIN>); -- 1.6.2
Thanks. Applied as http://github.com/gisle/libwww- perl/commit/fb6b9e9c9377dfe1bccd349113da2824a0312273