[PATCH] typo in accounts_password_warn_age_login_defs.sh

Trayer, Jeb D CTR Jeb.D.Trayer at uscg.mil
Fri Nov 22 14:10:03 UTC 2013


Well here goes, first time I've ever made an attempt to submit a patch to any open source project!

I was testing some of the generated fix content and ran into an error when running user utilities(useradd/userdel) that used read /etc/login.defs, "configuration error - unknown item 'PASS_WARN_DAYS' (notify administrator)".

Looking at /etc/login.defs looks like "PASS_WARN_DAYS     7" was added to the end of login.defs, and I belive this should have been PASS_WARN_AGE.  Looks like this was just a typo in the RHEL6/input/fixes/bash/accounts_password_warn_age_login.defs.sh, change PASS_WARN_DAYS to PASS_WARN_AGE, remade the guide, generated new fix content and ran it, and looks like /etc/login.defs is good, and error didn't return when running any user utils on RHEL 6.4

Hopefully I did everything correctly, if not please let me know.  Also I won't be able to push anything to the git repo, so if this patch is good, if someone that can push the patch would, it would be appreciated.

Thanks!

Jeb Trayer, CTR
USCG Operations System Center
Jeb.D.Trayer at uscg.mil

Signed-off-by: Jeb Trayer <jeb.d.trayer at uscg.mil>
---
 .../bash/accounts_password_warn_age_login_defs.sh  |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/RHEL6/input/fixes/bash/accounts_password_warn_age_login_defs.sh b/RHEL6/input/fixes/bash/accounts_password_warn_age_login_defs.sh
index 250b141..83ba76e 100644
--- a/RHEL6/input/fixes/bash/accounts_password_warn_age_login_defs.sh
+++ b/RHEL6/input/fixes/bash/accounts_password_warn_age_login_defs.sh
@@ -1,8 +1,8 @@
 source ./templates/support.sh
 populate var_accounts_password_warn_age_login_defs
 
-grep -q ^PASS_WARN_DAYS /etc/login.defs && \
-  sed -i "s/PASS_WARN_DAYS.*/PASS_WARN_DAYS     $var_accounts_password_warn_age_login_defs/g" /etc/login.defs
+grep -q ^PASS_WARN_AGE /etc/login.defs && \
+  sed -i "s/PASS_WARN_AGE.*/PASS_WARN_AGE     $var_accounts_password_warn_age_login_defs/g" /etc/login.defs
 if ! [ $? -eq 0 ]; then
-    echo "PASS_WARN_DAYS      $var_accounts_password_warn_age_login_defs" >> /etc/login.defs
+    echo "PASS_WARN_AGE      $var_accounts_password_warn_age_login_defs" >> /etc/login.defs
 fi
-- 
1.7.1


More information about the scap-security-guide mailing list