Permalink
Browse files

Fix SID check, allow for lowercase letters.

  • Loading branch information...
1 parent 4573f6c commit 67ec5f81f117d7e350e16e67e14f0f48b240d034 @juster committed Aug 21, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 script/cpan2aur
View
@@ -337,11 +337,16 @@ sub _load_last_login
die q{Please 'chmod 600 ~/.cpan2aur', it is not readable}
unless ( -r $CFGPATH );
+ my ($user, $sid);
open my $cfgfile, q{<}, $CFGPATH or die "open $CFGPATH: $!";
- my ($user, $sid) = split /:/, <$cfgfile>;
+ while (<$cfgfile>) {
+ chomp;
+ ($user, $sid) = split /:/;
+ last; # only want first line
+ }
close $cfgfile;
- return () unless ( $user && $sid && $sid =~ /\A[A-F0-9]+\Z/ );
+ return () unless ( $user && $sid && $sid =~ /\A[a-fA-F0-9]+\z/ );
# If the user specified a --name flag, make sure it matches the cached...
return () if ( $NAME && ( lc $user ne lc $NAME ));

0 comments on commit 67ec5f8

Please sign in to comment.