Skip to content

Commit

Permalink
Fix PCRE_ERROR_MATCHLIMIT in PASS_MAX_DAYS
Browse files Browse the repository at this point in the history
Fix memory limit match error when scanning an actual /etc/login.defs
file, which is much larger than the test files.

Removed the single line behavior and added tests to check whether it is
mathing the last PASS_MAX_DAYS.
  • Loading branch information
yuumasato committed Sep 17, 2020
1 parent 675b071 commit e506029
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<ind:textfilecontent54_object id="object_last_pass_max_days_from_etc_login_defs" version="1">
<!-- Read whole /etc/login.defs as single line so we can retrieve last PASS_MAX_DAYS directive occurrence -->
<ind:behaviors singleline="true" />
<ind:filepath>/etc/login.defs</ind:filepath>
<!-- Retrieve last (uncommented) occurrence of PASS_MAX_DAYS directive -->
<ind:pattern operation="pattern match">^(?:.*\n)*\s*[^#]*(PASS_MAX_DAYS\s+\d+)\s*\n</ind:pattern>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_stig

rm -f /etc/login.defs
echo "PASS_MAX_DAYS 60" > /etc/login.defs
echo "PASS_MAX_DAYS 30" >> /etc/login.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# profiles = xccdf_org.ssgproject.content_profile_stig

rm -f /etc/login.defs
echo "PASS_MAX_DAYS 60" > /etc/login.defs
echo "PASS_MAX_DAYS 120" >> /etc/login.defs

0 comments on commit e506029

Please sign in to comment.