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

Contents of /rpms/e-smith-samba/sme8/e-smith-samba-2.2.0-store_ldap_pw.patch

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


Revision 1.1 - (show annotations) (download)
Wed Nov 3 17:56:50 2010 UTC (13 years, 7 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-samba-2_2_0-33_el5_sme
* Wed Nov 3 2010 Daniel Berteaud <daniel@firewall-services.com> 2.2.0-33.sme
- Store the ldap admin pw early in the bootstrap-ldap-save event [SME: 6332]

1 diff -Nur -x '*.orig' -x '*.rej' e-smith-samba-2.2.0/createlinks mezzanine_patched_e-smith-samba-2.2.0/createlinks
2 --- e-smith-samba-2.2.0/createlinks 2010-11-03 18:55:23.000000000 +0100
3 +++ mezzanine_patched_e-smith-samba-2.2.0/createlinks 2010-11-03 18:29:07.000000000 +0100
4 @@ -33,6 +33,7 @@
5
6 $event = "bootstrap-ldap-save";
7 templates2events("/etc/samba/smb.conf", $event);
8 +event_link("store-ldap-passwd", $event, "06");
9 event_link("update-domain-group-maps", $event, "56");
10
11 $event = "group-create";
12 diff -Nur -x '*.orig' -x '*.rej' e-smith-samba-2.2.0/root/etc/e-smith/events/actions/store-ldap-passwd mezzanine_patched_e-smith-samba-2.2.0/root/etc/e-smith/events/actions/store-ldap-passwd
13 --- e-smith-samba-2.2.0/root/etc/e-smith/events/actions/store-ldap-passwd 1970-01-01 01:00:00.000000000 +0100
14 +++ mezzanine_patched_e-smith-samba-2.2.0/root/etc/e-smith/events/actions/store-ldap-passwd 2010-11-03 18:55:21.000000000 +0100
15 @@ -0,0 +1,40 @@
16 +#!/usr/bin/perl -w
17 +
18 +#----------------------------------------------------------------------
19 +# copyright (C) 2010 Firewall Services
20 +# daniel@firewall-services.com
21 +#
22 +# This program is free software; you can redistribute it and/or modify
23 +# it under the terms of the GNU General Public License as published by
24 +# the Free Software Foundation; either version 2 of the License, or
25 +# (at your option) any later version.
26 +#
27 +# This program is distributed in the hope that it will be useful,
28 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
29 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 +# GNU General Public License for more details.
31 +#
32 +# You should have received a copy of the GNU General Public License
33 +# along with this program; if not, write to the Free Software
34 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 +#----------------------------------------------------------------------
36 +
37 +use esmith::ConfigDB;
38 +use esmith::util;
39 +
40 +my $c = esmith::ConfigDB->open_ro;
41 +my $l = $c->get('ldap') || die "ldap service not found\n";
42 +my $s = $l->prop('status') || 'disabled';
43 +unless ( $s eq 'enabled' ){
44 + warn "Not running action script $0, LDAP service not enabled!\n";
45 + exit(0);
46 +}
47 +exit(0) unless ($l->prop('Authentication') || 'disabled') eq 'enabled';
48 +
49 +my $domain = $c->get("DomainName")
50 + || die("Could not determine domain name");
51 +my $base = esmith::util::ldapBase ($domain->value);
52 +my $pw = esmith::util::LdapPassword();
53 +
54 +die "Error storing LDAP password in secret.tdb\n" unless
55 + system('/usr/bin/smbpasswd', '-w', "$pw") == 0;
56 diff -Nur -x '*.orig' -x '*.rej' e-smith-samba-2.2.0/root/etc/e-smith/events/actions/update-domain-group-maps mezzanine_patched_e-smith-samba-2.2.0/root/etc/e-smith/events/actions/update-domain-group-maps
57 --- e-smith-samba-2.2.0/root/etc/e-smith/events/actions/update-domain-group-maps 2010-11-03 18:55:23.000000000 +0100
58 +++ mezzanine_patched_e-smith-samba-2.2.0/root/etc/e-smith/events/actions/update-domain-group-maps 2010-11-03 18:29:53.000000000 +0100
59 @@ -18,13 +18,6 @@
60 my $ldapauth = $c->get('ldap')->prop('Authentication') || 'disabled';
61 my $pw = esmith::util::LdapPassword();
62
63 -if ($ldapauth eq 'enabled')
64 -{
65 - # Add the LDAP admin password in secret.tdb
66 - warn "Couldn't add LDAP password in secret.tdb\n" unless
67 - system("/usr/bin/smbpasswd", "-w", "$pw") == 0;
68 -}
69 -
70 my $g = `/usr/bin/net getlocalsid`;
71 unless ($g =~ /SID.*is: (.+)/) {
72 warn "Unable to determine SID. Clearning cache to see if it helps.";
73 diff -Nur -x '*.orig' -x '*.rej' e-smith-samba-2.2.0/root/var/service/smbd/run mezzanine_patched_e-smith-samba-2.2.0/root/var/service/smbd/run
74 --- e-smith-samba-2.2.0/root/var/service/smbd/run 2010-11-03 18:55:23.000000000 +0100
75 +++ mezzanine_patched_e-smith-samba-2.2.0/root/var/service/smbd/run 2010-11-03 18:29:31.000000000 +0100
76 @@ -41,10 +41,5 @@
77 [ -r "$tdb" ] && tdbbackup "$tdb" .bak
78 done
79
80 -if [ "$ldapauth" == "enabled" ]
81 -then
82 - /usr/bin/smbpasswd -w "$(cat /etc/ldap.secret)"
83 -fi
84 -
85 exec 2>&1
86 exec $smbd -F

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