From 6eb23f2537b0bc09d110a09d5b50784054e59416 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 29 Jun 2010 22:51:14 -0700 Subject: Properly close pwent; correct precedence on membership tests. --- usr/src/libpiny/lib/Piny/Repo.pm | 2 +- usr/src/libpiny/lib/Piny/User.pm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/src') diff --git a/usr/src/libpiny/lib/Piny/Repo.pm b/usr/src/libpiny/lib/Piny/Repo.pm index bd1a3c6..84b5bb4 100644 --- a/usr/src/libpiny/lib/Piny/Repo.pm +++ b/usr/src/libpiny/lib/Piny/Repo.pm @@ -102,7 +102,7 @@ sub remove_access { sub has_access { my ( $s, $user ) = @_; - return $s->owner( )->uid( ) == $user->uid( ) or $user->has_group( $s->group( ) ); + return $s->owner( )->uid( ) == $user->uid( ) || $user->has_group( $s->group( ) ); }; # Triggers diff --git a/usr/src/libpiny/lib/Piny/User.pm b/usr/src/libpiny/lib/Piny/User.pm index f9a5f0d..14e2ca1 100644 --- a/usr/src/libpiny/lib/Piny/User.pm +++ b/usr/src/libpiny/lib/Piny/User.pm @@ -92,14 +92,16 @@ sub has_group { sub all_users { my ( $class ) = @_; - endpwent( ); - my @ret; + endpwent( ); + while ( my @info = getpwent( ) ) { push( @ret, $class->new( uid => $info[2] ) ); }; + endpwent( ); + return @ret; }; -- cgit v1.2.3