Explorar o código

Merge branch 'candidate-7.6.x'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=5) %!d(string=hai) anos
pai
achega
dbaf0372ed

+ 1 - 1
ecl/hql/hqlexpr.ipp

@@ -33,7 +33,7 @@
 //It allocates a unique id to each expression that is created, then add the unique ids into the
 //checkSeqId() function, and add a breakpoint there
 #ifdef _DEBUG
-//#define DEBUG_TRACK_INSTANCEID
+#define DEBUG_TRACK_INSTANCEID
 #endif
 
 #include "jexcept.hpp"

+ 1 - 0
ecl/hql/reservedwords.cpp

@@ -386,6 +386,7 @@ static const char * eclReserved12[] = {//Attributes
     "probability",
     "pulled",
     "remote",
+    "restricted",
     "return",
     "right",
     "rows",

+ 1 - 0
esp/eclwatch/ws_XSLT/CMakeLists.txt

@@ -175,6 +175,7 @@ FOREACH ( iFILES
     ${CMAKE_CURRENT_SOURCE_DIR}/account.xslt
     ${CMAKE_CURRENT_SOURCE_DIR}/account_input.xslt
     ${CMAKE_CURRENT_SOURCE_DIR}/account_myaccount.xslt
+    ${CMAKE_CURRENT_SOURCE_DIR}/codesign.xslt
 )
     Install ( FILES ${iFILES} DESTINATION componentfiles/smc_xslt COMPONENT Runtime )
 ENDFOREACH ( iFILES )

+ 73 - 0
esp/eclwatch/ws_XSLT/codesign.xslt

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+<xsl:output method="html"/>
+    <xsl:output method="html"/>
+    <xsl:template match="/">
+        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+            <title>SignResponse</title>
+      <link rel="stylesheet" type="text/css" href="/esp/files/yui/build/fonts/fonts-min.css" />
+      <link rel="stylesheet" type="text/css" href="/esp/files/css/espdefault.css" />
+        </head>
+          <body class="yui-skin-sam" onload="nof5();">
+            <p align="left" />
+            <xsl:apply-templates/>
+          </body>
+        </html>
+      </xsl:template>
+      <xsl:template match="SignResponse">
+          <table>
+            <tr>
+              <th colspan="5">
+                <h3>SignResponse</h3>
+              </th>
+            </tr>
+            <tr>
+              <td>
+                <b>
+                  <xsl:text>RetCode: </xsl:text>
+                </b>
+              </td>
+              <td>
+                <xsl:value-of select="RetCode"/>
+              </td>
+            </tr>
+            <tr>
+              <td>
+                <b>ErrMsg: </b>
+              </td>
+              <td>
+                <xsl:value-of select="ErrMsg"/>
+              </td>
+            </tr>
+            <tr>
+              <td>
+                <b>SignedText: </b>
+              </td>
+          <td>
+        <pre>
+            <xsl:value-of select="SignedText"/>
+        </pre>
+              </td>
+            </tr>
+          </table>
+      </xsl:template>
+</xsl:stylesheet>

+ 1 - 0
esp/scm/espscm.cmake

@@ -43,6 +43,7 @@ set ( ESPSCM_SRCS
       ws_configmgr.ecm
       ws_elk.ecm
       ws_store.ecm
+      ws_codesign.ecm
     )
 
 foreach ( loop_var ${ESPSCM_SRCS} )

+ 1 - 0
esp/scm/smcscm.cmake

@@ -36,6 +36,7 @@ set ( ESPSCM_SRCS
       ws_packageprocess.ecm
       ws_esdlconfig.ecm
       ws_elk.ecm
+      ws_codesign.ecm
     )
 
 foreach ( loop_var ${ESPSCM_SRCS} )

+ 44 - 0
esp/scm/ws_codesign.ecm

@@ -0,0 +1,44 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+ESPenum SigningMethodType : string
+{
+    gpg ("gpg")
+};
+
+ESPrequest SignRequest
+{
+    ESPenum SigningMethodType SigningMethod("gpg");
+    [cols(20)] string KeyIdentifier;
+    [password, cols(20)] string KeyPass;
+    [cols(70), rows(20)] string Text;
+};
+
+ESPresponse [exceptions_inline] SignResponse
+{
+    int RetCode;
+    string ErrMsg;
+    string SignedText;
+};
+
+ESPservice [auth_feature("CodeSignAccess:ACCESS"), version("1.0"), default_client_version("1.0"), exceptions_inline("./smc_xslt/exceptions.xslt")] ws_codesign
+{
+    ESPmethod [auth_feature("CodeSignAccess:FULL"), client_xslt("/esp/xslt/codesign.xslt")] Sign(SignRequest, SignResponse);
+};
+
+SCMexportdef(ws_codesign);
+
+SCMapi(ws_codesign) IClientws_codesign *createws_codesignClient();

+ 3 - 1
esp/scm/ws_workunits.ecm

@@ -1323,6 +1323,8 @@ ESPrequest [nil_remove] WUShowScheduledRequest
     string PushEventText("");
     [min_ver("1.51")] string State("");
     [min_ver("1.71")] string JobName("");
+    [min_ver("1.77")] string Owner("");
+    [min_ver("1.77")] string EventText("");
 };
 
 ESPStruct [nil_remove] ScheduledWU
