Jelajahi Sumber

Merge remote-tracking branch 'origin/candidate-6.0.4'

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 tahun lalu
induk
melakukan
79d812c5fe

+ 9 - 0
common/thorhelper/thorcommon.cpp

@@ -1790,6 +1790,7 @@ void setAutoAffinity(unsigned curProcess, unsigned processPerMachine, const char
 
     unsigned numaMap[NUMA_NUM_NODES];
     unsigned numNumaNodes = 0;
+#if defined(LIBNUMA_API_VERSION) && (LIBNUMA_API_VERSION>=2)
     for (unsigned i=0; i<=numa_max_node(); i++)
     {
         if (numa_bitmask_isbitset(numa_all_nodes_ptr, i))
@@ -1798,6 +1799,14 @@ void setAutoAffinity(unsigned curProcess, unsigned processPerMachine, const char
             numNumaNodes++;
         }
     }
+#else
+    //On very old versions of numa assume that all nodes are present
+    for (unsigned i=0; i<=numa_max_node(); i++)
+    {
+        numaMap[numNumaNodes] = i;
+        numNumaNodes++;
+    }
+#endif
     if (numNumaNodes <= 1)
         return;
 

+ 15 - 8
dali/server/daldap.cpp

@@ -144,12 +144,20 @@ public:
             Owned<ISecUser> user = ldapsecurity->createUser(username);
             if (user) {
                 user->credentials().setPassword(password);
-                if (filescope)
-                    perm=ldapsecurity->authorizeFileScope(*user, obj);
-                else if (wuscope)
-                    perm=ldapsecurity->authorizeWorkunitScope(*user, obj);
-                if (perm==-1)
-                    perm = 0;
+                if (!ldapsecurity->authenticateUser(*user, NULL))
+                {
+                    PROGLOG("LDAP: getPermissions(%s) scope=%s user=%s fails authentication",key?key:"NULL",obj?obj:"NULL",username.str());
+                    perm = SecAccess_None;//deny
+                }
+                else
+                {
+                    if (filescope)
+                        perm=ldapsecurity->authorizeFileScope(*user, obj);
+                    else if (wuscope)
+                        perm=ldapsecurity->authorizeWorkunitScope(*user, obj);
+                    if (perm==-1)
+                        perm = 0;
+                }
             }
             unsigned taken = msTick()-start;
 #ifndef _DEBUG
@@ -175,7 +183,6 @@ public:
         }
         return 255;
     }
