[Netpass-devel] NetPass/lib/NetPass Config.pm,1.30,1.31
Brought to you by:
jeffmurphy
From: Matt <mt...@us...> - 2005-05-01 13:02:59
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14679 Modified Files: Config.pm Log Message: Index: Config.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/Config.pm,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Config.pm 27 Apr 2005 03:54:07 -0000 1.30 +++ Config.pm 1 May 2005 13:02:49 -0000 1.31 @@ -531,8 +531,9 @@ =head2 $sensors = $cfg-E<gt>getSnortSensors(network) -Returns a HASHREF with the keys being address of the machine npsnortd -is running on and the values the port. Returns C<undef> on failure. +Returns a HASHREF with hostname:port of the sensor being the keys and +the values either ro|rw representing whether sensor modification is +permitted or not. Returns C<undef> on failure. =cut @@ -547,9 +548,8 @@ if (recur_exists($self->{'cfg'}, 'network', $nw, 'snort', 'servers')) { my $s = $self->{'cfg'}->obj('network')->obj($nw)->obj('snort'); foreach ($s->keys('servers')) { - my($h, $p) = split(':', $_, 2); - $sensors->{$h} = $p; - + my $v = $s->obj('servers')->value($_); + $sensors->{$_} = ($v =~ /rw|ro/) ? $v : 'ro'; } return $sensors; } @@ -557,9 +557,8 @@ if (recur_exists($self->{'cfg'}, 'snort', 'servers')) { my $s = $self->{'cfg'}->obj('snort'); foreach ($s->keys('servers')) { - my($h, $p) = split(':', $_, 2); - $sensors->{$h} = $p; - + my $v = $s->obj('servers')->value($_); + $sensors->{$_} = ($v =~ /rw|ro/) ? $v : 'ro'; } return $sensors; } |