Bug #12616
closed${const.dollar} in generic method parameter leads to missing report
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.
Updated by François ARMAND over 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} == $`
Updated by François ARMAND over 6 years ago
- Status changed from New to In progress
- Assignee set to François ARMAND
Updated by François ARMAND over 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.
Updated by François ARMAND over 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
Updated by François ARMAND over 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.
Updated by Rudder Quality Assistant over 6 years ago
- Assignee changed from Vincent MEMBRÉ to François ARMAND
Updated by François ARMAND over 6 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|97a9e63d4060e36e618c952a7bc68f3c9504dbcf.
Updated by Benoît PECCATTE over 6 years ago
- Status changed from Pending release to Released