diff options
author | Russ Allbery <rra@stanford.edu> | 2007-12-05 22:55:45 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-12-05 22:55:45 +0000 |
commit | f8c47d1f3cf5d4e8aa64c39120731ca9054dc786 (patch) | |
tree | 479e5d45b62e70ddfe8f15d2efc0a05cc60ca158 /perl/Wallet/ACL.pm | |
parent | 5ad61b6ecd14adffa013ef5b0b8c2b8da8cca03b (diff) |
Various coding style fixes and cleanup based on a much-appreciated
code audit by Simon Cozens. I didn't take all of his advise, and he
shouldn't be blamed for any remaining issues.
Diffstat (limited to 'perl/Wallet/ACL.pm')
-rw-r--r-- | perl/Wallet/ACL.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/perl/Wallet/ACL.pm b/perl/Wallet/ACL.pm index 3745074..f9a163b 100644 --- a/perl/Wallet/ACL.pm +++ b/perl/Wallet/ACL.pm @@ -174,7 +174,7 @@ sub rename { my ($self, $name) = @_; if ($name =~ /^\d+\z/) { $self->error ("ACL name may not be all numbers"); - return undef; + return; } eval { my $sql = 'update acls set ac_name = ? where ac_id = ?'; @@ -184,7 +184,7 @@ sub rename { if ($@) { $self->error ("cannot rename ACL $self->{id} to $name: $@"); $self->{dbh}->rollback; - return undef; + return; } $self->{name} = $name; return 1; @@ -208,7 +208,7 @@ sub destroy { if ($@) { $self->error ("cannot destroy ACL $self->{id}: $@"); $self->{dbh}->rollback; - return undef; + return; } return 1; } @@ -223,7 +223,7 @@ sub add { $time ||= time; unless ($self->scheme_mapping ($scheme)) { $self->error ("unknown ACL scheme $scheme"); - return undef; + return; } eval { my $sql = 'insert into acl_entries (ae_id, ae_scheme, ae_identifier) @@ -235,7 +235,7 @@ sub add { if ($@) { $self->error ("cannot add $scheme:$identifier to $self->{id}: $@"); $self->{dbh}->rollback; - return undef; + return; } return 1; } @@ -264,7 +264,7 @@ sub remove { my $entry = "$scheme:$identifier"; $self->error ("cannot remove $entry from $self->{id}: $@"); $self->{dbh}->rollback; - return undef; + return; } return 1; } @@ -308,7 +308,7 @@ sub show { my ($self) = @_; my @entries = $self->list; if (not @entries and $self->error) { - return undef; + return; } my $name = $self->name; my $id = $self->id; @@ -344,7 +344,7 @@ sub history { if ($@) { $self->error ("cannot read history for $self->{id}: $@"); $self->{dbh}->rollback; - return undef; + return; } return $output; } @@ -392,7 +392,7 @@ sub check { my ($self, $principal) = @_; unless ($principal) { $self->error ('no principal specified'); - return undef; + return; } my @entries = $self->list; return undef if (not @entries and $self->error); |