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