Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Crypt-Cracklib CPAN distribution.

Report information
The Basics
Id: 26598
Status: resolved
Priority: 0/
Queue: Crypt-Cracklib

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

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



Subject: Test suite fails if length($USERNAME) is <= 4 characters
The first test for Crypt::Cracklib 1.1 fails if the length of the current username is 4 characters long or less. If this is the case, cracklib returns a different error message from the /username/ one, typically 'it is too short'. This affects Debian users who are building packages using dh-make-perl and the standard Debian fakeroot tool, which causes scalar(getpwuid $<) to return "root" (amongst other things). It also affects users who are running tests as root, and those whose ordinary account usernames are <= 4 characters long. I've attached a patch which deals with the problem and makes for a clean build under affected systems. Hope that all makes sense.
Subject: crypt-cracklib-1.1-username-length.diff
diff -rU2 Crypt-Cracklib-1.1-ORIG/t/01use.t Crypt-Cracklib-1.1/t/01use.t --- Crypt-Cracklib-1.1-ORIG/t/01use.t 2007-01-03 23:35:18.000000000 +0000 +++ Crypt-Cracklib-1.1/t/01use.t 2007-04-24 10:01:57.000000000 +0100 @@ -3,5 +3,10 @@ BEGIN { use_ok( 'Crypt::Cracklib' ); } -like(fascist_check(getpwuid($<).'1'), qr/username/, "username"); +SKIP: { + $username = getpwuid($<); + skip "won't work unless username is longer", 1 + unless length($username) > 4; + like(fascist_check($username.'1'), qr/username/, "username"); +}; # it's WAY too short
Fixed in 1.2