Browse Source

Merge branch 'candidate-6.2.6' into candidate-6.4.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 years ago
parent
commit
1e4c464272

+ 3 - 1
esp/src/eclwatch/ESPResult.js

@@ -86,7 +86,7 @@ define([
             if (!column.children && context._formattedRow[column.field] !== undefined) {
                 colLenBefore[column.field] = ("" + context._formattedRow[column.field]).split(LINE_SPLITTER).length;
             }
-            maxChildLen = Math.max(maxChildLen, context.formatCell(column, safeEncode(row[column.leafID]), rowIdx));
+            maxChildLen = Math.max(maxChildLen, context.formatCell(column, column.isRawHTML ? row[column.leafID] : safeEncode(row[column.leafID]), rowIdx));
         });
         arrayUtil.forEach(columns, function (column) {
             if (!column.children) {
@@ -413,6 +413,7 @@ define([
                             };
                             this.parseName(nameObj);
                             column = {
+                                isRawHTML: true,
                                 label: nameObj.displayName,
                                 leafID: name,
                                 field: prefix + name,
@@ -427,6 +428,7 @@ define([
                             };
                             this.parseName(nameObj);
                             column = {
+                                isRawHTML:true,
                                 label: nameObj.displayName,
                                 leafID: name,
                                 field: prefix + name,

+ 1 - 1
esp/src/eclwatch/GraphTreeWidget.js

@@ -768,7 +768,7 @@ define([
             }
             var context = this;
             if (selectedGlobalIDs.length) {
-                var edges = selectedGlobalIDs.filter(function (id) {
+                var edges = arrayUtil.filter(selectedGlobalIDs, function (id) {
                     return id && id.indexOf && id.indexOf("_") >= 0;
                 });
                 if (edges.length === 1) {

+ 9 - 3
esp/src/eclwatch/GraphsWidget.js

@@ -20,6 +20,7 @@ define([
     "dojo/i18n!./nls/hpcc",
     "dojo/_base/array",
     "dojo/on",
+    "dojo/has",
 
     "dijit/form/Button",
 
@@ -33,7 +34,7 @@ define([
     "hpcc/TimingTreeMapWidget",
     "hpcc/ESPUtil"
 
-], function (declare, lang, i18n, nlsHPCC, arrayUtil, on,
+], function (declare, lang, i18n, nlsHPCC, arrayUtil, on, has,
                 Button,
                 selector,
                 GridDetailsWidget, ESPWorkunit, ESPQuery, ESPLogicalFile, DelayLoadWidget, TimingTreeMapWidget, ESPUtil) {
@@ -48,6 +49,7 @@ define([
 
         postCreate: function (args) {
             this.inherited(arguments);
+            this.isIE8 = has("ie") === 8;
             this.timingTreeMap = new TimingTreeMapWidget({
                 id: this.id + "TimingTreeMap",
                 region: "right",
@@ -124,7 +126,7 @@ define([
                     });
                 }
             }).placeAt(this.widget.Open.domNode, "after");
-            if (dojoConfig.isPluginInstalled()) {
+            if (dojoConfig.isPluginInstalled() && !this.isIE8) {
                 this.openNativeMode = new Button({
                     label: this.i18n.OpenNativeMode,
                     onClick: function (event) {
@@ -134,6 +136,9 @@ define([
                     }
                 }).placeAt(this.widget.Open.domNode, "after");
             }
+            if (this.isIE8) {
+                dojo.destroy(this.id + "Open");
+            }
             var retVal = new declare([ESPUtil.Grid(false, true)])({
                 store: this.store,
                 columns: {
@@ -241,7 +246,8 @@ define([
                 delayProps = {
                     forceNative: true
                 };
-            } else if (params && params.legacyMode) {
+            }
+            if (params && params.legacyMode || this.isIE8) {
                 delayWidget = "GraphPageWidget";
                 title += " (L)";
                 delayProps = {};

+ 1 - 1
esp/src/eclwatch/JSGraphWidget.js

@@ -248,7 +248,7 @@ define([
                             findTextParts.splice(0, 1);
                             findTerm = findTextParts.join(":");
                         }
-                        return this.graphData.vertices.filter(function (item) {
+                        return arrayUtil.filter(this.graphData.vertices, function (item) {
                             if (findProp) {
                                 if (item.hasOwnProperty(findProp)) {
                                     return (item[findProp].toString().toLowerCase().indexOf(findTerm.toLowerCase()) >= 0);

+ 7 - 3
esp/src/eclwatch/TimingTreeMapWidget.js

@@ -23,6 +23,7 @@ define([
     "dojo/dom",
     "dojo/dom-class",
     "dojo/dom-style",
+    "dojo/has",
 
     "dijit/registry",
 
@@ -33,7 +34,7 @@ define([
 
     "dojo/text!../templates/TimingTreeMapWidget.html"
 ],
-    function (declare, lang, i18n, nlsHPCC, arrayUtil, Memory, dom, domClass, domStyle,
+    function (declare, lang, i18n, nlsHPCC, arrayUtil, Memory, dom, domClass, domStyle, has,
             registry, 
             TreeMap,
             _Widget, ESPWorkunit,
@@ -69,6 +70,9 @@ define([
 
             calcHeight: function (elmID) {
                 var elmHeight, elmMargin, elm = document.getElementById(elmID);
+                if (has("ie") === 8) {
+                    return elm.clientHeight;
+                }
                 var computedStyle = domStyle.getComputedStyle(elm);
                 elmHeight = parseFloat(computedStyle.getPropertyValue("height"));
                 elmMargin = parseFloat(computedStyle.getPropertyValue('margin-top')) + parseInt(computedStyle.getPropertyValue('margin-bottom'));
@@ -217,11 +221,11 @@ define([
 
             loadTimers: function (_timers) {
                 var context = this;
-                var timers = _timers.filter(function (d) { return context.timerFilter(d); });
+                var timers = arrayUtil.filter(_timers, function (d) { return context.timerFilter(d); });
                 var timerData = [];
                 if (timers) {
                     this.avg = timers.reduce(function (sum, timer) { return sum + timer.Seconds; }, 0) / timers.length;
-                    var sqrDiffs = timers.map(function (timer) { return Math.pow(timer.Seconds - context.avg, 2); });
+                    var sqrDiffs = arrayUtil.map(timers, function (timer) { return Math.pow(timer.Seconds - context.avg, 2); });
                     var variance = sqrDiffs.reduce(function (sum, value) { return sum + value; }, 0) / sqrDiffs.length;
                     this.stdDev = Math.sqrt(variance);
                     for (var i = 0; i < timers.length; ++i) {

+ 56 - 0
esp/src/eclwatch/_Widget.js

@@ -38,6 +38,62 @@ define([
         })();
     }
 
+    // Production steps of ECMA-262, Edition 5, 15.4.4.21
+    // Reference: http://es5.github.io/#x15.4.4.21
+    // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
+    if (!Array.prototype.reduce) {
+        Array.prototype.reduce = function (callback /*, initialValue*/) {
+            if (this === null) {
+                throw new TypeError('Array.prototype.reduce called on null or undefined');
+            }
+            if (typeof callback !== 'function') {
+                throw new TypeError(callback + ' is not a function');
+            }
+
+            // 1. Let O be ? ToObject(this value).
+            var o = Object(this);
+
+            // 2. Let len be ? ToLength(? Get(O, "length")).
+            var len = o.length >>> 0;
+
+            // Steps 3, 4, 5, 6, 7      
+            var k = 0;
+            var value;
+
+            if (arguments.length == 2) {
+                value = arguments[1];
+            } else {
+                while (k < len && !(k in o)) {
+                    k++;
+                }
+
+                // 3. If len is 0 and initialValue is not present, throw a TypeError exception.
+                if (k >= len) {
+                    throw new TypeError('Reduce of empty array with no initial value');
+                }
+                value = o[k++];
+            }
+
+            // 8. Repeat, while k < len
+            while (k < len) {
+                // a. Let Pk be ! ToString(k).
+                // b. Let kPresent be ? HasProperty(O, Pk).
+                // c. If kPresent is true, then
+                //    i. Let kValue be ? Get(O, Pk).
+                //    ii. Let accumulator be ? Call(callbackfn, undefined, « accumulator, kValue, k, O »).
+                if (k in o) {
+                    value = callback(value, o[k], k, o);
+                }
+
+                // d. Increase k by 1.      
+                k++;
+            }
+
+            // 9. Return accumulator.
+            return value;
+        };
+    }
+
     return declare("_Widget", [_LayoutWidget, _TemplatedMixin, _WidgetsInTemplateMixin], {
         baseClass: "_Widget",
         i18n: nlsHPCC,

+ 10 - 9
system/jlib/jstring.cpp

@@ -1318,24 +1318,25 @@ StringAttr& StringAttr::operator = (StringAttr && from)
 
 void StringAttr::set(const char * _text)
 {
-    free(text);
+    char * oldtext = text;
     text = _text ? strdup(_text) : NULL;
+    free(oldtext);
 }
 
 void StringAttr::set(const char * _text, unsigned _len)
 {
-  if (text)
-    free(text);
-  text = (char *)malloc(_len+1);
-  memcpy(text, _text, _len);
-  text[_len] = 0;
+    char * oldtext = text;
+    text = (char *)malloc(_len+1);
+    memcpy(text, _text, _len);
+    text[_len] = 0;
+    free(oldtext);
 }
 
 void StringAttr::setown(const char * _text)
 {
-  if (text)
-    free(text);
-  text = (char *)_text;
+    char * oldtext = text;
+    text = (char *)_text;
+    free(oldtext);
 }
 
 void StringAttr::set(const StringBuffer & source)

+ 3 - 0
system/security/LdapSecurity/ldapsecurity.cpp

@@ -194,6 +194,9 @@ bool CLdapSecUser::addToken(unsigned type, void * data, unsigned length)
 
 void CLdapSecUser::copyTo(ISecUser& destination)
 {
+    if (this == &destination)
+        return;
+
     CLdapSecUser* dest = dynamic_cast<CLdapSecUser*>(&destination);
     if(!dest)
         return;

+ 1 - 6
system/security/shared/caching.cpp

@@ -359,17 +359,12 @@ bool CPermissionsCache::lookup(ISecUser& sec_user)
 
             if(cachedpw && pw && *pw != '\0')
             {
-                StringBuffer md5pbuf;
-                md5_string2(pw, md5pbuf);
-                if(strcmp(cachedpw, md5pbuf.str()) == 0)
+                if(strcmp(cachedpw, pw) == 0)
                 {
 #ifdef _DEBUG
                     DBGLOG("CACHE: CPermissionsCache Found validated user %s", username);
 #endif
-                    // Copy cached user to the sec_user structure, but still keep the original clear text password.
-                    StringAttr originalPW(pw);
                     user->queryUser()->copyTo(sec_user);
-                    sec_user.credentials().setPassword(originalPW.get());
                     return true;
                 }
                 else

+ 0 - 9
system/security/shared/caching.hpp

@@ -108,16 +108,7 @@ public:
     {
         if(!user)
             throw MakeStringException(-1, "can't create CachedUser, NULL user pointer");
-
         m_user.setown(user);
-        const char* pw = user->credentials().getPassword();
-        if(pw && *pw)
-        {
-            StringBuffer md5pbuf;
-            md5_string2(pw, md5pbuf);
-            user->credentials().setPassword(md5pbuf.str());
-        }
-
         time(&m_timestamp);
     }
 

+ 2 - 1
thorlcr/msort/tsortl.cpp

@@ -38,6 +38,7 @@
 #endif
 
 #define DEFAULTTIMEOUT 3600 // 60 minutes 
+#define CONNECTTIMEOUT 300  // seconds
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4355 )
@@ -77,7 +78,7 @@ struct TransferStreamHeader
 
 static ISocket *DoConnect(SocketEndpoint &nodeaddr)
 {
-    return ISocket::connect_wait(nodeaddr,DEFAULTTIMEOUT);
+    return ISocket::connect_wait(nodeaddr,CONNECTTIMEOUT*1000);
 }
 
 class CSocketRowStream: public CSimpleInterface, implements IRowStream