samba/samba-3.0.23-smbldaptools-rootbinddn.patch
Silvan Calarco 690f4a096f update to 3.6.23
x86_64: install cups backend under %{_prefix}/lib/cups, not %{_libdir}/cups
x86_64: install pam and nss libraries under /lib64 instead of /lib
use patch to fix smbd link against libtirpc instead of passing LDFLAGS [release 3.6.23-1mamba;Wed Apr 02 2014]
2024-01-05 17:37:14 +01:00

58 lines
1.8 KiB
Diff

--- samba-3.0.23/examples/LDAP/smbldap-tools-0.9.2/smbldap_tools.pm 2006-01-03 11:57:41.000000000 +0100
+++ samba-3.0.23/examples/LDAP/smbldap-tools-0.9.2/smbldap_tools.pm.fix 2006-10-10 10:12:42.000000000 +0200
@@ -32,15 +32,15 @@
# ugly funcs using global variables and spawning openldap clients
my $smbldap_conf;
-if (-e "/etc/smbldap-tools/smbldap.conf") {
- $smbldap_conf="/etc/smbldap-tools/smbldap.conf";
+if (-e "/etc/samba/smbldap-tools/smbldap.conf") {
+ $smbldap_conf="/etc/samba/smbldap-tools/smbldap.conf";
} else {
$smbldap_conf="/etc/opt/IDEALX/smbldap-tools/smbldap.conf";
}
my $smbldap_bind_conf;
-if (-e "/etc/smbldap-tools/smbldap_bind.conf") {
- $smbldap_bind_conf="/etc/smbldap-tools/smbldap_bind.conf";
+if (-e "/etc/samba/smbldap-tools/smbldap_bind.conf") {
+ $smbldap_bind_conf="/etc/samba/smbldap-tools/smbldap_bind.conf";
} else {
$smbldap_bind_conf="/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf";
}
@@ -51,6 +51,10 @@
$samba_conf="/usr/local/samba/lib/smb.conf";
}
+# system-wide LDAP configuration files
+my $ldap_conf="/etc/ldap.conf";
+my $ldap_secret="/etc/ldap.secret";
+
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
use Exporter;
$VERSION = 1.00;
@@ -168,7 +172,22 @@
$conf{$parameter}=$value;
}
close (CONFIGFILE);
- } else {
+
+ if (open (CONFIGFILE, "$ldap_secret")) {
+ $conf{masterPw} = <CONFIGFILE>;
+ chomp($conf{masterPw});
+ close (CONFIGFILE);
+
+ open (CONFIGFILE, "$ldap_conf") || die "Unable to open $ldap_conf for reading !\n";
+ while (<CONFIGFILE>) {
+ chomp($_);
+ next if ( ! /^\s*rootbinddn\s*.*/ );
+ $_ =~ s/^\s*rootbinddn\s*(.*)$/$1/;
+ $conf{masterDN}=$_;
+ }
+ close (CONFIGFILE);
+ }
+ } else {
$conf{slaveDN}=$conf{slavePw}=$conf{masterDN}=$conf{masterPw}="";
}
# automatically find SID