Project

General

Profile

Actions

Bug #10575

closed

putting a double quote in a technique in the "class" parameter generate an invalid rudder-reporting file for the agent

Added by Vincent MEMBRÉ over 7 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Technique editor
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

When using a double quote " in the class parameter of a method call and having a condition on this method call, we generate a rudder-reporing file invalid for the agent (syntax error)

The quote is not escaped in the rudder-reporting file breaking a call to logger.

That double quote should be automatically escaped.

quick example:

  • Create a Technique with a "command execution" method.
  • as command put : /bin/echo "test" > /tmp/test
  • as condition add : linux

Save and it will generate a rudder-reporting file for Rudder which will be invalid

When applying it in Rudder, you will get a syntax error message:

Stderr: '/var/rudder/cfengine-community/inputs.new/test/1.0/rudder_reporting.cf:12:79: error: syntax error
"dummy_report" usebundle => log_rudder("Command execution /bin/echo "test" > /tmp/echo if any.linux", "command_execution__bin_echo__test_____tmp_echo", "${class_prefix}", @{args});
^
/var/rudder/cfengine-community/inputs.new/test/1.0/rudder_reporting.cf:12:79: error: Expected ',', wrong input 'test'
"dummy_report" usebundle => log_rudder("Command execution /bin/echo "test" > /tmp/echo if any.linux", "command_execution__bin_echo__test_____tmp_echo", "${class_prefix}", @{args});
^
/var/rudder/cfengine-community/inputs.new/test/1.0/rudder_reporting.cf:12:106: error: Invalid function argument, wrong input '" > /tmp/echo if any.linux"'
"dummy_report" usebundle => log_rudder("Command execution /bin/echo "test" > /tmp/echo if any.linux", "command_execution__bin_echo__test_____tmp_echo", "${class_prefix}", @{args});
^

Subtasks 2 (0 open2 closed)

Bug #10603: Broken testsReleasedAlexis MoussetActions
Bug #10604: Broken testsReleasedAlexis MoussetActions
Actions #1

Updated by Vincent MEMBRÉ over 7 years ago

  • Category set to Technique editor - API
  • Assignee set to Vincent MEMBRÉ
  • Target version set to 0.x
Actions #2

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from New to In progress
Actions #3

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to Alexis Mousset
  • Pull Request set to https://github.com/Normation/ncf/pull/569
Actions #4

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset commit:384c6e64227bed613a1ded1f87d85429762085ec.

Actions #5

Updated by Vincent MEMBRÉ about 7 years ago

  • Status changed from Pending release to Released
Actions #6

Updated by Alexis Mousset over 2 years ago

  • Target version changed from 0.x to ncf-0.x
Actions #7

Updated by Alexis Mousset over 2 years ago

  • Project changed from 41 to Rudder
  • Category changed from Technique editor - API to Web - Technique editor
Actions

Also available in: Atom PDF