Project

General

Profile

Actions

Bug #15167

closed

Invalid detection of empty strings for edition in Techniques

Added by Nicolas CHARLES over 4 years ago. Updated over 4 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 #1

Updated by Nicolas CHARLES over 4 years ago

Techniques to modify:
fileDistribution/checkGenericFileContent/8.0/checkGenericFileContent.st
fileDistribution/fileTemplate/1.0/fileTemplate.st
systemSettings/process/services/1.1/services.st
systemSettings/process/servicesManagement/3.0/servicesManagement.st
systemSettings/userManagement/sudoParameters/3.2/sudoParameters.st
systemSettings/misc/variableFromJsonFile/3.0/variableFromJsonFile.st
systemSettings/misc/variableFromJsonFile/2.0/variableFromJsonFile.st
applications/zmdPackageManagerSettings/3.0/zmdPackageManagerSettings.st

Actions #2

Updated by Nicolas CHARLES over 4 years ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
Actions #3

Updated by Nicolas CHARLES over 4 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Alexis Mousset
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1459
Actions #4

Updated by Nicolas CHARLES over 4 years ago

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

Updated by Janos Mattyasovszky over 4 years ago

  • Related to Bug #15640: Built in File Content technique does not warn about using cfengine variable syntax in file content added
Actions #6

Updated by François ARMAND over 4 years ago

  • Fix check changed from To do to Checked
Actions #7

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 5.0.13 which was released today.

Actions

Also available in: Atom PDF