Projet

Général

Profil

common-password.patch

patch pour les versions supportées antérieures à 2.7.1 - Benjamin Bohard, 06/06/2019 11:20

Télécharger (1,77 ko)

Voir les différences:

modif/common-password 2019-06-06 11:19:05.027139848 +0200
22 22
# See the pam_unix manpage for other options.
23 23

  
24 24
%if %%check_passwd == 'oui'
25
%set %%pwd_lengths = []
25 26
%if %%check_passwd_min_len_one_type == 0
26 27
%set %%min_len_one_type='disabled'
27 28
%else
28 29
%set %%min_len_one_type=%%check_passwd_min_len_one_type
30
%silent %%pwd_lengths.append(%%check_passwd_min_len_one_type)
29 31
%end if
30 32
%if %%check_passwd_min_len_two_type == 0
31 33
%set %%min_len_two_type='disabled'
32 34
%else
33 35
%set %%min_len_two_type=%%check_passwd_min_len_two_type
36
%silent %%pwd_lengths.append(%%check_passwd_min_len_two_type)
34 37
%end if
35 38
%if %%check_passwd_min_len_three_type == 0
36 39
%set %%min_len_three_type='disabled'
37 40
%else
38 41
%set %%min_len_three_type=%%check_passwd_min_len_three_type
42
%silent %%pwd_lengths.append(%%check_passwd_min_len_three_type)
39 43
%end if
40 44
%if %%check_passwd_min_len_four_type == 0
41 45
%set %%min_len_four_type='disabled'
42 46
%else
43 47
%set %%min_len_four_type=%%check_passwd_min_len_four_type
48
%silent %%pwd_lengths.append(%%check_passwd_min_len_four_type)
44 49
%end if
45
password required	pam_passwdqc.so similar=deny min=%%min_len_one_type,%%min_len_two_type,%%min_len_two_type,%%min_len_three_type,%%min_len_four_type passphrase=0 %slurp
50
password required	pam_passwdqc.so ask_oldauthtok similar=deny min=%%min_len_one_type,%%min_len_two_type,%%min_len_two_type,%%min_len_three_type,%%min_len_four_type passphrase=0 %slurp
46 51
%if %%check_passwd_max != 0:
47 52
max=%%check_passwd_max
48 53
%end if
49

  
54
%set %%min_len = %%min(%%pwd_lengths)
55
%else
56
%set %%min_len = 0
50 57
%end if
51
password   requisite   pam_unix.so nullok obscure sha512 %slurp
58
password   requisite   pam_unix.so nullok sha512 minlen=%%min_len %slurp
52 59
%if %%check_passwd == 'oui'
53 60
use_first_pass
54 61
%end if