Project

General

Profile

Actions

Bug #15167

closed

Invalid detection of empty strings for edition in Techniques

Added by Nicolas CHARLES over 5 years ago. Updated almost 5 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

In the classical agent, we detect if we are to edit files if string are not empty
So, we have a lot of

"edit_content"        not => strcmp("${content}", "");

(this is mostly due to historical reasons)

However, in recent version of agents, this fails if the content contains a variable, as promise is not evaluated

for instance

"str1" string => "${foo bar baz}";
"cmp1" expression => strcmp("${str1}", "");
"notcmp1" not => strcmp("${str1}", "");

neither cmp1 nor notcmp1 is defined

we should replace all not => strcmp by the opposite logic in all techniques/generic method


Subtasks 1 (0 open1 closed)

Bug #15170: When using a variable in CheckGenericFileContent v7.0, edition may failRejectedNicolas CHARLESActions

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #15640: Built in File Content technique does not warn about using cfengine variable syntax in file contentRejectedNicolas CHARLESActions
Actions

Also available in: Atom PDF