@@ -2308,7 +2310,7 @@ ESPresponse [exceptions_inline] WUEclDefinitionActionResponse
 // ----------------------------------------------------------------------------------
 ESPservice [
     auth_feature("DEFERRED"), //This declares that the method logic handles feature level authorization
-    version("1.76"), default_client_version("1.76"), cache_group("ESPWsWUs"),
+    version("1.77"), default_client_version("1.77"), cache_group("ESPWsWUs"),
     noforms,exceptions_inline("./smc_xslt/exceptions.xslt"),use_method_name] WsWorkunits
 {
     ESPmethod [cache_seconds(60), resp_xsl_default("/esp/xslt/workunits.xslt")]     WUQuery(WUQueryRequest, WUQueryResponse);

+ 1 - 0
esp/services/CMakeLists.txt

@@ -39,3 +39,4 @@ endif()
 HPCC_ADD_SUBDIRECTORY (espcontrol "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_elk "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (ws_store "PLATFORM")
+HPCC_ADD_SUBDIRECTORY (ws_codesign "PLATFORM")

+ 74 - 0
esp/services/ws_codesign/CMakeLists.txt

@@ -0,0 +1,74 @@
+################################################################################
+#    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+################################################################################
+
+
+# Component: ws_codesign
+#####################################################
+# Description:
+# ------------
+#    Cmake Input File for ws_codesign
+#####################################################
+
+project( ws_codesign )
+
+include(${HPCC_SOURCE_DIR}/esp/scm/smcscm.cmake)
+
+set (    SRCS
+         ${HPCC_SOURCE_DIR}/esp/scm/ws_codesign.ecm
+         ${ESPSCM_GENERATED_DIR}/ws_codesign_esp.cpp
+         ./ws_codesignService.cpp
+         ./ws_codesignPlugin.cpp
+    )
+
+include_directories (
+         ${HPCC_SOURCE_DIR}/esp/bindings/http/platform
+         ${HPCC_SOURCE_DIR}/esp/esplib
+         ${HPCC_SOURCE_DIR}/esp/platform
+         ${HPCC_SOURCE_DIR}/system/jlib
+         ${HPCC_SOURCE_DIR}/common/environment
+         ${HPCC_SOURCE_DIR}/esp/services
+         ${HPCC_SOURCE_DIR}/common
+         ${HPCC_SOURCE_DIR}/system/security/securesocket
+         ${HPCC_SOURCE_DIR}/system/security/shared
+         ${HPCC_SOURCE_DIR}/system/include
+         ${HPCC_SOURCE_DIR}/common/remote
+         ${HPCC_SOURCE_DIR}/esp/clients
+         ${HPCC_SOURCE_DIR}/dali/base
+         ${HPCC_SOURCE_DIR}/common/dllserver
+         ${HPCC_SOURCE_DIR}/esp/bindings
+         ${HPCC_SOURCE_DIR}/esp/bindings/SOAP/xpp
+         ${HPCC_SOURCE_DIR}/esp/bindings/http/client
+         ${HPCC_SOURCE_DIR}/esp/http/platform
+         ${HPCC_SOURCE_DIR}/system/mp
+         ${HPCC_SOURCE_DIR}/system/xmllib
+         ${CMAKE_BINARY_DIR}
+         ${CMAKE_BINARY_DIR}/oss
+         ${CMAKE_BINARY_DIR}/esp/services/ws_codesign
+    )
+
+ADD_DEFINITIONS( -D_USRDLL )
+
+HPCC_ADD_LIBRARY( ws_codesign SHARED ${SRCS}  )
+add_dependencies (ws_codesign espscm )
+install ( TARGETS ws_codesign RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
+target_link_libraries ( ws_codesign
+         jlib
+         xmllib
+         esphttp
+         dalibase
+         environment
+         SMCLib
+    )

+ 64 - 0
esp/services/ws_codesign/ws_codesignPlugin.cpp

@@ -0,0 +1,64 @@
+
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+#pragma warning (disable : 4786)
+
+#ifndef WS_CODESIGN_API
+#define WS_CODESIGN_API DECL_EXPORT
+#endif //WS_CODESIGN_API
+
+#include "ws_codesign_esp.ipp"
+
+//ESP Bindings
+#include "httpprot.hpp"
+
+//ESP Service
+#include "ws_codesignService.hpp"
+
+#include "espplugin.hpp"
+
+extern "C"
+{
+
+ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
+{
+    if (strcmp(type, "ws_codesign")==0)
+    {
+        Cws_codesignEx* service = new Cws_codesignEx;
+        service->init(cfg, process, name);
+        return service;
+    }
+    return nullptr;
+}
+
+ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
+{
+    if (strcmp(type, "ws_codesignSoapBinding")==0)
+    {
+        return new Cws_codesignSoapBinding(cfg, name, process);
+    }
+
+    return nullptr;
+}
+
+ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
+{
+    return http_protocol_factory(name, type, cfg, process);
+}
+
+} // extern "C"

+ 110 - 0
esp/services/ws_codesign/ws_codesignService.cpp

@@ -0,0 +1,110 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+#include "ws_codesignService.hpp"
+#include "jutil.hpp"
+
+Cws_codesignEx::Cws_codesignEx()
+{
+}
+
+Cws_codesignEx::~Cws_codesignEx()
+{
+}
+
+void Cws_codesignEx::init(IPropertyTree *cfg, const char *process, const char *service)
+{
+    if(cfg == nullptr)
+        throw MakeStringException(-1, "Cannot initialize Cws_codesignEx, cfg is NULL");
+
+    StringBuffer xpath;
+    xpath.appendf("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]", process, service);
+    m_serviceCfg.setown(cfg->getPropTree(xpath.str()));
+
+    StringBuffer output, errmsg;
+    int ret = runExternalCommand(output, errmsg, "gpg --version", "");
+    if (ret != 0)
+        throw MakeStringException(-1, "Error running gpg: %s", errmsg.str());
+
+    isGPGv1 = strstr(output.str(), "gpg (GnuPG) 1.");
+}
+
+bool Cws_codesignEx::onSign(IEspContext &context, IEspSignRequest &req, IEspSignResponse &resp)
+{
+    resp.setRetCode(-1);
+
+    StringBuffer keyid(req.getKeyIdentifier());
+    keyid.trim();
+    const char* text = req.getText();
+    if (keyid.length() == 0 || !text || !*text)
+    {
+        resp.setErrMsg("Please provide both KeyIdentifier and Text");
+        return false;
+    }
+    if (strstr(keyid.str(), "\""))
+    {
+        resp.setErrMsg("Invalid KeyIdentifier");
+        return false;
+    }
+
+    StringBuffer cmd, output, errmsg;
+    if (isGPGv1)
+        cmd.appendf("gpg --list-secret-keys \"%s\"", keyid.str());
+    else
+        cmd.appendf("gpg --list-secret-keys --with-keygrip \"%s\"", keyid.str());
+    int ret = runExternalCommand(output, errmsg, cmd.str(), "");
+    if (ret != 0 || strstr(output.str(), keyid.str()) == nullptr)
+    {
+        resp.setErrMsg("Key not found");
+        return false;
+    }
+
+    if (!isGPGv1)
+    {
+        StringBuffer keygrip;
+        auto kgptr = strstr(output.str(), "Keygrip = ");
+        if (kgptr)
+            keygrip.append(40, kgptr+10);
+
+        if (keygrip.length() > 0)
+        {
+            output.clear();
+            errmsg.clear();
+            cmd.clear().appendf("gpg-connect-agent \"clear_passphrase --mode=normal %s\" /bye", keygrip.str());
+            runExternalCommand(output, errmsg, cmd.str(), "");
+        }
+    }
+
+    output.clear();
+    errmsg.clear();
+    cmd.clear().appendf("gpg --clearsign -u \"%s\" --yes --batch --passphrase-fd 0", keyid.str());
+    if (!isGPGv1)
+        cmd.append(" --pinentry-mode loopback");
+    VStringBuffer input("%s\n", req.getKeyPass());
+    input.append(text);
+    ret = runExternalCommand(output, errmsg, cmd.str(), input.str());
+    if (ret != 0 || output.length() == 0)
+    {
+        UERRLOG("gpg clearsign error: [%d] %s\nOutput: n%s", ret, errmsg.str(), output.str());
+        resp.setErrMsg("Failed to sign text, please check service log for details");
+        return false;
+    }
+
+    resp.setRetCode(0);
+    resp.setSignedText(output.str());
+    return true;
+}

+ 37 - 0
esp/services/ws_codesign/ws_codesignService.hpp

@@ -0,0 +1,37 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+#ifndef _WS_CODESIGNSERVICE_HPP_
+#define _WS_CODESIGNSERVICE_HPP_
+
+#include "ws_codesign_esp.ipp"
+
+class Cws_codesignEx : public Cws_codesign
+{
+private:
+    Owned<IPropertyTree> m_serviceCfg;
+    bool isGPGv1 = false;
+public:
+    IMPLEMENT_IINTERFACE
+
+    Cws_codesignEx();
+    virtual ~Cws_codesignEx();
+    virtual void init(IPropertyTree *cfg, const char *process, const char *service);
+    virtual bool onSign(IEspContext &context, IEspSignRequest &req, IEspSignResponse &resp);
+};
+
+#endif // _WS_CODESIGNSERVICE_HPP_

+ 1 - 1
esp/services/ws_store/ws_storeService.cpp

@@ -148,7 +148,7 @@ bool CwsstoreEx::onListStores(IEspContext &context, IEspListStoresRequest &req,
             store->setType(tree->queryProp("@type"));
             store->setDescription(tree->queryProp("@description"));
             store->setMaxValSize(tree->queryProp("@maxValSize"));
-            store->setIsDefault (!m_defaultStore.isEmpty() && strcasecmp(m_defaultStore.str(), tree->queryProp("@name"))==0);
+            store->setIsDefault (!m_defaultStore.isEmpty() && stricmp(m_defaultStore.str(), tree->queryProp("@name"))==0);
 
             storeinfos.append(*store.getClear());
         }

+ 17 - 14
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3512,13 +3512,13 @@ bool CWsWorkunitsEx::onWUResult(IEspContext &context, IEspWUResultRequest &req,
    return true;
 }
 
-void getScheduledWUs(IEspContext &context, const char *stateReq, const char *jobNameReq, const char *serverName, const char *eventName, IArrayOf<IEspScheduledWU> & results)
+void getScheduledWUs(IEspContext &context, WUShowScheduledFilters *filters, const char *serverName, IArrayOf<IEspScheduledWU> & results)
 {
     double version = context.getClientVersion();
     if (notEmpty(serverName))
     {
         Owned<IWorkUnitFactory> factory = getWorkUnitFactory(context.querySecManager(), context.queryUser());
-        Owned<IScheduleReader> reader = getScheduleReader(serverName, eventName);
+        Owned<IScheduleReader> reader = getScheduleReader(serverName, filters->eventName);
         Owned<IScheduleReaderIterator> it(reader->getIterator());
         while(it->isValidEventName())
         {
@@ -3547,9 +3547,13 @@ void getScheduledWUs(IEspContext &context, const char *stateReq, const char *job
                                 owner.set(cw->queryUser());
                             }
 
-                            if (!isEmptyString(jobNameReq) && (jobName.isEmpty() || !WildMatch(jobName.str(), jobNameReq, true)))
+                            if (!filters->jobName.isEmpty() && (jobName.isEmpty() || !WildMatch(jobName.str(), filters->jobName, true)))
                                 match =  false;
-                            else if (!isEmptyString(stateReq))
+                            else if (!filters->owner.isEmpty() && (owner.isEmpty() || !WildMatch(owner, filters->owner, true)))
+                                match =  false;
+                            else if (!filters->eventText.isEmpty() && (ieventText.isEmpty() || !WildMatch(ieventText, filters->eventText, true)))
+                                match =  false;
+                            else if (!filters->state.isEmpty())
                             {
                                 if (!cw)
                                     match =  false;
@@ -3565,7 +3569,7 @@ void getScheduledWUs(IEspContext &context, const char *stateReq, const char *job
                                         stateID = cw->getState();
                                         state.set(cw->queryStateDesc());
                                     }
-                                    if (!strieq(stateReq, state.str()))
+                                    if (!strieq(filters->state, state.str()))
                                         match =  false;
                                 }
                             }
@@ -3619,9 +3623,8 @@ bool CWsWorkunitsEx::onWUShowScheduled(IEspContext &context, IEspWUShowScheduled
 {
     try
     {
-        const char *clusterName = req.getCluster();
-        const char *eventName = req.getEventName();
-        const char *state = req.getState();
+        WUShowScheduledFilters filters(req.getCluster(), req.getState(), req.getOwner(),
+            req.getJobName(), req.getEventName(), req.getEventText());
 
         IArrayOf<IEspScheduledWU> results;
         if(notEmpty(req.getPushEventName()))
@@ -3643,11 +3646,11 @@ bool CWsWorkunitsEx::onWUShowScheduled(IEspContext &context, IEspWUShowScheduled
             if (isEmpty(iclusterName))
                 continue;
 
-            if(isEmpty(clusterName))
-                getScheduledWUs(context, state, req.getJobName(), iclusterName, eventName, results);
-            else if (strieq(clusterName, iclusterName))
+            if (filters.cluster.isEmpty())
+                getScheduledWUs(context, &filters, iclusterName, results);
+            else if (strieq(filters.cluster, iclusterName))
             {
-                getScheduledWUs(context, state, req.getJobName(), clusterName, eventName, results);
+                getScheduledWUs(context, &filters, filters.cluster, results);
                 resp.setClusterSelected(i+1);
             }
 
@@ -3664,8 +3667,8 @@ bool CWsWorkunitsEx::onWUShowScheduled(IEspContext &context, IEspWUShowScheduled
 
         bool first=false;
         StringBuffer Query("PageFrom=Scheduler");
-        appendUrlParameter(Query, "EventName", eventName, first);
-        appendUrlParameter(Query, "ECluster", clusterName, first);
+        appendUrlParameter(Query, "EventName", filters.eventName, first);
+        appendUrlParameter(Query, "ECluster", filters.cluster, first);
         resp.setQuery(Query.str());
     }
     catch(IException* e)

+ 10 - 0
esp/services/ws_workunits/ws_workunitsService.hpp

@@ -163,6 +163,16 @@ public:
     }
 };
 
+struct WUShowScheduledFilters
+{
+    StringAttr cluster, state, eventName, jobName, owner, eventText;
+
+    WUShowScheduledFilters(const char *_cluster, const char *_state, const char *_owner,
+        const char *_jobName, const char *_eventName, const char *_eventText)
+        : cluster(_cluster), state(_state), owner(_owner),
+        jobName(_jobName), eventName(_eventName), eventText(_eventText) {};
+};
+
 class CWsWorkunitsEx : public CWsWorkunits
 {
 public:

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

@@ -191,7 +191,7 @@ define([
 
             //  DOM functions  ---
             setDisabled: function (id, disabled, icon, disabledIcon) {
-                disabled === undefined ? disabled = false : disabled = true;
+                disabled = disabled || false;
                 var target = registry.byId(id);
                 if (target) {
                     target.set("disabled", disabled);

+ 2 - 0
esp/src/eclwatch/templates/EventScheduleWorkunitWidget.html

@@ -11,6 +11,8 @@
           <div id="${id}Filter" data-dojo-type="FilterDropDownWidget">
             <input id="${id}EventName" title="${i18n.EventName}:" name="EventName" colspan="2" data-dojo-props="trim: true, placeHolder:'${i18n.EventNamePH}'" data-dojo-type="dijit.form.TextBox" />
             <input id="${id}State" title="${i18n.State}:" name="State" colspan="2" data-dojo-props="trim: true, placeHolder:'${i18n.State}'" data-dojo-type="dijit.form.TextBox" />
+            <input id="${id}Owner" title="${i18n.Owner}:" name="Owner" colspan="2" data-dojo-props="trim: true, placeHolder:'${i18n.Owner}'" data-dojo-type="dijit.form.TextBox" />
+            <input id="${id}EventTextFilter" title="${i18n.EventText}:" name="EventText" colspan="2" data-dojo-props="trim: true, placeHolder:'${i18n.EventTextPH}'" data-dojo-type="dijit.form.TextBox" />
             <input id="${id}ClusterTargetSelect" title="${i18n.Cluster}:" name="Cluster" colspan="2" data-dojo-props="trim:true, placeHolder:'${i18n.ClusterPlaceholder}'" data-dojo-type="TargetSelectWidget" />
           </div>
           <span data-dojo-type="dijit.ToolbarSeparator"></span>

+ 1 - 0
initfiles/componentfiles/configschema/xsd/buildset.xml

@@ -71,6 +71,7 @@
           <AuthenticateFeature description="Access to ESDL configuration service" path="ESDLConfigAccess" resource="ESDLConfigAccess" service="ws_esdlconfig"/>
           <AuthenticateFeature description="Access to ELK integration service" path="WsELKAccess" resource="WsELKAccess" service="ws_elk"/>
           <AuthenticateFeature description="Access to WS STORE service" path="WsStoreAccess" resource="WsStoreAccess" service="ws_store"/>
+          <AuthenticateFeature description="Access to sign ECL code" path="CodeSignAccess" resource="CodeSignAccess" service="ws_codesign"/>
           <ProcessFilters>
             <Platform name="Windows">
               <ProcessFilter name="any">

+ 35 - 0
initfiles/componentfiles/configxml/@temp/esp_service_WsSMC.xsl

@@ -129,6 +129,10 @@ This is required by its binding with ESP service '<xsl:value-of select="$espServ
             <xsl:with-param name="bindingNode" select="$bindingNode"/>
             <xsl:with-param name="authNode" select="$authNode"/>
         </xsl:apply-templates>
+        <xsl:apply-templates select="." mode="ws_codesign">
+            <xsl:with-param name="bindingNode" select="$bindingNode"/>
+            <xsl:with-param name="authNode" select="$authNode"/>
+        </xsl:apply-templates>
     </xsl:template>
 
     <!-- WS-SMC -->
@@ -675,6 +679,37 @@ This is required by its binding with ESP service '<xsl:value-of select="$espServ
          <xsl:apply-templates select="@*[string(.) != '']|node()" mode="copy"/>
       </xsl:copy>
    </xsl:template>
+
+    <!-- ws_codesign -->
+    <xsl:template match="EspService" mode="ws_codesign">
+        <xsl:param name="bindingNode"/>
+        <xsl:param name="authNode"/>
+
+        <xsl:variable name="serviceType" select="'ws_codesign'"/>
+        <xsl:variable name="serviceName" select="concat($serviceType, '_', @name, '_', $process)"/>
+        <xsl:variable name="bindName" select="concat($serviceType, '_', $bindingNode/@name, '_', $process)"/>
+        <xsl:variable name="bindType" select="'ws_codesignSoapBinding'"/>
+        <xsl:variable name="servicePlugin">
+            <xsl:call-template name="defineServicePlugin">
+                <xsl:with-param name="plugin" select="'ws_codesign'"/>
+            </xsl:call-template>
+        </xsl:variable>
+        <EspService name="{$serviceName}" type="{$serviceType}" plugin="{$servicePlugin}">
+        </EspService>
+        <EspBinding name="{$bindName}" service="{$serviceName}" protocol="{$bindingNode/@protocol}" type="{$bindType}"
+            plugin="{$servicePlugin}" netAddress="0.0.0.0" port="{$bindingNode/@port}">
+            <xsl:call-template name="bindAuthentication">
+                <xsl:with-param name="bindingNode" select="$bindingNode"/>
+                <xsl:with-param name="authMethod" select="$authNode/@method"/>
+                <xsl:with-param name="service" select="'ws_codesign'"/>
+            </xsl:call-template>
+        </EspBinding>
+    </xsl:template>
+   <xsl:template match="*" mode="copy">
+      <xsl:copy>
+         <xsl:apply-templates select="@*[string(.) != '']|node()" mode="copy"/>
+      </xsl:copy>
+   </xsl:template>
    
    <xsl:template match="@*" mode="copy">
       <xsl:if test="string(.) != ''">

+ 4 - 0
initfiles/componentfiles/configxml/buildsetCC.xml.in

@@ -213,6 +213,10 @@
                         path="WsStoreAccess"
                         resource="WsStoreAccess"
                         service="ws_store"/>
+                    <AuthenticateFeature description="Access to sign ECL code"
+                        path="CodeSignAccess"
+                        resource="CodeSignAccess"
+                        service="ws_codesign"/>
                     <ProcessFilters>
                         <Platform name="Windows">
                             <ProcessFilter name="any">

+ 13 - 0
initfiles/etc/DIR_NAME/environment.xml.in

@@ -414,6 +414,11 @@
                          path="WsStoreAccess"
                          resource="WsStoreAccess"
                          service="ws_store"/>
+    <AuthenticateFeature authenticate="Yes"
+                         description="Access to sign ECL code"
+                         path="CodeSignAccess"
+                         resource="CodeSignAccess"
+                         service="ws_codesign"/>
     <Authenticate access="Read"
                   description="Root access to SMC service"
                   path="/"
@@ -735,6 +740,10 @@
                          path="WsStoreAccess"
                          resource="WsStoreAccess"
                          service="ws_store"/>
+    <AuthenticateFeature description="Access to sign ECL code"
+                         path="CodeSignAccess"
+                         resource="CodeSignAccess"
+                         service="ws_codesign"/>
     <ProcessFilters>
      <Platform name="Windows">
       <ProcessFilter name="any">
@@ -1115,6 +1124,10 @@
                           path="WsELKAccess"
                           resource="WsELKAccess"
                           service="ws_elk"/>
+     <AuthenticateFeature description="Access to sign ECL code"
+                          path="CodeSignAccess"
+                          resource="CodeSignAccess"
+                          service="ws_codesign"/>
      <ProcessFilters>
       <Platform name="Windows">
        <ProcessFilter name="any">

+ 2 - 2
plugins/h3/h3.cpp

@@ -222,9 +222,9 @@ ECL_H3_API void ECL_H3_CALL polyfill(ICodeContext *_ctx, bool &__isAllResult, si
         if (i == 0)
             west = east = row->lon;
         else if (west > row->lon)
-            west = lon;
+            west = row->lon;
         else if (east < row->lon)
-            east = lon;
+            east = row->lon;
     }
     if (east - west >= 180)
     {

+ 13 - 0
testing/regress/environment.xml.in

@@ -401,6 +401,11 @@
                          path="WsELKAccess"
                          resource="WsELKAccess"
                          service="ws_elk"/>
+    <AuthenticateFeature authenticate="Yes"
+                         description="Access to sign ECL code"
+                         path="CodeSignAccess"
+                         resource="CodeSignAccess"
+                         service="ws_codesign"/>
     <Authenticate access="Read"
                   description="Root access to SMC service"
                   path="/"
@@ -640,6 +645,10 @@
                          path="WsELKAccess"
                          resource="WsELKAccess"
                          service="ws_elk"/>
+    <AuthenticateFeature description="Access to sign ECL code"
+                         path="CodeSignAccess"
+                         resource="CodeSignAccess"
+                         service="ws_codesign"/>
     <ProcessFilters>
      <Platform name="Windows">
       <ProcessFilter name="any">
@@ -935,6 +944,10 @@
                           path="WsELKAccess"
                           resource="WsELKAccess"
                           service="ws_elk"/>
+    <AuthenticateFeature  description="Access to sign ECL code"
+                          path="CodeSignAccess"
+                          resource="CodeSignAccess"
+                          service="ws_codesign"/>
      <ProcessFilters>
       <Platform name="Windows">
        <ProcessFilter name="any">

+ 0 - 14
testing/unittests/jlibtests.cpp

@@ -1713,20 +1713,6 @@ public:
                         StringBuffer line;
                         if (!lineReader->readLine(line))
                         {
-    #ifdef _DEBUG
-                            printf("JlibIOTest::test readLines");
-                            for(const char *p = line.str(); *p; ++p)
-                            {
-                                switch(*p)
-                                {
-                                case '\n': printf("\\n"); break;
-                                case '\t': printf("\\t"); break;
-                                case '\r': printf("\\r"); break;
-                                default: putchar(*p);break;
-                                }
-                            }
-                            putchar('\n');
-    #endif
                             if (pEol==1)
                                 line.append(newlines[nl]);
                             readCrc.tally(line.length(), line.str());

+ 1 - 1
thorlcr/graph/thgraphmaster.cpp

@@ -248,7 +248,7 @@ void CSlaveMessageHandler::threadmain()
                             break;
                         }
                         CActivityBase *activity = element->queryActivity();
-                        if (activity && activity->needReInit())
+                        if (activity)
                             element->sentActInitData->set(slave, 0); // clear to permit serializeActivityInitData to resend
                         toSerialize.append(*LINK(element));
                     }