/[smeserver]/rpms/e-smith-ldap/sme8/e-smith-ldap-5.2.0-fix_ldap_update.patch
ViewVC logotype

Contents of /rpms/e-smith-ldap/sme8/e-smith-ldap-5.2.0-fix_ldap_update.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Oct 28 07:39:37 2010 UTC (13 years, 7 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-ldap-5_2_0-54_el5_sme
* Thu Oct 28 2010 Daniel Berteaud <daniel@firewall-services.com> 5.2.0-54.sme
- Fix minor errors in ldap-update [SME: 6312]

1 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
2 --- e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-10-28 09:33:15.000000000 +0200
3 +++ mezzanine_patched_e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-10-28 09:33:13.000000000 +0200
4 @@ -163,28 +163,30 @@
5 warn "failed to add/update entry ou=$obj,$base: ", $result->error if $result->code;
6 }
7
8 +my $updates;
9 +
10 #------------------------------------------------------------
11 # Ensure nobody, shared, www objects are there
12 #------------------------------------------------------------
13 foreach my $user (qw/www/){
14 - my $dn = "cn=$group,ou=Users,$base";
15 + my $dn = "uid=$user,ou=Users,$base";
16 utf8::upgrade($dn);
17 $updates->{$dn}->{objectClass} = ['account', 'posixAccount', 'shadowAccount'];
18
19 # Read information from getent passwd
20 - @{$updates->{$dn}}{'uid','userPassword','uidNumber','gidNumber','junk','junk','gecos','homeDirectory','loginShell'} = getpwnam($key);
21 + @{$updates->{$dn}}{'uid','userPassword','uidNumber','gidNumber','junk','junk','gecos','homeDirectory','loginShell'} = getpwnam($user);
22 $updates->{$dn}->{userPassword} =~ s/^/{CRYPT}/ unless $updates->{$dn}->{userPassword} =~ m/^{/;
23 - $desc = $updates->{$dn}->{cn} = $updates->{$dn}->{gecos};
24 + my $desc = $updates->{$dn}->{cn} = $updates->{$dn}->{gecos};
25
26 # Samba parameters if we find the samba.schema
27 if ( -f "$schema" and -x '/usr/bin/pdbedit' )
28 {
29 - my $line = `/usr/bin/pdbedit -wu '$key' 2> /dev/null`;
30 + my $line = `/usr/bin/pdbedit -wu '$user' 2> /dev/null`;
31 chomp($line);
32 if ($line)
33 {
34 @{$updates->{$dn}}{'junk','junk','sambaLMPassword','sambaNTPassword'} = split(/:/,$line);
35 - foreach $line (`/usr/bin/pdbedit -vu '$key' 2> /dev/null`)
36 + foreach $line (`/usr/bin/pdbedit -vu '$user' 2> /dev/null`)
37 {
38 chomp($line);
39 $updates->{$dn}->{sambaSID} = $1 if $line =~ m{User SID:\s+(S-.*)$};
40 @@ -229,7 +231,6 @@
41 #------------------------------------------------------------
42 # Create a list of updates that need to happen
43 #------------------------------------------------------------
44 -my $updates;
45 foreach my $acct (@accounts)
46 {
47 my $key = $acct->key;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed