r11195 - in /trunk/libterm-readpassword-perl: Changes META.yml ReadPassword.pm debian/changelog debian/compat debian/control debian/rules t/2_interactive.t
rmayorga-guest at users.alioth.debian.org
rmayorga-guest at users.alioth.debian.org
Fri Dec 14 09:11:14 UTC 2007
Author: rmayorga-guest
Date: Fri Dec 14 09:11:14 2007
New Revision: 11195
URL: http://svn.debian.org/wsvn/?sc=1&rev=11195
Log:
UNCLEAR LICENSE
( CPAN RT#31527 )
* New upstream release
* Bump standard version to 3.7.3 (no changes requiered)
* debian/compat set to 5
* debian/control
+ Add Build-Depends
+ Move deheleper from B-D-I to Build-Dependss
+ Raise debhelper version to >= 5
+ Add ${misc:Depends} to Depends
* debian/rules
+ add (build/install)-stamp targets
+ don't ignore make clean output
+ use 'realclean' instead 'clean'
+ remove unused/unneeded dh_* calls
+ move 'tests' to build target
Modified:
trunk/libterm-readpassword-perl/Changes
trunk/libterm-readpassword-perl/META.yml
trunk/libterm-readpassword-perl/ReadPassword.pm
trunk/libterm-readpassword-perl/debian/changelog
trunk/libterm-readpassword-perl/debian/compat
trunk/libterm-readpassword-perl/debian/control
trunk/libterm-readpassword-perl/debian/rules
trunk/libterm-readpassword-perl/t/2_interactive.t
Modified: trunk/libterm-readpassword-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/Changes?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/Changes (original)
+++ trunk/libterm-readpassword-perl/Changes Fri Dec 14 09:11:14 2007
@@ -17,3 +17,10 @@
0.05 Tue Jun 14 11:50:00 2005
- a space in place of the password now skips the interactive test
- save and restore the cc array, which seems to fix a bug
+
+0.06 Sun Aug 28 13:07:00 2005
+ - Setting $Term::ReadPassword::USE_STARS to a true value now
+ echoes stars for password characters.
+
+0.09 Wed Dec 12 11:20:00 2007
+ - Bug fix wrt CC_FIELDS, improved documentation
Modified: trunk/libterm-readpassword-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/META.yml?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/META.yml (original)
+++ trunk/libterm-readpassword-perl/META.yml Fri Dec 14 09:11:14 2007
@@ -1,10 +1,10 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Term-ReadPassword
-version: 0.05
+version: 0.09
version_from: ReadPassword.pm
installdirs: site
requires:
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.25
+generated_by: ExtUtils::MakeMaker version 6.17
Modified: trunk/libterm-readpassword-perl/ReadPassword.pm
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/ReadPassword.pm?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/ReadPassword.pm (original)
+++ trunk/libterm-readpassword-perl/ReadPassword.pm Fri Dec 14 09:11:14 2007
@@ -3,13 +3,24 @@
use strict;
use Term::ReadLine;
use POSIX qw(:termios_h);
- use constant CC_FIELDS =>
- (VEOF VEOL VERASE VINTR VKILL VQUIT
- VSUSP VSTART VSTOP VMIN VTIME NCCS);
+my %CC_FIELDS = (
+ VEOF => VEOF,
+ VEOL => VEOL,
+ VERASE => VERASE,
+ VINTR => VINTR,
+ VKILL => VKILL,
+ VQUIT => VQUIT,
+ VSUSP => VSUSP,
+ VSTART => VSTART,
+ VSTOP => VSTOP,
+ VMIN => VMIN,
+ VTIME => VTIME,
+ );
use vars qw(
$VERSION @ISA @EXPORT @EXPORT_OK
$ALLOW_STDIN %SPECIAL $SUPPRESS_NEWLINE $INPUT_LIMIT
+ $USE_STARS $STAR_STRING $UNSTAR_STRING
);
require Exporter;
@@ -18,7 +29,7 @@
@EXPORT = qw(
read_password
);
-$VERSION = '0.05';
+$VERSION = '0.09';
# The special characters in the input stream
%SPECIAL = (
@@ -73,7 +84,10 @@
my $term = POSIX::Termios->new();
$term->getattr($fd_tty);
my $original_flags = $term->getlflag();
- my %original_cc = map +($_, $term->getcc($_)), CC_FIELDS;
+ my %original_cc;
+ for my $field_name (keys %CC_FIELDS) {
+ $original_cc{$field_name} = $term->getcc($CC_FIELDS{$field_name});
+ }
# What makes this setup different from the ordinary?
# No keyboard-generated signals, no echoing, no canonical input
@@ -92,6 +106,11 @@
# Continue as soon as one character has been struck
$term->setcc(VMIN, 1);
}
+
+ # Optionally echo stars in place of password characters. The
+ # $unstar_string uses backspace characters.
+ my $star_string = $USE_STARS ? ($STAR_STRING || '*') : '';
+ my $unstar_string = $USE_STARS ? ($UNSTAR_STRING || "\b*\b \b") : '';
# If there's anything already buffered, we should throw it out. This
# is to discourage users from typing their password before they see
@@ -121,10 +140,16 @@
} elsif ($meaning eq 'DEL') {
# Delete/backspace key
# Take back one char, if possible
- chop $input;
+ if (length $input) {
+ $input = substr $input, 0, length($input)-1;
+ print TTYOUT $unstar_string;
+ }
} elsif ($meaning eq 'NAK') {
# Control-U (NAK)
# Clear what we have read so far
+ for (1..length $input) {
+ print TTYOUT $unstar_string;
+ }
$input = '';
} elsif ($interruptable and $meaning eq 'INT') {
# Breaking out of the program
@@ -133,10 +158,12 @@
} else {
# Just an ordinary keystroke
$input .= $new_key;
+ print TTYOUT $star_string;
}
} else {
# Not special
$input .= $new_key;
+ print TTYOUT $star_string;
}
}
# Just in case someone sends a lot of data
@@ -151,12 +178,12 @@
# Done with waiting for input. Let's not leave the cursor sitting
# there, after the prompt.
- print TTY "\n" unless $SUPPRESS_NEWLINE;
+ print TTYOUT "\n" unless $SUPPRESS_NEWLINE;
# Let's put everything back where we found it.
$term->setlflag($original_flags);
while (my($field, $value) = each %original_cc) {
- $term->setcc($field, $value);
+ $term->setcc($CC_FIELDS{$field}, $value);
}
$term->setattr($fd_tty, TCSAFLUSH);
close(TTY);
@@ -260,6 +287,16 @@
normally or not, a newline character will be printed, so that the cursor
will not remain on the line after the prompt.
+=head1 BUGS
+
+This module has a poorly-designed interface, and should be thoroughly
+rethought.
+
+Users who wish to see password characters echoed as stars may set
+$Term::ReadPassword::USE_STARS to a true value. The bugs are that some
+terminals may not erase stars when the user corrects an error, and that
+using stars leaks information to shoulder-surfers.
+
=head1 SECURITY
You would think that a module dealing with passwords would be full of
@@ -273,6 +310,11 @@
In short, if serious security is an issue, don't use this module.
+=head1 LICENSE
+
+This program is free software; you may redistribute it, modify it, or
+both, under the same terms as Perl itself.
+
=head1 AUTHOR
Tom Phoenix <rootbeer at redcat.com>
Modified: trunk/libterm-readpassword-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/debian/changelog?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/debian/changelog (original)
+++ trunk/libterm-readpassword-perl/debian/changelog Fri Dec 14 09:11:14 2007
@@ -1,3 +1,25 @@
+libterm-readpassword-perl (0.09-1) UNRELEASED; urgency=low
+
+ UNCLEAR LICENSE
+ ( CPAN RT#31527 )
+
+ * New upstream release
+ * Bump standard version to 3.7.3 (no changes requiered)
+ * debian/compat set to 5
+ * debian/control
+ + Add Build-Depends
+ + Move deheleper from B-D-I to Build-Dependss
+ + Raise debhelper version to >= 5
+ + Add ${misc:Depends} to Depends
+ * debian/rules
+ + add (build/install)-stamp targets
+ + don't ignore make clean output
+ + use 'realclean' instead 'clean'
+ + remove unused/unneeded dh_* calls
+ + move 'tests' to build target
+
+ -- Rene Mayorga <rmayorga at debian.org.sv> Fri, 14 Dec 2007 01:51:58 -0600
+
libterm-readpassword-perl (0.05-2) UNRELEASED; urgency=low
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
Modified: trunk/libterm-readpassword-perl/debian/compat
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/debian/compat?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/debian/compat (original)
+++ trunk/libterm-readpassword-perl/debian/compat Fri Dec 14 09:11:14 2007
@@ -1,1 +1,1 @@
-4
+5
Modified: trunk/libterm-readpassword-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/debian/control?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/debian/control (original)
+++ trunk/libterm-readpassword-perl/debian/control Fri Dec 14 09:11:14 2007
@@ -3,15 +3,16 @@
Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jay Bonci <jaybonci at debian.org>
-Standards-Version: 3.6.2.1
+Standards-Version: 3.7.3
+Build-Depends: debhelper (>= 5)
+Build-Depends-Indep: perl (>= 5.6.0-16)
Homepage: http://search.cpan.org/dist/Term-ReadPassword/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libterm-readpassword-perl/
-Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libterm-readpassword-perl/
-Build-Depends-Indep: debhelper (>= 4.1.0), perl (>= 5.6.0-16)
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libterm-readpassword-perl
Package: libterm-readpassword-perl
Architecture: all
-Depends: ${perl:Depends}
+Depends: ${perl:Depends}, ${misc:Depends}
Description: ask the user for a password
This module lets you ask the user for a password in the
traditional way, from the keyboard, without echoing.
Modified: trunk/libterm-readpassword-perl/debian/rules
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/debian/rules?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/debian/rules (original)
+++ trunk/libterm-readpassword-perl/debian/rules Fri Dec 14 09:11:14 2007
@@ -8,40 +8,38 @@
# This is the debhelper compatibility version to use.
# export DH_COMPAT=4
+PERL=/usr/bin/perl
PACKAGE=`pwd | sed -e "s/.*\/\\(.*\\)-.*/\\1/"`
-build:
+build: build-stamp
+build-stamp:
dh_testdir
- # Add here commands to compile the package.
- perl Makefile.PL verbose INSTALLDIRS=vendor
+ $(PERL) Makefile.PL verbose INSTALLDIRS=vendor
+ $(MAKE)
+ $(MAKE) test
+ touch $@
clean:
dh_testdir
dh_testroot
+ dh_clean build-stamp install-stamp
+ [ ! -f Makefile ] || $(MAKE) realclean
- -$(MAKE) clean
- rm -f Makefile.old
- dh_clean
-
-install:
+install: install-stamp
+install-stamp:
dh_testdir
dh_testroot
dh_clean -k
- dh_installdirs
-
- #No test here, because they're interactive
- $(MAKE) PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr OPTIMIZE="-O2 -g -Wall" install
- -find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
+ $(MAKE) install PREFIX=$(CURDIR)/debian/$(PACKAGE)/usr
+ rmdir --ignore-fail-on-non-empty --parents $(CURDIR)/debian/$(PACKAGE)/usr/lib/perl5
+ touch $@
binary-arch:;
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs
- dh_installman
dh_installchangelogs Changes
- dh_link
- dh_strip
dh_compress
dh_fixperms
dh_installdeb
Modified: trunk/libterm-readpassword-perl/t/2_interactive.t
URL: http://svn.debian.org/wsvn/trunk/libterm-readpassword-perl/t/2_interactive.t?rev=11195&op=diff
==============================================================================
--- trunk/libterm-readpassword-perl/t/2_interactive.t (original)
+++ trunk/libterm-readpassword-perl/t/2_interactive.t Fri Dec 14 09:11:14 2007
@@ -6,6 +6,8 @@
print "1..0 # Skip: Automated testing detected (AUTOMATED_TESTING) \n";
exit;
}
+
+$Term::ReadPassword::USE_STARS = $ENV{USE_STARS};
print "1..1\n";
More information about the Pkg-perl-cvs-commits
mailing list