-
     bool clearPermissionsCache(IUserDescriptor *udesc)
     {
         if (!ldapsecurity || ((getLDAPflags() & DLF_ENABLED) == 0))
@@ -198,7 +205,7 @@ public:
         udesc->getPassword(password);
         Owned<ISecUser> user = ldapsecurity->createUser(username);
         user->credentials().setPassword(password);
-        if (!ldapsecurity->authenticateUser(*user,superUser) || !superUser)
+        if (!ldapsecurity->authenticateUser(*user, &superUser) || !superUser)
         {
             *err = -1;
             return false;

+ 2 - 1
esp/scm/ws_topology.ecm

@@ -136,6 +136,7 @@ ESPStruct [nil_remove] TpBinding
     string Service;
     string ServiceType;
     [min_ver("1.23")] string BindingType;
+    [min_ver("1.24")] string ServiceBuildSet;
     string Port;
     string Protocol;
 
@@ -585,7 +586,7 @@ ESPresponse [exceptions_inline,encode(0)] TpGetServicePluginsResponse
     ESParray<ESPstruct TpEspServicePlugin, Plugin> Plugins;
 };
 
-ESPservice [noforms, version("1.23"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology
+ESPservice [noforms, version("1.24"), exceptions_inline("./smc_xslt/exceptions.xslt")] WsTopology
 {
     ESPuses ESPStruct TpBinding;
     ESPuses ESPstruct TpCluster;

+ 6 - 4
esp/smc/SMCLib/TpWrapper.cpp

@@ -450,15 +450,17 @@ void CTpWrapper::getTpEspServers(IArrayOf<IConstTpEspServer>& list)
                 StringBuffer xpath;
                 xpath.appendf("EspService[@name='%s']", service);
                 IPropertyTree* pServiceNode = root->queryPropTree(xpath.str());
-                const char* serviceType = pServiceNode ? pServiceNode->queryProp("Properties/@type") : NULL;
-                if (serviceType && *serviceType)
-                    pTpBinding->setServiceType(serviceType);
-
                 if (pServiceNode)
                 {
+                    const char* serviceType = pServiceNode->queryProp("Properties/@type");
+                    if (serviceType && *serviceType)
+                        pTpBinding->setServiceType(serviceType);
                     const char* bindingType = pServiceNode->queryProp("Properties/@bindingType");
                     if (bindingType && *bindingType)
                         pTpBinding->setBindingType(bindingType);
+                    const char* buildSet = pServiceNode->queryProp("@buildSet");
+                    if (buildSet && *buildSet)
+                        pTpBinding->setServiceBuildSet(buildSet);
                 }
                 tpBindings.append(*pTpBinding.getLink());
             }

+ 4 - 4
esp/src/eclwatch/WUQueryWidget.js

@@ -220,18 +220,18 @@ define([
                 lang.mixin(retVal, {
                     StartDate: this.getISOString("FromDate", "FromTime")
                 });
-            } else if (retVal.StartDate) {
+            } else if (retVal.StartDate && !retVal.FromTime) {
                 lang.mixin(retVal, {
-                    StartDate: registry.byId(this.id + "FromDate").attr("value").toISOString()
+                    StartDate: registry.byId(this.id + "FromDate").attr("value").toISOString().replace(/T.*Z/, '') + "T00:00:00Z"
                 });
             }
             if (retVal.EndDate && retVal.ToTime) {
                 lang.mixin(retVal, {
                     EndDate: this.getISOString("ToDate", "ToTime")
                 });
-            } else if (retVal.EndDate) {
+            } else if (retVal.EndDate && !retVal.ToTime) {
                 lang.mixin(retVal, {
-                    EndDate: registry.byId(this.id + "ToDate").attr("value").toISOString()
+                    EndDate: registry.byId(this.id + "ToDate").attr("value").toISOString().replace(/T.*Z/, '') + "T23:59:59Z"
                 });
             }
             if (retVal.StartDate && retVal.EndDate) {

+ 5 - 2
esp/src/eclwatch/WsTopology.js

@@ -120,12 +120,15 @@ define([
             var deferred = new Deferred();
             var context = this;
             this.TpServiceQuery({}).then(function (response) {
-                var retVal = "";
+                var retVal = ESPRequest.getURL({
+                    port: window.location.protocol === "https:" ? 18002 : 8002,
+                    pathname: ""
+                });
                 if (lang.exists("TpServiceQueryResponse.ServiceList.TpEspServers.TpEspServer", response)) {
                     arrayUtil.forEach(response.TpServiceQueryResponse.ServiceList.TpEspServers.TpEspServer, function (item, idx) {
                         if (lang.exists("TpBindings.TpBinding", item)) {
                             arrayUtil.forEach(item.TpBindings.TpBinding, function (binding, idx) {
-                                if (binding.ServiceType === type && binding.Protocol + ":" === location.protocol) {
+                                if (binding.Service === type && binding.Protocol + ":" === location.protocol) {
                                     retVal = ESPRequest.getURL({
                                         port: binding.Port,
                                         pathname: ""

+ 2 - 2
initfiles/etc/DIR_NAME/environment.xml.in

@@ -419,7 +419,7 @@
                port="8002"
                protocol="http"
                resourcesBasedn="ou=WsEcl,ou=EspServices,ou=ecl"
-               service="myws_ecl"
+               service="ws_ecl"
                type=""
                workunitsBasedn="ou=workunits,ou=ecl"
                wsdlServiceAddress="">
@@ -686,7 +686,7 @@
   <EspService build="_"
               buildSet="ws_ecl"
               description="WS ECL Service"
-              name="myws_ecl"
+              name="ws_ecl"
               roxieTimeout="300"
               workunitTimeout="600">
    <Properties bindingType="ws_eclSoapBinding"

+ 2 - 2
roxie/ccd/ccdprotocol.cpp

@@ -1250,7 +1250,7 @@ public:
         {
             responseHead.append("<").append(queryName);
             responseHead.append("Response").append(" xmlns=\"urn:hpccsystems:ecl:").appendLower(queryName.length(), queryName.str()).append('\"');
-            responseHead.append(" sequence=\"").append(seqNo).append("\">");
+            responseHead.append(" sequence=\"").append(seqNo).append("\"><Results><Result>");
             unsigned len = responseHead.length();
             client->write(responseHead.detach(), len, true);
         }
@@ -1262,7 +1262,7 @@ public:
 
         if (!resultFilter.ordinality() && !(protocolFlags & HPCC_PROTOCOL_CONTROL))
         {
-            responseTail.append("</").append(queryName);
+            responseTail.append("</Result></Results></").append(queryName);
             if (isHTTP)
                 responseTail.append("Response");
             responseTail.append('>');

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

@@ -1313,11 +1313,12 @@ bool CLdapSecManager::clearPermissionsCache(ISecUser& user)
     }
     return true;
 }
-bool CLdapSecManager::authenticateUser(ISecUser & user, bool &superUser)
+bool CLdapSecManager::authenticateUser(ISecUser & user, bool *superUser)
 {
     if (!authenticate(&user))
         return false;
-    superUser = isSuperUser(&user);
+    if (superUser)
+        *superUser = isSuperUser(&user);
     return true;
 }
 

+ 1 - 1
system/security/LdapSecurity/ldapsecurity.ipp

@@ -447,7 +447,7 @@ public:
     virtual aindex_t getManagedFileScopes(IArrayOf<ISecResource>& scopes);
     virtual int queryDefaultPermission(ISecUser& user);
     virtual bool clearPermissionsCache(ISecUser &user);
-    virtual bool authenticateUser(ISecUser & user, bool &superUser);
+    virtual bool authenticateUser(ISecUser & user, bool * superUser);
     virtual secManagerType querySecMgrType() { return SMT_LDAP; }
     inline virtual const char* querySecMgrTypeName() { return "LdapSecurity"; }
 

+ 1 - 1
system/security/shared/basesecurity.hpp

@@ -286,7 +286,7 @@ public:
         return false;
     }
 
-    bool authenticateUser(ISecUser & user, bool &superUser)
+    bool authenticateUser(ISecUser & user, bool *superUser)
     {
         UNIMPLEMENTED;
         return false;

+ 1 - 1
system/security/shared/seclib.hpp

@@ -312,7 +312,7 @@ interface ISecManager : extends IInterface
     virtual aindex_t getManagedFileScopes(IArrayOf<ISecResource>& scopes) = 0;
     virtual int queryDefaultPermission(ISecUser& user) = 0;
     virtual bool clearPermissionsCache(ISecUser & user) = 0;
-    virtual bool authenticateUser(ISecUser & user, bool &superUser) = 0;
+    virtual bool authenticateUser(ISecUser & user, bool * superUser) = 0;
     virtual secManagerType querySecMgrType() = 0;
     virtual const char* querySecMgrTypeName() = 0;
 };

+ 2 - 2
testing/regress/environment.xml.in

@@ -414,7 +414,7 @@
                port="8002"
                protocol="http"
                resourcesBasedn="ou=WsEcl,ou=EspServices,ou=ecl"
-               service="myws_ecl"
+               service="ws_ecl"
                type=""
                workunitsBasedn="ou=workunits,ou=ecl"
                wsdlServiceAddress="">
@@ -677,7 +677,7 @@
   <EspService build="_"
               buildSet="ws_ecl"
               description="WS ECL Service"
-              name="myws_ecl"
+              name="ws_ecl"
               roxieTimeout="300"
               workunitTimeout="600">
    <Properties bindingType="ws_eclSoapBinding"