From 311d67a43ba7958c327d60a13e040a51cbb94139 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Thu, 18 Mar 2010 13:52:05 -0700 Subject: More constraint stuff in libpiny. --- usr/src/libpiny/debian/changelog | 3 ++- usr/src/libpiny/lib/Piny/User.pm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/libpiny/debian/changelog b/usr/src/libpiny/debian/changelog index f7d4449..bd74a64 100644 --- a/usr/src/libpiny/debian/changelog +++ b/usr/src/libpiny/debian/changelog @@ -4,8 +4,9 @@ libpiny-perl (0.3-1) unstable; urgency=low * Add group membership manipulation. * Add some more type constraints. * Fix a bug in the username detection. + * Forbid purely-numeric usernames. - -- Julian Blake Kongslie Thu, 18 Mar 2010 13:45:52 -0700 + -- Julian Blake Kongslie Thu, 18 Mar 2010 13:51:47 -0700 libpiny-perl (0.2-1) unstable; urgency=low diff --git a/usr/src/libpiny/lib/Piny/User.pm b/usr/src/libpiny/lib/Piny/User.pm index e4b865c..e0687a3 100644 --- a/usr/src/libpiny/lib/Piny/User.pm +++ b/usr/src/libpiny/lib/Piny/User.pm @@ -13,7 +13,7 @@ use Piny::Group; subtype 'Username' => as 'Str' - => where { $_ =~ /^(?!(git|ikiwiki)-)[[a-zA-Z0-9][a-zA-Z0-9_.-]*$/ } + => where { $_ =~ /^(?!(git|ikiwiki)-)[[a-zA-Z][a-zA-Z0-9_.-]*$/ } => message { 'That username is not in the correct format for a piny user.' } ; -- cgit v1.2.3