diff -ruN smeserver-password-1.2.0.old/root/etc/e-smith/db/configuration/defaults/passwordhistory/type smeserver-password-1.2.0/root/etc/e-smith/db/configuration/defaults/passwordhistory/type --- smeserver-password-1.2.0.old/root/etc/e-smith/db/configuration/defaults/passwordhistory/type 1970-01-01 02:00:00.000000000 +0200 +++ smeserver-password-1.2.0/root/etc/e-smith/db/configuration/defaults/passwordhistory/type 2021-11-30 21:26:02.000000000 +0200 @@ -0,0 +1 @@ +0 diff -ruN smeserver-password-1.2.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/passwordopt smeserver-password-1.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/passwordopt --- smeserver-password-1.2.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/passwordopt 2021-12-01 02:33:45.462951808 +0200 +++ smeserver-password-1.2.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/passwordopt 2021-12-01 02:18:50.000000000 +0200 @@ -40,6 +40,21 @@ + PASSWORD_HISTORY_DESC + + Password history + Password history prevents users from reusing passwords (select 0 to disable) + ]]> + + + + + LABEL_PASSWORD_HISTORY + Number of unique passwords to remember + + + LABEL_AGEING_ACTIVE Activate password aging diff -ruN smeserver-password-1.2.0.old/root/etc/e-smith/templates-custom/etc/pam.d/system-auth/40password smeserver-password-1.2.0/root/etc/e-smith/templates-custom/etc/pam.d/system-auth/40password --- smeserver-password-1.2.0.old/root/etc/e-smith/templates-custom/etc/pam.d/system-auth/40password 1970-01-01 02:00:00.000000000 +0200 +++ smeserver-password-1.2.0/root/etc/e-smith/templates-custom/etc/pam.d/system-auth/40password 2021-12-01 02:12:05.000000000 +0200 @@ -0,0 +1,18 @@ +{ + my $hist = $passwordhistory || '0'; + return unless $hist ne '0'; + $OUT .= "password requisite pam_pwhistory.so remember=$hist enforce_for_root authtok_type=UNIX debug\n"; + $OUT .= "password sufficient pam_unix.so nullok md5 shadow try_first_pass use_authtok audit"; +} +{ + my $hist = $passwordhistory || '0'; + return unless $hist eq '0'; + $OUT .= "password sufficient pam_unix.so nullok md5 shadow"; +} +{ + my $status = $ldap{Authentication} || 'disabled'; + return unless $status eq 'enabled'; + $OUT .= "password sufficient pam_ldap.so use_authtok"; +} +password required pam_deny.so + diff -ruN smeserver-password-1.2.0.old/root/etc/e-smith/web/functions/passwordopt smeserver-password-1.2.0/root/etc/e-smith/web/functions/passwordopt --- smeserver-password-1.2.0.old/root/etc/e-smith/web/functions/passwordopt 2021-12-01 02:33:45.463951819 +0200 +++ smeserver-password-1.2.0/root/etc/e-smith/web/functions/passwordopt 2021-12-01 01:14:32.000000000 +0200 @@ -41,6 +41,17 @@ + PASSWORD_HISTORY_DESC + + + + + + + PASSWORD_AGEING_DESC diff -ruN smeserver-password-1.2.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm smeserver-password-1.2.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm --- smeserver-password-1.2.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm 2021-12-01 02:33:45.464951830 +0200 +++ smeserver-password-1.2.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm 2021-11-30 22:11:09.000000000 +0200 @@ -64,6 +64,11 @@ return $status; } +sub get_passwordhistory_value +{ +my $status = get_prop('','passwordhistory','type') || '0'; +return $status; +} sub get_Admin_value @@ -171,6 +176,9 @@ $key->set_prop('PwdWarn', $q->param('PwdWarn')); $key->set_prop('LockAccount', $q->param('LockAccount')); $key->set_prop('DateReset', $q->param('DateReset')); +$db->set_value('passwordhistory', $q->param('passwordhistory')); + +system ("/sbin/e-smith/expand-template", "/etc/pam.d/system-auth"); use CGI; my $cgi = CGI->new;