OpenSCAP/scap-security-guide — pull request #286 by iankko (2014-10-01 15:29:29+00:00)
Title: [RHEL/6, RHEL/7] Fix Limit Password Reuse remediation script

It's broken currently, since /etc/pam.d/system-auth contains more than just one space in corresponding pam_unix.so row, e.g. has the form of:
```
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
```
So current form replacing just one space between can't fix this. Besides that, it isn't using BRE syntax, which is required for sed (e.g. [\s] is invalid expression since:
```
$ echo "foo bar" | grep '[\s]' | wc -l
0
```
versus
```
$ echo "foo bar" | grep '\s' | wc -l
1
```
)

Yet since ```+``` character loses it's special meaning in BRE, we need to escape it with ```\+``` it to have the special meaning:
https://www.gnu.org/software/sed/manual/html_node/Regular-Expressions.html#Regular-Expressions

Testing report:
------------------
Tested on both of RHEL-6 & RHEL-7 and works fine (state before patch returns 'error' result, state after patch returns 'fixed' result & the remediation is applied into /etc/pam.d/system-auth{,-ac} as expected).

Please review.

Thanks, Jan.