Project

General

Profile

Actions

Bug #12616

closed

${const.dollar} in generic method parameter leads to missing report

Added by François ARMAND almost 6 years ago. Updated almost 6 years ago.

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

Description

The following parameter on generic method "command_execution_result" leads to a missing:

[ ${const.dollar}(touch /tmp/constdollar && echo "enabled") = 'enabled' ]

I'm not sure what started it, but at some point, I also got an unexpected which make sense:

[ $(touch /tmp/constdollar && echo "enabled") = 'enabled' ]              Unexpected
[ ${const.dollar}(touch /tmp/constdollar && echo "enabled") = 'enabled' ] Missing

At least that means that we don't escape correctly the expected report in Rudder side or that the agent send the expanded value where it should not.

Actions #1

Updated by François ARMAND almost 6 years ago

I'm not sure what/where to correct that. On the one hand, it seems that the agent should send back the actual value. On the other hand, we are already doing a match on Rudder side between the value we saved as "expected" and the actual agent value, with for ex. variable replaced agent side.

Actually, what we really want is a report id, unique at component value level (with added rules to know if the value actually matches, and the mutliplicity of the reports in the case of a list being processed agent side).

So I propose to add a matching rule in Rudder server for `${const.dollar} == $`

Actions #2

Updated by François ARMAND almost 6 years ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
Actions #3

Updated by François ARMAND almost 6 years ago

There is something strange with "\" matching in the corresponding code.

In fact, the problem is not with the escape of ${const.dollar}, but with the incorrect escape of regex chars in the value. So () is interpreted as regex char, and are not used in the matches. We need to correctly escape them.

Actions #4

Updated by François ARMAND almost 6 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/1930
Actions #5

Updated by François ARMAND almost 6 years ago

The "\" thing was most likely to avoid having "\x" sequence being interpreted as a regex character classes. It was not sufficient at all to avoid problems, and it is not necessary anymore with correct quotation.

Actions #6

Updated by Rudder Quality Assistant almost 6 years ago

  • Assignee changed from Vincent MEMBRÉ to François ARMAND
Actions #7

Updated by François ARMAND almost 6 years ago

  • Status changed from Pending technical review to Pending release
Actions #8

Updated by Benoît PECCATTE almost 6 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.12, 4.2.6 and 4.3.1 which were released today.

Actions

Also available in: Atom PDF