diff options
author | Russ Allbery <rra@stanford.edu> | 2007-08-30 16:02:28 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-08-30 16:02:28 +0000 |
commit | ff77c1511d2db660d83fdf87083d80312288f01b (patch) | |
tree | f16305f7de1bec3a9b0b09c307b7072199140b6d /perl/Wallet/ACL.pm | |
parent | 2acb79706b821f428e9a927d4e6f35dc18f04187 (diff) |
Don't reuse the same reference in list; expand each return separately.
Reject check with an empty principal.
Diffstat (limited to 'perl/Wallet/ACL.pm')
-rw-r--r-- | perl/Wallet/ACL.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/perl/Wallet/ACL.pm b/perl/Wallet/ACL.pm index 1815199..6226585 100644 --- a/perl/Wallet/ACL.pm +++ b/perl/Wallet/ACL.pm @@ -233,7 +233,7 @@ sub remove { my ($data) = $self->{dbh}->selectrow_array ($sql, undef, $self->{id}, $scheme, $identifier); unless (defined $data) { - die "entry not found in ACL"; + die "entry not found in ACL\n"; } $sql = 'delete from acl_entries where ae_id = ? and ae_scheme = ? and ae_identifier = ?'; @@ -269,7 +269,7 @@ sub list { $sth->execute ($self->{id}); my $entry; while (defined ($entry = $sth->fetchrow_arrayref)) { - push (@entries, $entry); + push (@entries, [ @$entry ]); } }; if ($@) { @@ -293,6 +293,10 @@ sub list { # globally cache verifiers in some way. sub check { my ($self, $principal) = @_; + unless ($principal) { + $self->{error} = 'no principal specified'; + return undef; + } my @entries = $self->list; return undef if (@entries == 1 and not defined $entries[0]); my %verifier; |