1 |
filippocarletti |
1.1 |
diff -uNr e-smith-ldap-5.2.0/createlinks e-smith-ldap-5.2.0-nh-password/createlinks |
2 |
|
|
--- e-smith-ldap-5.2.0/createlinks 2010-01-21 15:47:02.422338757 +0100 |
3 |
|
|
+++ e-smith-ldap-5.2.0-nh-password/createlinks 2010-01-21 16:04:54.960224026 +0100 |
4 |
|
|
@@ -20,6 +20,7 @@ |
5 |
|
|
|
6 |
|
|
event_link("ldap-update", "user-modify", "25"); |
7 |
|
|
event_link("ldap-update", "group-modify", "25"); |
8 |
|
|
+event_link("ldap-update", "password-modify", "25"); |
9 |
|
|
|
10 |
|
|
event_link("ldap-update", "ldap-update", "80"); |
11 |
|
|
templates2events("/etc/rc.d/init.d/masq", "ldap-update"); |
12 |
|
|
diff -uNr e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/events/actions/ldap-update |
13 |
|
|
--- e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-01-21 15:47:02.434227133 +0100 |
14 |
|
|
+++ e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/events/actions/ldap-update 2010-01-21 15:50:09.881601528 +0100 |
15 |
|
|
@@ -76,6 +76,10 @@ |
16 |
|
|
# Update LDAP directory entry. First read LDAP password |
17 |
|
|
#------------------------------------------------------------ |
18 |
|
|
my $pw = esmith::util::LdapPassword(); |
19 |
|
|
+my %passwd; |
20 |
|
|
+ |
21 |
|
|
+while(my ($key,$pwd) = getpwent()) { $passwd{$key} = "{CRYPT}$pwd"; } |
22 |
|
|
+endpwent(); |
23 |
|
|
|
24 |
|
|
#------------------------------------------------------------ |
25 |
|
|
# Update LDAP database entry. |
26 |
|
|
@@ -118,6 +122,8 @@ |
27 |
|
|
utf8::upgrade($city); |
28 |
|
|
my $street = $acct->prop('Street') || ''; |
29 |
|
|
utf8::upgrade($street); |
30 |
|
|
+ my $password = $passwd{$key} || ''; |
31 |
|
|
+ utf8::upgrade($password); |
32 |
|
|
push @attrs, (objectClass => 'inetOrgPerson'); |
33 |
|
|
push @attrs, (uid => $key); |
34 |
|
|
|
35 |
|
|
@@ -130,6 +136,7 @@ |
36 |
|
|
push @attrs, (ou => $dept) unless $dept =~ /^\s*$/; |
37 |
|
|
push @attrs, (l => $city) unless $city =~ /^\s*$/; |
38 |
|
|
push @attrs, (street => $street) unless $street =~ /^\s*$/; |
39 |
|
|
+ push @attrs, (userPassword => $password) unless $password =~ /^\s*$/; |
40 |
|
|
} |
41 |
|
|
elsif ($type eq 'group') |
42 |
|
|
{ |
43 |
|
|
diff -uNr e-smith-ldap-5.2.0/root/etc/e-smith/templates/etc/openldap/slapd.conf/95acls e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/etc/openldap/slapd.conf/95acls |
44 |
|
|
--- e-smith-ldap-5.2.0/root/etc/e-smith/templates/etc/openldap/slapd.conf/95acls 1970-01-01 01:00:00.000000000 +0100 |
45 |
|
|
+++ e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/etc/openldap/slapd.conf/95acls 2010-01-21 15:55:24.430242701 +0100 |
46 |
|
|
@@ -0,0 +1,8 @@ |
47 |
|
|
+access to attrs=userPassword |
48 |
|
|
+ by self write |
49 |
|
|
+ by anonymous auth |
50 |
|
|
+ by * none |
51 |
|
|
+access to * |
52 |
|
|
+ by self write |
53 |
|
|
+ by anonymous read |
54 |
|
|
+ by * none |
55 |
|
|
diff -uNr e-smith-ldap-5.2.0/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/50users e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/50users |
56 |
|
|
--- e-smith-ldap-5.2.0/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/50users 2010-01-21 15:47:02.435227256 +0100 |
57 |
|
|
+++ e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/50users 2010-01-21 15:53:24.478773776 +0100 |
58 |
|
|
@@ -10,6 +10,7 @@ |
59 |
|
|
my $dept = $user->prop('Dept'); |
60 |
|
|
my $city = $user->prop('City'); |
61 |
|
|
my $street = $user->prop('Street'); |
62 |
|
|
+ my $password = $passwd{$key}; |
63 |
|
|
|
64 |
|
|
$OUT .= "\n"; |
65 |
|
|
$OUT .= utf8("dn: uid=$key,$ldapBase\n"); |
66 |
|
|
@@ -24,5 +25,6 @@ |
67 |
|
|
$OUT .= utf8("ou: $dept\n") if $dept; |
68 |
|
|
$OUT .= utf8("l: $city\n") if $city; |
69 |
|
|
$OUT .= utf8("street: $street\n") if $street; |
70 |
|
|
+ $OUT .= utf8("userPassword: $password\n") if $password; |
71 |
|
|
} |
72 |
|
|
} |
73 |
|
|
diff -uNr e-smith-ldap-5.2.0/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/template-begin e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/template-begin |
74 |
|
|
--- e-smith-ldap-5.2.0/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/template-begin 2006-03-15 22:17:43.000000000 +0100 |
75 |
|
|
+++ e-smith-ldap-5.2.0-nh-password/root/etc/e-smith/templates/home/e-smith/db/ldap/ldif/template-begin 2010-01-21 15:52:43.086549216 +0100 |
76 |
|
|
@@ -10,5 +10,10 @@ |
77 |
|
|
utf8::encode($t); |
78 |
|
|
return $t; |
79 |
|
|
} |
80 |
|
|
+ |
81 |
|
|
+ %passwd = (); |
82 |
|
|
+ while(my ($key,$pwd) = getpwent()) { $passwd{$key} = "{CRYPT}$pwd"; } |
83 |
|
|
+ endpwent(); |
84 |
|
|
+ |
85 |
|
|
$OUT = ""; |
86 |
|
|
} |