From 0667bcefdefa48d04ce89bc6827059d801d1e7e5 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 18 Jul 2013 15:43:10 -0700 Subject: [PATCH] Avoid join(':',%$self) warnings The join(':',%$self) expression is used to help produce more varied input to the hash function. Occasionally some of the keys stored in %$self have undefined values. Since that's not important in this context, squelch the warnings. --- Girocco/Project.pm | 5 ++++- Girocco/User.pm | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index e4e6306..741c85f 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -684,7 +684,10 @@ sub set_HEAD { sub gen_auth { my $self = shift; - $self->{auth} = sha1_hex(time . $$ . rand() . join(':',%$self)); + { + no warnings; + $self->{auth} = sha1_hex(time . $$ . rand() . join(':',%$self)); + } my $expire = time + 24 * 3600; my $propval = "# DELAUTH $self->{auth} $expire"; system('git', '--git-dir='.$self->{path}, 'config', 'gitweb.delauth', $propval); diff --git a/Girocco/User.pm b/Girocco/User.pm index 525affa..4429f9d 100644 --- a/Girocco/User.pm +++ b/Girocco/User.pm @@ -34,7 +34,11 @@ sub _gen_uuid { my $self = shift; $self->{uuid} = '' unless $self->{uuid}; - my @md5 = unpack('C*', md5(time . $$ . rand() . join(':',%$self))); + my @md5; + { + no warnings; + @md5 = unpack('C*', md5(time . $$ . rand() . join(':',%$self))); + } $md5[6] = 0x40 | ($md5[6] & 0x0F); # Version 4 -- random $md5[8] = 0x80 | ($md5[8] & 0x3F); # RFC 4122 specification return sprintf( -- 2.11.4.GIT