Update of /cvsroot/netpass/NetPass/bin
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15144/bin
Modified Files:
macscan.pl npsvc.pl
Log Message:
primarily changes to API to allow easier remote control of netpass from IDS systems
Index: npsvc.pl
===================================================================
RCS file: /cvsroot/netpass/NetPass/bin/npsvc.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- npsvc.pl 22 Aug 2005 19:26:06 -0000 1.7
+++ npsvc.pl 7 Jul 2006 13:31:36 -0000 1.8
@@ -162,14 +162,14 @@
next if ($line =~ /^\s*\#/);
my($port, $email, $action, $cmd) = split(/\s+/, $line, 4);
print "config(pre-regexp): <$port> <$email> <$action> <$cmd>\n" if $D;
- if ($email !~ /^\w+\@\w*\.*\w*\.*\w+\.\w+$/) {
+ if ($email !~ /^[^@]+\@\w*\.*\w*\.*\w+\.\w+$/) {
print "config(email) <$email> didnt parse\n";
}
if (! -e (split(/\s+/, $cmd))[0]) {
print "config(cmd) <$cmd> not executable\n";
}
next if ($cmd eq '' ||
- $email !~ /^\w+\@\w*\.*\w*\.*\w+\.\w+$/ ||
+ $email !~ /^[^@]+\@\w*\.*\w*\.*\w+\.\w+$/ ||
$port eq '' ||
$action !~ /^(restart|norestart)$/ ||
!-e (split(/\s+/, $cmd))[0]);
Index: macscan.pl
===================================================================
RCS file: /cvsroot/netpass/NetPass/bin/macscan.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- macscan.pl 19 Jan 2006 21:46:45 -0000 1.15
+++ macscan.pl 7 Jul 2006 13:31:36 -0000 1.16
@@ -111,6 +111,8 @@
use NetPass::LOG qw(_log _cont);
require NetPass;
+use Data::Dumper;
+
BEGIN {
use Config;
$Config{useithreads} or die "Recompile Perl with threads to run this program.";
@@ -326,7 +328,7 @@
$portIsOK = 0;
push @nOkMacs, $mac."/NR";
}
- elsif ($np->db->macStatus($mac) =~ /^[P]QUAR/) {
+ elsif ($np->db->macStatus($mac) =~ /^[P]{0,1}QUAR/) {
# mac registered but quarantined
print "[$tid] reg status of $mac is 'registered but quarantined'\n" if $D;
$portIsOK = 0;
|