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