Project

General

Profile

Actions

Bug #11087

closed

File content (key/value format) technique allows white space before separator but not after it

Added by Hamlyn Mootoo over 7 years ago. Updated about 7 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Very Small
Priority:
65
Name check:
Fix check:
Regression:

Description

It seems that a directive created from the File content(key/value format) allows any amount of space and tab characters after the keyword and BEFORE the separator but not after it, or else it considers it non-compliant. For example:

If the keyword is COLOR, the separator is an equals sign (=), and the value is BLUE, then we have:

\t=tab character

COLOR=BLUE (result compliant)
COLOR =BLUE (result compliant)
COLOR =BLUE (result compliant)
COLOR\t=BLUE (result compliant)
COLOR\t =BLUE (result compliant)
COLOR\t \t=BLUE (result compliant)
COLOR \t =BLUE (result compliant)
COLOR \t=BLUE (result compliant)

COLOR= BLUE (result non-compliant)
COLOR= BLUE (result non-compliant)
COLOR=\tBLUE (result non-compliant)
COLOR= \tBLUE (result non-compliant)
COLOR=\t BLUE (result non-compliant)
COLOR=\t \tBLUE (result non-compliant)
COLOR= \t BLUE (result non-compliant)

Basically, any whitespace between the separator and the value causes the key/value pair to be considered non matching.

This is also true when the separator itself is a space as in the use of the variable ${ncf_const.s}

This makes it very difficult to determine whether a key/value pair is already compliant from an audit perspective, since the amount of whitespace before and after the separator doesn't matter for a lot of config files in linux, and is considered valid.

In some cases however, I could see that for some files, any whitespace before or after the separator should be considered non-compliant.

As a suggestion, you could add a checkbox to indicate a STRICT match (that is no whitespace allowed on either side), that would override a reasonable default of any amount of whitespace allowed on either side of the separator (especially when the separator itself is a space character).


Subtasks 1 (0 open1 closed)

Bug #11371: Add missing tests in branch 4.1 for parent ticketReleasedAlexis MoussetActions

Related issues 1 (0 open1 closed)

Related to Rudder - User story #11346: Create a new generic method to set key/value with option to define if it is strict or notReleasedAlexis MoussetActions
Actions

Also available in: Atom PDF