瀏覽代碼

HPCC-18296 WsWorkunits should ignore debug values that begin with '-'

Some eclcc options passed through eclcmd result in debug options that
begin with '-', these should not be added to the workunit as hash
options.  Fixing in the webservice acts as a good defensive measure
against bad debug option parameters.

Should consider changing how the eclcmd handles the two types of options
in the future.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Anthony Fishbeck 7 年之前
父節點
當前提交
ebb2c0abc4

+ 3 - 1
ecl/eclcmd/eclcmd_common.hpp

@@ -278,7 +278,9 @@ public:
             "   --snapshot,-sn=<label> Snapshot label to use from legacy ECL repository\n"
             "   --ecl-only             Send ECL query to HPCC as text rather than as a generated archive\n"
             "   --limit=<limit>        Sets the result limit for the query, defaults to 100\n"
-            "   -f<option>[=value]     Set an ECL option (equivalent to #option)\n"
+            "   -f<option>[=value]     Set an ECL language option (equivalent to #option)\n"
+            "   -f-<option>[=value]    Set an eclcc command line option (single '-')\n"
+            "   -f--<option>[=value]   Set an eclcc command line option (double '-')\n"
             "   -Dname=value           Override the definition of a global attribute 'name'\n"
             " eclcc options (everything following):\n"
         );

+ 1 - 1
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -3118,7 +3118,7 @@ void WsWuHelpers::submitWsWorkunit(IEspContext& context, IConstWorkUnit* cw, con
             IConstNamedValue &item = debugs->item(i);
             const char *name = item.getName();
             const char *value = item.getValue();
-            if (!name || !*name)
+            if (!name || !*name || *name=='-')
                 continue;
             if (!value)
             {

+ 4 - 2
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -558,7 +558,8 @@ bool CWsWorkunitsEx::onWUUpdate(IEspContext &context, IEspWUUpdateRequest &req,
         ForEachItemIn(di, req.getDebugValues())
         {
             IConstDebugValue& item = req.getDebugValues().item(di);
-            if (notEmpty(item.getName()))
+            const char *debugName = item.getName();
+            if (notEmpty(debugName) && *debugName!='-')
                 wu->setDebugValue(item.getName(), item.getValue(), true);
         }
 
@@ -1175,7 +1176,8 @@ bool CWsWorkunitsEx::onWUSyntaxCheckECL(IEspContext &context, IEspWUSyntaxCheckR
         ForEachItemIn(di, req.getDebugValues())
         {
             IConstDebugValue& item=req.getDebugValues().item(di);
-            if(notEmpty(item.getName()))
+            const char *debugName = item.getName();
+            if (notEmpty(debugName) && *debugName!='-')
                 wu->setDebugValue(item.getName(), item.getValue(), true);
         }