/[smeserver]/rpms/e-smith-samba/sme8/e-smith-samba-2.2.0-remove-domains.patch
ViewVC logotype

Annotation of /rpms/e-smith-samba/sme8/e-smith-samba-2.2.0-remove-domains.patch

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


Revision 1.1 - (hide annotations) (download)
Tue Nov 2 16:57:29 2010 UTC (13 years, 7 months ago) by slords
Branch: MAIN
CVS Tags: e-smith-samba-2_2_0-47_el5_sme, e-smith-samba-2_2_0-52_el5_sme, e-smith-samba-2_2_0-49_el5_sme, e-smith-samba-2_2_0-40_el5_sme, e-smith-samba-2_2_0-43_el5_sme, e-smith-samba-2_2_0-44_el5_sme, e-smith-samba-2_2_0-63_el5_sme, e-smith-samba-2_2_0-61_el5_sme, e-smith-samba-2_2_0-31_el5_sme, e-smith-samba-2_2_0-32_el5_sme, e-smith-samba-2_2_0-57_el5_sme, e-smith-samba-2_2_0-54_el5_sme, e-smith-samba-2_2_0-41_el5_sme, e-smith-samba-2_2_0-55_el5_sme, e-smith-samba-2_2_0-39_el5_sme, e-smith-samba-2_2_0-46_el5_sme, e-smith-samba-2_2_0-53_el5_sme, e-smith-samba-2_2_0-50_el5_sme, e-smith-samba-2_2_0-58_el5_sme, e-smith-samba-2_2_0-30_el5_sme, e-smith-samba-2_2_0-33_el5_sme, e-smith-samba-2_2_0-56_el5_sme, e-smith-samba-2_2_0-51_el5_sme, e-smith-samba-2_2_0-42_el5_sme, e-smith-samba-2_2_0-65_el5_sme, e-smith-samba-2_2_0-64_el5_sme, e-smith-samba-2_2_0-60_el5_sme, e-smith-samba-2_2_0-62_el5_sme, e-smith-samba-2_2_0-34_el5_sme, e-smith-samba-2_2_0-35_el5_sme, e-smith-samba-2_2_0-45_el5_sme, e-smith-samba-2_2_0-48_el5_sme, e-smith-samba-2_2_0-37_el5_sme, e-smith-samba-2_2_0-38_el5_sme, e-smith-samba-2_2_0-36_el5_sme, e-smith-samba-2_2_0-29_el5_sme, e-smith-samba-2_2_0-66_el5_sme, e-smith-samba-2_2_0-59_el5_sme, HEAD
Add routines for ldap auth

1 slords 1.1 diff -up e-smith-samba-2.2.0/createlinks.remove-domains e-smith-samba-2.2.0/createlinks
2     --- e-smith-samba-2.2.0/createlinks.remove-domains 2010-10-28 08:45:52.000000000 -0600
3     +++ e-smith-samba-2.2.0/createlinks 2010-10-28 08:45:17.000000000 -0600
4     @@ -83,6 +83,7 @@
5    
6     $event = "workgroup-update";
7     event_link("update-domain-group-maps", $event, "56");
8     +event_link("cleanup-domains", $event, "65");
9     safe_symlink("sigterm", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
10     safe_symlink("sigterm", "root/etc/e-smith/events/$event/services2adjust/smbd");
11     safe_symlink("sigterm", "root/etc/e-smith/events/$event/services2adjust/nmbd");
12     diff -up e-smith-samba-2.2.0/root/etc/e-smith/events/actions/cleanup-domains.remove-domains e-smith-samba-2.2.0/root/etc/e-smith/events/actions/cleanup-domains
13     --- e-smith-samba-2.2.0/root/etc/e-smith/events/actions/cleanup-domains.remove-domains 2010-11-02 09:51:35.000000000 -0600
14     +++ e-smith-samba-2.2.0/root/etc/e-smith/events/actions/cleanup-domains 2010-11-02 10:07:43.000000000 -0600
15     @@ -0,0 +1,56 @@
16     +#!/usr/bin/perl -w
17     +
18     +package esmith;
19     +
20     +use strict;
21     +use Errno;
22     +use esmith::ConfigDB;
23     +use esmith::util;
24     +use Net::LDAP;
25     +
26     +my $c = esmith::ConfigDB->open_ro;
27     +
28     +# Don't attempt to update ldap unles master
29     +exit(0) unless ($c->get('ldap')->prop('Authentication') || 'disabled') eq 'enabled';
30     +
31     +my $l = $c->get('ldap');
32     +my $status = $l->prop('status') || "disabled";
33     +unless ($status eq "enabled" )
34     +{
35     + warn "Not running action script $0, LDAP service not enabled!\n";
36     + exit(0);
37     +}
38     +
39     +my $domain = $c->get('DomainName')
40     +|| die("Couldn't determine domain name");
41     +$domain = $domain->value;
42     +
43     +my $base = esmith::util::ldapBase ($domain);
44     +my $pw = esmith::util::LdapPassword();
45     +
46     +my $ldap = Net::LDAP->new('localhost')
47     + or die "$@";
48     +
49     +$ldap->bind(
50     + dn => "cn=root,$base",
51     + password => $pw
52     +);
53     +
54     +my $smb = $c->get('smb');
55     +my $domName = $smb->prop('Workgroup') || 'mitel-network';
56     +if ( ($smb->prop('ServerRole') || 'WS') eq 'WS' )
57     +{
58     + $domName = $smb->prop('ServerName') || 'e-smith-server';
59     +}
60     +
61     +my $result = $ldap->search( base => $base,
62     + filter => "(&(objectClass=sambaDomain)(!(sambaDomainName=$domName)))",
63     + scope => 'one'
64     +);
65     +die "failed looking up sambaDomainName entry: ", $result->error if $result->code;
66     +
67     +foreach ($result->entries)
68     +{
69     + $_->delete;
70     + $_->update($ldap);
71     +}

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