[Netpass-devel] NetPass/lib/NetPass DB.pm,1.57,1.58
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2006-03-16 21:27:57
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7108/lib/NetPass Modified Files: DB.pm Log Message: bug fixes, bug#1451624 bug#1451626 bug#1451625 Index: DB.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/DB.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- DB.pm 5 Jan 2006 21:02:35 -0000 1.57 +++ DB.pm 16 Mar 2006 21:27:51 -0000 1.58 @@ -1451,8 +1451,9 @@ =cut -# go from NetAdmin;Test Network+NetAdmin;128.205.10.0/24+Reports+Users -# to the hash +# go from Test Network+NetAdmin;128.205.10.0/24+Reports+Users +# to the hash. All DB entries must be in the form +# Group+perm+perm+... sub decomposeGroupMembership { my $self = shift; @@ -1464,15 +1465,13 @@ my $network = $1; my $netgroups = $2; $rv->{$network} = [ split(/\+/, $netgroups) ]; - } else { - $rv->{$c} = 1; - } + } } return $rv; } # go from the hash back to -# NetAdmin;Test Network+NetAdmin;128.205.10.0/24+Reports+Users +# Test Network+NetAdmin;128.205.10.0/24+Reports+Users sub composeGroupMembership { my $self = shift; @@ -1481,11 +1480,9 @@ my $gstring = ""; foreach my $g (sort keys %$gh) { - if (ref($gh->{$g}) eq "ARRAY") { + if ( (ref($gh->{$g}) eq "ARRAY") && ($#{$gh->{$g}} > -1) ) { $gstring .= "$g+".join('+', @{$gh->{$g}}).";"; - } else { - $gstring .= "$g;"; - } + } } $gstring =~ s/;$//; return $gstring; |