Project

General

Profile

Bug #11795

Escaping variable in a method call fails

Added by Nicolas CHARLES 7 months ago. Updated 5 months ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Target version (plugin):
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Getting started - demo | first install | level 1 Techniques
Effort required:
Priority:
68

Description

Following code

      # match a line starting like the key something
      "$(index)\s*=.*" 
      edit_field => col("=","2","$($(tab)[$(sectionName)][$(index)])","set"),
      select_region => INI_section(escape("$(sectionName)")),
      classes => results("bundle", "set_variable_values_ini_not_$(cindex[$(index)])"),
      ifvarclass => "edit_$(cindex[$(index)])";

fails to evaluate correctly the name of the section with our modified cfengine agent
With vanilla 3.10.2 agent, it works flawlessly

Workaround can be to use temporary var, but it's a huge job to rewrite everything, and other methods are also likely to fail


Related issues

Related to ncf - Bug #11792: Generic method file_ensure_key_value_present_in_ini_section.cf has leaky classes, resulting in invalid resultsReleased

Associated revisions

Revision a3abf859 (diff)
Added by Alexis MOUSSET 6 months ago

Fixes #11795: Escaping variable in a method call fails

History

#1 Updated by Nicolas CHARLES 7 months ago

  • Project changed from ncf to Rudder
  • Category set to Agent

#2 Updated by Nicolas CHARLES 7 months ago

prefixing the sectionName by set_variable_values_ini.sectionName is also a valid workaround

#3 Updated by Benoît PECCATTE 7 months ago

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Getting started - demo | first install | level 1 Techniques
  • Priority changed from 0 to 70

Because of the performance patch

#4 Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 4.1.9 to 4.1.10

#5 Updated by Alexis MOUSSET 6 months ago

  • Status changed from New to In progress

#6 Updated by Alexis MOUSSET 6 months ago

  • Status changed from In progress to New
  • Target version changed from 4.1.10 to 4.3.0~beta1

#7 Updated by Alexis MOUSSET 6 months ago

  • Status changed from New to In progress

#8 Updated by Alexis MOUSSET 6 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Alexis MOUSSET to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/ncf/pull/672

#9 Updated by Alexis MOUSSET 6 months ago

We need to match for compatibility with agent that do not have the (still unfinished) fix.

#10 Updated by Alexis MOUSSET 6 months ago

  • Status changed from Pending technical review to Pending release

#11 Updated by Vincent MEMBRÉ 5 months ago

  • Parent task deleted (#11792)
  • Priority changed from 70 to 68

#12 Updated by Vincent MEMBRÉ 5 months ago

  • Related to Bug #11792: Generic method file_ensure_key_value_present_in_ini_section.cf has leaky classes, resulting in invalid results added

#13 Updated by Vincent MEMBRÉ 5 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.3.0~beta1 which was released today.

Also available in: Atom PDF