فهرست منبع

Merge remote-tracking branch 'origin/candidate-3.8.x' into candidate-3.10.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 سال پیش
والد
کامیت
d92b383760
4فایلهای تغییر یافته به همراه41 افزوده شده و 0 حذف شده
  1. 7 0
      dali/base/dadfs.cpp
  2. 21 0
      dali/base/dasess.cpp
  3. 5 0
      dali/server/daldap.cpp
  4. 8 0
      system/security/LdapSecurity/ldapconnection.cpp

+ 7 - 0
dali/base/dadfs.cpp

@@ -1051,7 +1051,14 @@ static int getScopePermissions(const char *scopename,IUserDescriptor *user,unsig
     int ret = 255;
     if (permissionsavail&&scopename&&*scopename&&((*scopename!='.')||scopename[1])) {
         if (!user)
+        {
+#ifdef _DALIUSER_STACKTRACE
+            //following debug code to be removed
+            DBGLOG("UNEXPECTED USER (NULL) in dadfs.cpp line %d",__LINE__);
+            PrintStackReport();
+#endif
             user = queryDistributedFileDirectory().queryDefaultUser();
+        }
         ret = querySessionManager().getPermissionsLDAP(queryDfsXmlBranchName(DXB_Scope),scopename,user,auditflags);
         if (ret<0) {
             if (ret==-1) {

+ 21 - 0
dali/base/dasess.cpp

@@ -507,6 +507,16 @@ public:
                 StringAttr passwordenc;
                 mb.read(key).read(obj);
                 udesc->deserialize(mb);
+#ifdef _DALIUSER_STACKTRACE
+                //following debug code to be removed
+                StringBuffer sb;
+                udesc->getUserName(sb);
+                if (0==sb.length() || !stricmp(sb.str(), "daliuser"))
+                {
+                    DBGLOG("UNEXPECTED USER '%s' in dasess.cpp line %d",username.get(), __LINE__);
+                    PrintStackReport();
+                }
+#endif
                 unsigned auditflags = 0;
                 if (mb.length()-mb.getPos()>=sizeof(auditflags))
                     mb.read(auditflags);
@@ -760,6 +770,17 @@ public:
         CMessageBuffer mb;
         mb.append((int)MSR_LOOKUP_LDAP_PERMISSIONS);
         mb.append(key).append(obj);
+#ifdef _DALIUSER_STACKTRACE
+        //following debug code to be removed
+        StringBuffer sb;
+        if (udesc)
+            udesc->getUserName(sb);
+        if (0==sb.length() || !stricmp(sb.str(), "daliuser"))
+        {
+            DBGLOG("UNEXPECTED USER '%s' in dasess.cpp line %d",sb.str(),__LINE__);
+            PrintStackReport();
+        }
+#endif
         udesc->serialize(mb);
         mb.append(auditflags);
         if (!queryCoven().sendRecv(mb,RANK_RANDOM,MPTAG_DALI_SESSION_REQUEST,SESSIONREPLYTIMEOUT))

+ 5 - 0
dali/server/daldap.cpp

@@ -121,6 +121,11 @@ public:
                 udesc->getPassword(password);
             }
             if (username.length()==0)  {
+#ifdef _DALIUSER_STACKTRACE
+                //following debug code to be removed
+                DBGLOG("UNEXPECTED USER (NULL) in daldap.cpp line %d", __LINE__);
+                PrintStackReport();
+#endif
                 username.append(filesdefaultuser);
                 decrypt(password, filesdefaultpassword);
             }

+ 8 - 0
system/security/LdapSecurity/ldapconnection.cpp

@@ -1180,6 +1180,14 @@ public:
             {
                 DBGLOG("LdapBind for user %s (retries=%d).", username, retries);
                 {
+#ifdef _DALIUSER_STACKTRACE
+                    //following debug code to be removed
+                    if (!username || !stricmp(username, "daliuser"))
+                    {
+                        DBGLOG("UNEXPECTED USER '%s' in ldapconnection.cpp line %d",username, __LINE__);
+                        PrintStackReport();
+                    }
+#endif
                     LDAP* user_ld = LdapUtils::LdapInit(m_ldapconfig->getProtocol(), hostbuf.str(), m_ldapconfig->getLdapPort(), m_ldapconfig->getLdapSecurePort());
                     rc = LdapUtils::LdapBind(user_ld, m_ldapconfig->getDomain(), username, password, userdnbuf.str(), m_ldapconfig->getServerType(), m_ldapconfig->getAuthMethod());
                     ldap_unbind(user_ld);