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

List:       helix-server-cvs
Subject:    [Server-cvs] access/auth/bascauth svrbascauth.cpp, 1.8.8.1, 1.8.8.2 svrbascauth.h, 1.4, 1.4.8.1 umak
From:       ryuan () helixcommunity ! org
Date:       2013-06-26 10:09:55
[Download RAW message or body]

Update of /cvsroot/server/access/auth/bascauth
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv2395/server/access/auth/bascauth


Modified Files:
      Tag: SERVER_15_1_0
	svrbascauth.cpp svrbascauth.h umakefil 
Log Message:
Synopsis
========
HLXSRV-410 Occasionally, broadcast to server with Helix Push mode will fail to start \
                because of authentication
Branches: SERVER_15_1_0, Head

Reviewer: Anyone

Description
===========
This is a bug introduced in Helix Server 15. When developing 15, there was a bug(bug \
270432), it wished server reject a admin connection if the IP Address accessed the IP \
in 15mins ago, even it had right authentication. This is the root cause for this bug, \
which Server wrongly rejected SLTA/Producer. After discussing, we think the \
requirement of bug 270432 isn't reasonable, since both the user and password are \
recorded in browser side. If a client sends right user name and password, Helix \
Server doesn't have any reason to reject it and require user to re-intput the \
credential again. Besides the bug 410, it also caused some other weird problems, \
revert the codes back.

Files Affected
==============
server-restricted/installer/server/retailservinst.cpp
server/access/auth/bascauth/svrbascauth.cpp
server/access/auth/bascauth/svrbascauth.h
server/access/auth/bascauth/umakefil

Testing Performed
=================
Integration Tests
None






Index: umakefil
===================================================================
RCS file: /cvsroot/server/access/auth/bascauth/umakefil,v
retrieving revision 1.5
retrieving revision 1.5.8.1
diff -u -d -r1.5 -r1.5.8.1
--- umakefil	8 Aug 2012 10:35:53 -0000	1.5
+++ umakefil	26 Jun 2013 10:09:48 -0000	1.5.8.1
@@ -47,7 +47,6 @@
 
 project.AddModuleLibraries("common/dbgtool[debuglib]",
                            "common/util[utillib]",
-                           "common/system[syslib]",
                            "common/container[contlib]", 
                            "common/runtime[runtlib]")
 

Index: svrbascauth.cpp
===================================================================
RCS file: /cvsroot/server/access/auth/bascauth/svrbascauth.cpp,v
retrieving revision 1.8.8.1
retrieving revision 1.8.8.2
diff -u -d -r1.8.8.1 -r1.8.8.2
--- svrbascauth.cpp	18 Jun 2013 07:29:24 -0000	1.8.8.1
+++ svrbascauth.cpp	26 Jun 2013 10:09:48 -0000	1.8.8.2
@@ -55,9 +55,6 @@
 #include "hxcomm.h"
 #include "hxdb.h"
 #include "chxpckts.h"
-#include "hxtime.h"
-#include "dict.h"
-#include "hxnamedlock.h"
 #include "hxerror.h"
 #undef INITGUID
 
@@ -85,7 +82,6 @@
 const char* CServerBasicAuthenticator::zm_pDescription = "RealNetworks Basic \
Authenticator";  const char* CServerBasicAuthenticator::zm_pCopyright	 = \
HXVER_COPYRIGHT;  const char* CServerBasicAuthenticator::zm_pMoreInfoURL = \
                HXVER_MOREINFO;
