From 7e948f4248953e135ba9824e15801b313f69c9da Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 20 Jul 2011 22:57:01 +0200 Subject: Fix pwgen usage, release v0.52 --- Changelog | 4 ++++ bin/raps2 | 6 ++++-- lib/App/Raps2.pm | 8 ++++---- lib/App/Raps2/Password.pm | 4 ++-- lib/App/Raps2/UI.pm | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Changelog b/Changelog index a71b51f..f9498df 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +App::Raps2 0.52 - Wed Jul 20 2011 + + * raps2 add: Fix pwgen usage (remove trailing whitespace) + App::Raps2 0.51 - Wed Jul 20 2011 * Major usability improvements diff --git a/bin/raps2 b/bin/raps2 index 2246f86..5aed4c9 100755 --- a/bin/raps2 +++ b/bin/raps2 @@ -13,7 +13,7 @@ use Getopt::Long qw(:config no_ignore_case); my ( $default_cost, $no_echo, $paste, $pwgen_cmd ); -our $VERSION = '0.51'; +our $VERSION = '0.52'; GetOptions( 'c|cost=i' => \$default_cost, @@ -275,7 +275,7 @@ B [I] I [I] =head1 VERSION -This manual documents B version 0.51 +This manual documents B version 0.52 =head1 DESCRIPTION @@ -369,6 +369,8 @@ Note that it can only be pasted once. When the user does not enter a password in B, it will execute I to create one. The first line of output is taken as password. +If the output contains spaces, anything after the first space (plus the space +itself) is discarded. Default: pwgen -s 23 1 diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm index 1d18d79..d13aaed 100644 --- a/lib/App/Raps2.pm +++ b/lib/App/Raps2.pm @@ -12,7 +12,7 @@ use File::BaseDir qw(config_home data_home); use File::Path qw(make_path); use File::Slurp qw(slurp write_file); -our $VERSION = '0.51'; +our $VERSION = '0.52'; sub new { my ( $class, %opt ) = @_; @@ -186,7 +186,7 @@ sub generate_password { my ($self) = @_; open( my $pwgen, q{-|}, $self->conf('pwgen_cmd') ) or return; - my $password = <$pwgen>; + my $password = ( split( / /, <$pwgen> ) )[0]; close($pwgen) or cluck("Cannot close pwgen pipe: $!"); chomp $password; @@ -299,7 +299,7 @@ B is the backend for B, a simple commandline password safe. =head1 VERSION -This manual documents App::Raps2 version 0.51 +This manual documents App::Raps2 version 0.52 =head1 METHODS @@ -394,7 +394,7 @@ from the defaults config file. =item $raps2->generate_password() Runs B (as specified in B or the config file) and returns its -first line of output, without the trailing newline. +first word of output, without trailing newlines / whitespaces. =back diff --git a/lib/App/Raps2/Password.pm b/lib/App/Raps2/Password.pm index 6b5be02..9eeb875 100644 --- a/lib/App/Raps2/Password.pm +++ b/lib/App/Raps2/Password.pm @@ -9,7 +9,7 @@ use Crypt::CBC; use Crypt::Eksblowfish; use Crypt::Eksblowfish::Bcrypt qw(bcrypt_hash en_base64 de_base64); -our $VERSION = '0.51'; +our $VERSION = '0.52'; sub new { my ( $obj, %conf ) = @_; @@ -135,7 +135,7 @@ App::Raps2::Password - Password class for App::Raps2 =head1 VERSION -This manual documents B version 0.51 +This manual documents B version 0.52 =head1 DESCRIPTION diff --git a/lib/App/Raps2/UI.pm b/lib/App/Raps2/UI.pm index c8b34c0..4914b71 100644 --- a/lib/App/Raps2/UI.pm +++ b/lib/App/Raps2/UI.pm @@ -8,7 +8,7 @@ use Carp qw(cluck confess); use POSIX; use Term::ReadLine; -our $VERSION = '0.51'; +our $VERSION = '0.52'; sub new { my ($obj) = @_; @@ -132,7 +132,7 @@ App::Raps2::UI - App::Raps2 User Interface =head1 VERSION -This manual documents B version 0.51 +This manual documents B version 0.52 =head1 DESCRIPTION -- cgit v1.2.3