-
Notifications
You must be signed in to change notification settings - Fork 0
/
e-smith-ldap-5.2.0-fix_ldap_update.patch
47 lines (44 loc) · 2.36 KB
/
e-smith-ldap-5.2.0-fix_ldap_update.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
diff -Nur -x '*.orig' -x '*.rej' e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update mezzanine_patched_e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update
--- e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-10-28 09:33:15.000000000 +0200
+++ mezzanine_patched_e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-10-28 09:33:13.000000000 +0200
@@ -163,28 +163,30 @@
warn "failed to add/update entry ou=$obj,$base: ", $result->error if $result->code;
}
+my $updates;
+
#------------------------------------------------------------
# Ensure nobody, shared, www objects are there
#------------------------------------------------------------
foreach my $user (qw/www/){
- my $dn = "cn=$group,ou=Users,$base";
+ my $dn = "uid=$user,ou=Users,$base";
utf8::upgrade($dn);
$updates->{$dn}->{objectClass} = ['account', 'posixAccount', 'shadowAccount'];
# Read information from getent passwd
- @{$updates->{$dn}}{'uid','userPassword','uidNumber','gidNumber','junk','junk','gecos','homeDirectory','loginShell'} = getpwnam($key);
+ @{$updates->{$dn}}{'uid','userPassword','uidNumber','gidNumber','junk','junk','gecos','homeDirectory','loginShell'} = getpwnam($user);
$updates->{$dn}->{userPassword} =~ s/^/{CRYPT}/ unless $updates->{$dn}->{userPassword} =~ m/^{/;
- $desc = $updates->{$dn}->{cn} = $updates->{$dn}->{gecos};
+ $updates->{$dn}->{cn} = $updates->{$dn}->{gecos};
# Samba parameters if we find the samba.schema
if ( -f "$schema" and -x '/usr/bin/pdbedit' )
{
- my $line = `/usr/bin/pdbedit -wu '$key' 2> /dev/null`;
+ my $line = `/usr/bin/pdbedit -wu '$user' 2> /dev/null`;
chomp($line);
if ($line)
{
@{$updates->{$dn}}{'junk','junk','sambaLMPassword','sambaNTPassword'} = split(/:/,$line);
- foreach $line (`/usr/bin/pdbedit -vu '$key' 2> /dev/null`)
+ foreach $line (`/usr/bin/pdbedit -vu '$user' 2> /dev/null`)
{
chomp($line);
$updates->{$dn}->{sambaSID} = $1 if $line =~ m{User SID:\s+(S-.*)$};
@@ -229,7 +231,6 @@
#------------------------------------------------------------
# Create a list of updates that need to happen
#------------------------------------------------------------
-my $updates;
foreach my $acct (@accounts)
{
my $key = $acct->key;