-Dict*                           g_pHTTPRequestTime = NULL;
 /****************************************************************************
  *
  *  Function:
@@ -180,8 +176,6 @@
     , m_pRealm(NULL)
     , m_pRequestContext(NULL)
     , m_pContext(NULL)
-    , m_pRegistry(NULL)
-    , m_pAuthLock(NULL)
 {
 }
 
@@ -198,8 +192,6 @@
     HX_RELEASE(m_pRealm);
     HX_RELEASE(m_pRequestContext);
     HX_RELEASE(m_pContext);
-    HX_RELEASE(m_pRegistry);
-    HX_RELEASE(m_pAuthLock);
 }
 
 // IHXObjectConfiguration
@@ -211,32 +203,6 @@
     if (m_pContext)
     {
         m_pContext->AddRef();
-        m_pContext->QueryInterface(IID_IHXRegistry, (void **)&m_pRegistry);
-
-        IHXNamedLock* pNamedLockManager = NULL;
-        m_pContext->QueryInterface(IID_IHXNamedLock, (void **)&pNamedLockManager);
-
-        if (pNamedLockManager)
-        {
-            pNamedLockManager->GetNamedLock("BaseauthenticationLock", &m_pAuthLock);
-        }
-
-        HX_RELEASE(pNamedLockManager);
-
-        if (m_pAuthLock)
-        {
-            m_pAuthLock->Lock();
-        }
-        
-        if (!g_pHTTPRequestTime)
-        {
-            g_pHTTPRequestTime = new Dict();
-        }
-        
-        if (m_pAuthLock)
-        {
-            m_pAuthLock->Unlock();
-        }
     }
 
     return HXR_OK;
@@ -445,51 +411,11 @@
         return HXR_UNEXPECTED;
     }
 
-    INT32 nReAuthTime = 0;
-    if (m_pRegistry)
-    {
-        m_pRegistry->GetIntByName("config.AdminReAuthenticationTime", nReAuthTime);
-    }
-
     IHXBuffer* pAuthBuf = NULL;
-    IHXBuffer* pPNMAddr = NULL;
-    HXBOOL  bNeedAuth = FALSE;
-    pResponseHeaders->GetPropertyCString("Authorization", pAuthBuf);
-    if (nReAuthTime)
-    {
-        pResponseHeaders->GetPropertyCString("PNMAddr", pPNMAddr);
-        if (pPNMAddr)
-        {
-            if (g_pHTTPRequestTime)
-            {
-                HXTime now;
-                gettimeofday(&now, NULL);
-                if (m_pAuthLock)
-                {
-                    m_pAuthLock->Lock();
-                }
-                Dict_entry* pe = g_pHTTPRequestTime->find((const \
                char*)pPNMAddr->GetBuffer());
-                if (pe && pe->obj)
-                {
-                    time_t* pCurtime = (time_t*)pe->obj;
-                    if (now.tv_sec - *pCurtime >= nReAuthTime * 60)
-                    {
-                        bNeedAuth = TRUE;
-                    }
-                    *pCurtime = now.tv_sec;
-                }
-                if (m_pAuthLock)
-                {
-                    m_pAuthLock->Unlock();
-                }
-            }
-        }
-        HX_RELEASE(pPNMAddr);
-    }
-    
+    pResponseHeaders->GetPropertyCString("Authorization", pAuthBuf);    
     HX_RELEASE(pResponseHeaders);
 
-    if (!bNeedAuth && pAuthBuf && !strncasecmp((char*)pAuthBuf->GetBuffer(), \
"Basic", 5)) +    if (pAuthBuf && !strncasecmp((char*)pAuthBuf->GetBuffer(), "Basic", \
5))  {
         HX_RESULT Ret = HXR_FAIL;
         char* sToken = (char*)pAuthBuf->GetBuffer() + 5;
@@ -717,39 +643,7 @@
                (char*)pBufferCredentials->GetBuffer()))
     {
         m_bAuthenticated = TRUE;
-        m_pRequestContext->SetUserContext(this->GetUnknown());  
-        IHXValues* pResponseHeaders = NULL;
-        m_pServerRequest->GetRequestHeaders(pResponseHeaders);
-        if (pResponseHeaders)
-        {
-            IHXBuffer* pPNMAddr = NULL;
-            pResponseHeaders->GetPropertyCString("PNMAddr", pPNMAddr);
-            if (pPNMAddr)
-            {
-                if (g_pHTTPRequestTime)
-                {
-                    HXTime now;
-                    gettimeofday(&now, NULL);
-                    if (m_pAuthLock)
-                    {
-                        m_pAuthLock->Lock();
-                    }
-                    Dict_entry* pe = g_pHTTPRequestTime->find((const \
                char*)pPNMAddr->GetBuffer());
-                    if (!pe || !pe->obj)
-                    {
-                        time_t* pCurTime = new time_t;
-                        *pCurTime = now.tv_sec;
-                        g_pHTTPRequestTime->enter((const \
                char*)pPNMAddr->GetBuffer(), (void*)pCurTime);
-                    }
-                    if (m_pAuthLock)
-                    {
-                        m_pAuthLock->Unlock();
-                    }
-                }
-            }
-            HX_RELEASE(pPNMAddr);
-            HX_RELEASE(pResponseHeaders);
-        }
+        m_pRequestContext->SetUserContext(this->GetUnknown()); 
     }
     else
     {

Index: svrbascauth.h
===================================================================
RCS file: /cvsroot/server/access/auth/bascauth/svrbascauth.h,v
retrieving revision 1.4
retrieving revision 1.4.8.1
diff -u -d -r1.4 -r1.4.8.1
--- svrbascauth.h	8 Aug 2012 10:35:53 -0000	1.4
+++ svrbascauth.h	26 Jun 2013 10:09:48 -0000	1.4.8.1
@@ -36,7 +36,7 @@
  * ***** END LICENSE BLOCK ***** */  
 #ifndef __CServerBasicAuthenticator__
 #define __CServerBasicAuthenticator__
-#include "hxmon.h"
+
 /****************************************************************************
  * 
  *  Function:
@@ -266,8 +266,6 @@
     // Plugin Members
     IHXRequestContext*			 m_pRequestContext;
     IUnknown*                            m_pContext; // class factory
-    IHXRegistry*                         m_pRegistry;
-    IHXMutex*                            m_pAuthLock;
     static const char*			 zm_pDescription;
     static const char*			 zm_pCopyright;
     static const char*			 zm_pMoreInfoURL;


_______________________________________________
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