Project

General

Profile

Bug #15167

Invalid detection of empty strings for edition in Techniques

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

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
User visibility:
Effort required:
Priority:
0

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

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

Related issues

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

Associated revisions

Revision a686e648 (diff)
Added by Nicolas CHARLES 5 months ago

Fixes #15167: Invalid detection of empty strings for edition in Techniques

History

#1

Updated by Nicolas CHARLES 5 months 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

#2

Updated by Nicolas CHARLES 5 months ago

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

Updated by Nicolas CHARLES 5 months 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
#4

Updated by Nicolas CHARLES 5 months ago

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

Updated by Janos Mattyasovszky 3 months ago

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

Updated by Vincent MEMBRÉ 2 months ago

  • Status changed from Pending release to Released

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

Also available in: Atom PDF