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

Annotation of /rpms/e-smith-ldap/sme8/e-smith-ldap-5.2.0-base_oid.patch

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


Revision 1.1 - (hide annotations) (download)
Sat Sep 25 18:38:04 2010 UTC (14 years, 1 month ago) by slords
Branch: MAIN
CVS Tags: e-smith-ldap-5_2_0-49_el5_sme, e-smith-ldap-5_2_0-76_el5_sme, e-smith-ldap-5_2_0-71_el5_sme, e-smith-ldap-5_2_0-39_el5_sme, e-smith-ldap-5_2_0-77_el5_sme, e-smith-ldap-5_2_0-50_el5_sme, e-smith-ldap-5_2_0-78_el5_sme, e-smith-ldap-5_2_0-37_el5_sme, e-smith-ldap-5_2_0-61_el5_sme, e-smith-ldap-5_2_0-66_el5_sme, e-smith-ldap-5_2_0-70_el5_sme, e-smith-ldap-5_2_0-79_el5_sme, e-smith-ldap-5_2_0-81_el5_sme, e-smith-ldap-5_2_0-36_el5_sme, e-smith-ldap-5_2_0-59_el5_sme, e-smith-ldap-5_2_0-45_el5_sme, e-smith-ldap-5_2_0-75_el5_sme, e-smith-ldap-5_2_0-46_el5_sme, e-smith-ldap-5_2_0-56_el5_sme, e-smith-ldap-5_2_0-55_el5_sme, e-smith-ldap-5_2_0-57_el5_sme, e-smith-ldap-5_2_0-73_el5_sme, e-smith-ldap-5_2_0-69_el5_sme, e-smith-ldap-5_2_0-48_el5_sme, e-smith-ldap-5_2_0-44_el5_sme, e-smith-ldap-5_2_0-52_el5_sme, e-smith-ldap-5_2_0-51_el5_sme, e-smith-ldap-5_2_0-35_el5_sme, e-smith-ldap-5_2_0-72_el5_sme, e-smith-ldap-5_2_0-34_el5_sme, e-smith-ldap-5_2_0-65_el5_sme, e-smith-ldap-5_2_0-54_el5_sme, e-smith-ldap-5_2_0-53_el5_sme, e-smith-ldap-5_2_0-43_el5_sme, e-smith-ldap-5_2_0-47_el5_sme, e-smith-ldap-5_2_0-40_el5_sme, e-smith-ldap-5_2_0-80_el5_sme, e-smith-ldap-5_2_0-74_el5_sme, e-smith-ldap-5_2_0-41_el5_sme, e-smith-ldap-5_2_0-63_el5_sme, e-smith-ldap-5_2_0-60_el5_sme, e-smith-ldap-5_2_0-62_el5_sme, e-smith-ldap-5_2_0-42_el5_sme, e-smith-ldap-5_2_0-38_el5_sme, e-smith-ldap-5_2_0-68_el5_sme, e-smith-ldap-5_2_0-67_el5_sme, e-smith-ldap-5_2_0-64_el5_sme, HEAD
* Sat Sep 25 2010 Shad L. Lords <slords@mail.com> 5.2.0-34.sme
- Add ibay and machine accounts into ldap [SME: 6236]

1 slords 1.1 diff -up e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update.base_oid 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.base_oid 2010-09-25 12:11:23.000000000 -0600
3     +++ e-smith-ldap-5.2.0/root/etc/e-smith/events/actions/ldap-update 2010-09-25 12:13:25.000000000 -0600
4     @@ -115,6 +115,47 @@ $ldap->bind(
5     password => $pw
6     );
7    
8     +my ($dc,undef) = split (/\./, $domain);
9     +my $o = $l->prop('defaultCompany') || $domain;
10     +
11     +# Try and find base record
12     +my %seen;
13     +my @objects = qw(top organization dcObject);
14     +my $result = $ldap->search( base => $base, filter => '(objectClass=*)', scope => 'base' );
15     +warn "failed checking base entry $base: ", $result->error if $result->code;
16     +if ($result->count == 0)
17     +{
18     + $result = $ldap->add( $base, attr => [ dc => $dc, o => $o, objectClass => \@objects ] );
19     +}
20     +else
21     +{
22     + # Don't overwrite objectClass (just update if necessary)
23     + %seen = ();
24     + @objects = grep { ! $seen{$_} ++ } (@objects, $result->entry(0)->get_value('objectClass') );
25     + $ldap->modify( $base, replace => { dc => $dc, o => $o, objectClass => \@objects } );
26     +}
27     +warn "failed(",$result->code,") to add/update entry $base: ", $result->error if $result->code;
28     +
29     +# Try and find container records
30     +foreach my $obj ( qw(Users Groups Computers) )
31     +{
32     + @objects = qw(top organizationalUnit);
33     + $result = $ldap->search( base => $base, filter => "(ou=$obj)" );
34     + warn "failed checking base entry ou=$obj,$base: ", $result->error if $result->code;
35     + if ($result->count == 0)
36     + {
37     + $result = $ldap->add( "ou=$obj,$base", attr => [ ou => $obj, objectClass => \@objects ] );
38     + }
39     + else
40     + {
41     + # Don't overwrite objectClass (just update if necessary)
42     + %seen = ();
43     + @objects = grep { ! $seen{$_} ++ } (@objects, $result->entry(0)->get_value('objectClass') );
44     + $result = $ldap->modify( "ou=$obj,$base", replace => { ou => $obj, objectClass => \@objects } );
45     + }
46     + warn "failed to add/update entry ou=$obj,$base: ", $result->error if $result->code;
47     +}
48     +
49     #------------------------------------------------------------
50     # Create a list of updates that need to happen
51     #------------------------------------------------------------

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