[interchange-cvs] interchange - pajamian modified 3 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Jul 5 07:48:45 EDT 2007


User:      pajamian
Date:      2007-07-05 11:48:38 GMT
Modified:  .        WHATSNEW-5.5
Modified:  lib/Vend Dispatch.pm Error.pm
Log:
If you have a lockout specialsub that returns a true value on a session
per IP lockout the lockout will still occur and not be overridden by the
return value of the specialsub. This is because there is a separate
lockout for session per IP triggers that is done outside of the
do_lockout sub and it does not know about the lockout specialsub or its
return value.

The attached patch passes the return value for the lockout specialsub
back as the return value for do_lockout and then uses the do_lockout
return value to determine whether to perform the secondary lockout for
sessions per IP.

Revision  Changes    Path
1.35      +2 -0      interchange/WHATSNEW-5.5


rev 1.35, prev_rev 1.34
Index: WHATSNEW-5.5
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.5,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- WHATSNEW-5.5	5 Jul 2007 11:19:41 -0000	1.34
+++ WHATSNEW-5.5	5 Jul 2007 11:48:37 -0000	1.35
@@ -65,6 +65,8 @@
   session per IP lockouts (when RobotLimit is set).  See CVS log for more
   details.
 
+* lockout specialsubs will now override session per IP lockouts properly.
+
 UserDB
 ------
 



1.80      +3 -4      interchange/lib/Vend/Dispatch.pm


rev 1.80, prev_rev 1.79
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- Dispatch.pm	5 Jul 2007 11:19:42 -0000	1.79
+++ Dispatch.pm	5 Jul 2007 11:48:38 -0000	1.80
@@ -1,6 +1,6 @@
 # Vend::Dispatch - Handle Interchange page requests
 #
-# $Id: Dispatch.pm,v 1.79 2007/07/05 11:19:42 pajamian Exp $
+# $Id: Dispatch.pm,v 1.80 2007/07/05 11:48:38 pajamian Exp $
 #
 # Copyright (C) 2002-2006 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Dispatch;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.79 $, 10);
+$VERSION = substr(q$Revision: 1.80 $, 10);
 
 use POSIX qw(strftime);
 use Vend::Util;
@@ -1369,7 +1369,7 @@
 			}
 		}
 	} else {
-	    if (Vend::Session::count_ip()) {
+	    if (Vend::Session::count_ip() && !do_lockout()) {
 		my $msg;
 		# Here they can get it back if they pass expiration time
 		my $wait = $::Limit->{robot_expire} || 1;
@@ -1379,7 +1379,6 @@
 before trying again. Only waiting that period will allow access. Terminating.
 EOF
 		$msg = get_locale_message(403, $msg);
-		do_lockout();
 
 		::logError('Too many IDs, %d hour wait enforced.', $wait);
 



2.14      +4 -3      interchange/lib/Vend/Error.pm


rev 2.14, prev_rev 2.13
Index: Error.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Error.pm,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -r2.13 -r2.14
--- Error.pm	30 Mar 2007 11:39:45 -0000	2.13
+++ Error.pm	5 Jul 2007 11:48:38 -0000	2.14
@@ -1,6 +1,6 @@
 # Vend::Error - Handle Interchange error pages and messages
 # 
-# $Id: Error.pm,v 2.13 2007/03/30 11:39:45 pajamian Exp $
+# $Id: Error.pm,v 2.14 2007/07/05 11:48:38 pajamian Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -38,7 +38,7 @@
 
 use vars qw/$VERSION/;
 
-$VERSION = substr(q$Revision: 2.13 $, 10);
+$VERSION = substr(q$Revision: 2.14 $, 10);
 
 sub get_locale_message {
 	my ($code, $message, @arg) = @_;
@@ -172,7 +172,7 @@
 			::logError("Error running lockout subroutine %s: %s", $subname, $@);
 		}
 
-		return if $status;
+		return $status if $status;
 	}
 
 	# Now we log the error after custom lockout routine gets chance
@@ -197,6 +197,7 @@
 	$Vend::Cfg->{VendURL} = $Vend::Cfg->{SecureURL} = 'http://127.0.0.1';
 	$Vend::LockedOut = 1;
 	logError($msg) if $msg;
+	return;
 }
 
 1;








More information about the interchange-cvs mailing list