[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/netio access_ctrl.cpp,1.18,1.18.20.1
From:       jzeng () helixcommunity ! org
Date:       2010-04-28 21:17:39
Message-ID: 201004282117.o3SLHVFd019117 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/netio
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv32088

Modified Files:
      Tag: SERVER_14_0
	access_ctrl.cpp 
Log Message:
Synopsis
============
[Bug 261782] Helix server denied all connections on some w2k8 systems
Branches:  head, SERVER_14_RN
Suggested Reviewer: anyone

Description
=========== 

In CAccessRule::Match, if m_bReady is false, then the server will deny all incoming connections.  If
a host is not resolved correctly, m_bReady is never set to true, though m_bValid is set to false.
This resulted in all connections get denied.

To fix this bug, I just swap the checking of m_bReady and m_bValid, so m_bValid will be checked
first.

Files Affected
==============
server/engine/netio/access_ctrl.cpp

Testing Performed
================= 

Unit Tests: 
None. 

Integration Tests: 
verify the bug is fixed.

Leak Tests: 
None. 

Performance Tests: 
- None 

Platforms Tested: win32-i386-vc7
Build verified: win32-i386-vc7 




Index: access_ctrl.cpp
===================================================================
RCS file: /cvsroot/server/engine/netio/access_ctrl.cpp,v
retrieving revision 1.18
retrieving revision 1.18.20.1
diff -u -d -r1.18 -r1.18.20.1
--- access_ctrl.cpp	6 Mar 2009 20:41:43 -0000	1.18
+++ access_ctrl.cpp	28 Apr 2010 21:17:36 -0000	1.18.20.1
@@ -211,6 +211,14 @@
 CAccessRule::Match(IHXSockAddr* pLocalAddr, IHXSockAddr* pPeerAddr, BOOL& bMatch)
 {
     bMatch = FALSE;
+
+    if (!m_bValid)
+    {
+        // there was a problem resolving one of the addresses so the
+        // rule is ignored
+        return HXR_OK;
+    }
+
     if (!m_bReady)
     {
         // access control needs to deny access if a rule isn't ready
@@ -228,12 +236,7 @@
         }
         return HXR_FAIL;
     }
-    if (!m_bValid)
-    {
-        // there was a problem resolving one of the addresses so the
-        // rule is ignored
-        return HXR_OK;
-    }
+    
 
     // match against local addrs
     if (m_ulNumLocalAddr > 0)


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic