1 |
jpp |
1.1 |
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 |
2 |
|
|
--- smeserver-password-1.2.0.old/root/etc/e-smith/db/configuration/defaults/passwordhistory/type 1970-01-01 02:00:00.000000000 +0200 |
3 |
|
|
+++ smeserver-password-1.2.0/root/etc/e-smith/db/configuration/defaults/passwordhistory/type 2021-11-30 21:26:02.000000000 +0200 |
4 |
|
|
@@ -0,0 +1 @@ |
5 |
|
|
+0 |
6 |
|
|
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 |
7 |
|
|
--- 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 |
8 |
|
|
+++ 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 |
9 |
|
|
@@ -40,6 +40,21 @@ |
10 |
|
|
</entry> |
11 |
|
|
|
12 |
|
|
<entry> |
13 |
|
|
+ <base>PASSWORD_HISTORY_DESC</base> |
14 |
|
|
+ <trans> |
15 |
|
|
+ <![CDATA[ |
16 |
|
|
+ <h2>Password history</h2> |
17 |
|
|
+ Password history prevents users from reusing passwords (select 0 to disable) |
18 |
|
|
+ ]]> |
19 |
|
|
+ </trans> |
20 |
|
|
+ </entry> |
21 |
|
|
+ |
22 |
|
|
+ <entry> |
23 |
|
|
+ <base>LABEL_PASSWORD_HISTORY</base> |
24 |
|
|
+ <trans>Number of unique passwords to remember</trans> |
25 |
|
|
+ </entry> |
26 |
|
|
+ |
27 |
|
|
+ <entry> |
28 |
|
|
<base>LABEL_AGEING_ACTIVE</base> |
29 |
|
|
<trans>Activate password aging</trans> |
30 |
|
|
</entry> |
31 |
|
|
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 |
32 |
|
|
--- 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 |
33 |
|
|
+++ 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 |
34 |
|
|
@@ -0,0 +1,18 @@ |
35 |
|
|
+{ |
36 |
|
|
+ my $hist = $passwordhistory || '0'; |
37 |
|
|
+ return unless $hist ne '0'; |
38 |
|
|
+ $OUT .= "password requisite pam_pwhistory.so remember=$hist enforce_for_root authtok_type=UNIX debug\n"; |
39 |
|
|
+ $OUT .= "password sufficient pam_unix.so nullok md5 shadow try_first_pass use_authtok audit"; |
40 |
|
|
+} |
41 |
|
|
+{ |
42 |
|
|
+ my $hist = $passwordhistory || '0'; |
43 |
|
|
+ return unless $hist eq '0'; |
44 |
|
|
+ $OUT .= "password sufficient pam_unix.so nullok md5 shadow"; |
45 |
|
|
+} |
46 |
|
|
+{ |
47 |
|
|
+ my $status = $ldap{Authentication} || 'disabled'; |
48 |
|
|
+ return unless $status eq 'enabled'; |
49 |
|
|
+ $OUT .= "password sufficient pam_ldap.so use_authtok"; |
50 |
|
|
+} |
51 |
|
|
+password required pam_deny.so |
52 |
|
|
+ |
53 |
|
|
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 |
54 |
|
|
--- smeserver-password-1.2.0.old/root/etc/e-smith/web/functions/passwordopt 2021-12-01 02:33:45.463951819 +0200 |
55 |
|
|
+++ smeserver-password-1.2.0/root/etc/e-smith/web/functions/passwordopt 2021-12-01 01:14:32.000000000 +0200 |
56 |
|
|
@@ -41,6 +41,17 @@ |
57 |
|
|
</field> |
58 |
|
|
|
59 |
|
|
<field type="literal"> |
60 |
|
|
+ <description>PASSWORD_HISTORY_DESC</description> |
61 |
|
|
+ </field> |
62 |
|
|
+ |
63 |
|
|
+<field type="select" |
64 |
|
|
+ id="passwordhistory" |
65 |
|
|
+ options="0,3,5,10,20,50,100" |
66 |
|
|
+ value="get_passwordhistory_value()"> |
67 |
|
|
+ <label>LABEL_PASSWORD_HISTORY</label> |
68 |
|
|
+ </field> |
69 |
|
|
+ |
70 |
|
|
+ <field type="literal"> |
71 |
|
|
<description>PASSWORD_AGEING_DESC</description> |
72 |
|
|
</field> |
73 |
|
|
|
74 |
|
|
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 |
75 |
|
|
--- 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 |
76 |
|
|
+++ smeserver-password-1.2.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/passwordopt.pm 2021-11-30 22:11:09.000000000 +0200 |
77 |
|
|
@@ -64,6 +64,11 @@ |
78 |
|
|
return $status; |
79 |
|
|
} |
80 |
|
|
|
81 |
|
|
+sub get_passwordhistory_value |
82 |
|
|
+{ |
83 |
|
|
+my $status = get_prop('','passwordhistory','type') || '0'; |
84 |
|
|
+return $status; |
85 |
|
|
+} |
86 |
|
|
|
87 |
|
|
|
88 |
|
|
sub get_Admin_value |
89 |
|
|
@@ -171,6 +176,9 @@ |
90 |
|
|
$key->set_prop('PwdWarn', $q->param('PwdWarn')); |
91 |
|
|
$key->set_prop('LockAccount', $q->param('LockAccount')); |
92 |
|
|
$key->set_prop('DateReset', $q->param('DateReset')); |
93 |
|
|
+$db->set_value('passwordhistory', $q->param('passwordhistory')); |
94 |
|
|
+ |
95 |
|
|
+system ("/sbin/e-smith/expand-template", "/etc/pam.d/system-auth"); |
96 |
|
|
|
97 |
|
|
use CGI; |
98 |
|
|
my $cgi = CGI->new; |