浏览代码

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

Conflicts:
	system/security/LdapSecurity/ldapconnection.cpp

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 年之前
父节点
当前提交
73fae12e6b

+ 2 - 1
esp/files/ECLPlayground.js

@@ -155,7 +155,8 @@ define([
 			},
 
 			initTargets = function () {
-				var base = new ESPBase();
+				var base = new ESPBase({
+				});
 				var request = {
 					rawxml_: true
 				};

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

@@ -53,6 +53,8 @@
 #define LDAP_NO_ATTRS "1.1"
 #endif
 
+#define PWD_NEVER_EXPIRES (__int64)0x8000000000000000
+
 class CLoadBalancer : public CInterface, implements IInterface
 {
 private:
@@ -982,14 +984,18 @@ public:
             return 0;
         }
         char **values;
-        values = ldap_get_values(sys_ld, searchResult.msg, "maxPwdAge");
-        assertex(values);
-        char *val = values[0];
-        if (*val == '-')
-            ++val;
         __int64 maxAge = 0;
-        for (int x=0; val[x]; x++)
-            maxAge = maxAge * 10 + ( (int)val[x] - '0');
+        values = ldap_get_values(sys_ld, searchResult.msg, "maxPwdAge");
+        if (values && *values)
+        {
+            char *val = values[0];
+            if (*val == '-')
+                ++val;
+            for (int x=0; val[x]; x++)
+                maxAge = maxAge * 10 + ( (int)val[x] - '0');
+        }
+        else
+            maxAge = PWD_NEVER_EXPIRES;
         ldap_value_free(values);
         return maxAge;
     }
@@ -1018,7 +1024,7 @@ public:
                 return false;
 
             m_maxPwdAge = getMaxPwdAge();
-            if (m_maxPwdAge != (__int64)0x8000000000000000)
+            if (m_maxPwdAge != PWD_NEVER_EXPIRES)
                 m_domainPwdsNeverExpire = false;
             else
                 m_domainPwdsNeverExpire = true;

+ 3 - 0
thorlcr/activities/indexwrite/thindexwriteslave.cpp

@@ -168,6 +168,9 @@ public:
         }
         assertex(!(helper->queryDiskRecordSize()->getMetaFlags() & MDFneedserialize));
         maxDiskRecordSize = helper->queryDiskRecordSize()->isVariableSize() ? KEYBUILD_MAXLENGTH : helper->queryDiskRecordSize()->getFixedSize();
+        // NB: the max [ecl] length is not used, other than setting a max field in the header.
+        // However, legacy systems (<=702) check that query rec length == key rec len.
+        maxDiskRecordSize = helper->queryDiskRecordSize()->getRecordSize(NULL);
         reportOverflow = false;
     }
 

+ 4 - 3
thorlcr/thorutil/thmem.cpp

@@ -582,12 +582,13 @@ void CThorExpandingRowArray::removeRows(rowidx_t start, rowidx_t n)
     assertex(!n || rows);
     if (rows)
     {
-        for (rowidx_t i = start; i < start+n; i++)
+        rowidx_t end = start+n;
+        for (rowidx_t i = start; i < end; i++)
             ReleaseThorRow(rows[i]);
         //firstRow = 0;
-        numRows -= n;
         const void **from = rows+start;
-        memmove(from, from+n, n * sizeof(void *));
+        memmove(from, from+n, (numRows-end) * sizeof(void *));
+        numRows -= n;
     }
 }