-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
No
-
Low
-
rhel-security-compliance
-
5
-
False
-
False
-
-
No
-
Red Hat Enterprise Linux
-
None
-
None
-
None
-
Unspecified Release Note Type - Unknown
-
Unspecified
-
Unspecified
-
Unspecified
-
None
This was initially brought Upstream through Issue 13080 but nobody provided any tip after several months.
This is related to xccdf_org.ssgproject.content_value_login_banner_text.
Due to folding and formatting, spaces have to be specified in the banner as [\s\n]+ and this is totally understandable.
However it's unclear how to specify newline: \n doesn't work in particular.
There is a Jinja macro (shared/macros/10-bash.jinja) which replaces the escaped newline into a newline which uses a sed line:
{{# Strips newline or newline escape sequence regex #}} {{% macro bash_deregexify_banner_newline(banner_var_name, newline) -%}} {{{ banner_var_name }}}=$(echo "${{{ banner_var_name }}}" | sed 's/(?:\[\\n\]+|(?:\\\\n)+)/{{{ newline }}}/g') {{%- endmacro %}}
The above sed line doesn't work at all for multiple reasons, checking the GNU sed manual :
- ?: operator is not a valid operator
- the pipe used to or the pattern should be escaped (|)
IMHO the following sed may be used instead: s/\\n|[\\n]/\n/g
This would match using \n or [\n].
Could you please explain what is expected from the user here?
- links to