Skip to content

Commit

Permalink
fix digits class name case
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpil2002 committed Mar 16, 2022
1 parent 49d1195 commit eff356a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 407 deletions.
10 changes: 5 additions & 5 deletions src/sonic-host-services-data/templates/common-password.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@

{% if passw_policies %}
{% if passw_policies['state'] == 'enabled' %}
password requisite pam_cracklib.so retry=3 maxrepeat=0 {% if passw_policies['len_min'] %}minlen={{passw_policies['len_min']}}{% endif %} {% if passw_policies['upper_class'] %} ucredit=-1 {% endif %} {% if passw_policies['lower_class'] %} lcredit=-1 {% endif %} {% if passw_policies['digit_class'] %} dcredit=-1 {% endif %} {% if passw_policies['special_class'] %} ocredit=-1 {% endif %} {% if passw_policies['reject_user_passw_match'] %} reject_username {% endif %} enforce_for_root
password requisite pam_cracklib.so retry=3 maxrepeat=0 {% if passw_policies['len_min'] %}minlen={{passw_policies['len_min']}}{% endif %} {% if passw_policies['upper_class'] %}ucredit=-1{% endif %} {% if passw_policies['lower_class'] %}lcredit=-1{% endif %} {% if passw_policies['digits_class'] %}dcredit=-1{% endif %} {% if passw_policies['special_class'] %}ocredit=-1{% endif %} {% if passw_policies['reject_user_passw_match'] %}reject_username{% endif %} enforce_for_root

password required pam_pwhistory.so {% if passw_policies['history_ctr'] %}remember={{passw_policies['history_ctr']}}{% endif %} use_authtok
password required pam_pwhistory.so {% if passw_policies['history_cnt'] %}remember={{passw_policies['history_cnt']}}{% endif %} use_authtok
{% endif %}
{% endif %}

password [success=1 default=ignore] pam_unix.so obscure yescrypt
password [success=1 default=ignore] pam_unix.so obscure yescrypt
# here's the fallback if no module succeeds
password requisite pam_deny.so
password requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password required pam_permit.so
password required pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config
4 changes: 2 additions & 2 deletions src/sonic-host-services/scripts/hostcfgd
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ class AaaCfg(object):
data['lower_class'] = is_true(data['lower_class'])
if 'upper_class' in data:
data['upper_class'] = is_true(data['upper_class'])
if 'digit_class' in data:
data['digit_class'] = is_true(data['digit_class'])
if 'digits_class' in data:
data['digits_class'] = is_true(data['digits_class'])
if 'special_class' in data:
data['special_class'] = is_true(data['special_class'])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ def test_hostcfgd_passwh_classes(self, test_name, test_data):
None
"""

self.check_config(test_name, test_data, "enable_digit_class")
self.check_config(test_name, test_data, "enable_digits_class")
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
# here are the per-package modules (the "Primary" block)


password [success=1 default=ignore] pam_unix.so obscure yescrypt
password [success=1 default=ignore] pam_unix.so obscure yescrypt
# here's the fallback if no module succeeds
password requisite pam_deny.so
password requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password required pam_permit.so
password required pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config

This file was deleted.

Loading

0 comments on commit eff356a

Please sign in to comment.