summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2004-11-15 12:30:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:51 -0500
commit950f3eb508a70f2304f76a8307582690d4715670 (patch)
tree3b2a1cbe6e036406f80b6f1b6a42ca3d2b33a561 /source4/lib/ldb
parente2bc9a47c0380322b05018412958ed45f4283838 (diff)
downloadsamba-950f3eb508a70f2304f76a8307582690d4715670.tar.gz
samba-950f3eb508a70f2304f76a8307582690d4715670.tar.bz2
samba-950f3eb508a70f2304f76a8307582690d4715670.zip
r3757: Some fixes for ldb_ldap
Now we pass also the test-ldap tests :-) (This used to be commit 0d58b1dc5aa0b00a924c1c5506f0c500c0b37b3e)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_modules.c2
-rw-r--r--source4/lib/ldb/ldb_ldap/ldb_ldap.c4
-rwxr-xr-xsource4/lib/ldb/tests/init_slapd.sh4
-rw-r--r--source4/lib/ldb/tests/slapd.conf4
-rwxr-xr-xsource4/lib/ldb/tests/start_slapd.sh2
-rwxr-xr-xsource4/lib/ldb/tests/test-generic.sh2
-rwxr-xr-xsource4/lib/ldb/tests/test-ldap.sh1
7 files changed, 11 insertions, 8 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index a7cfd81d46..37be07c1ca 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -80,7 +80,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
}
}
- if (!modules) { /* no modules in the options, look for @MODULES in the db */
+ if (!modules && strcmp("ldap", ldb->modules->ops->name)) { /* no modules in the options, look for @MODULES in the db (not for ldap) */
int ret, j, k;
char * attrs[] = { "@MODULE" };
struct ldb_message **msg;
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index 96aee088a7..7fb6a0b3f7 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -255,6 +255,10 @@ static int lldb_search(struct ldb_module *module, const char *base,
int count, msg_count;
LDAPMessage *ldapres, *msg;
+ if (base == NULL) {
+ base = "";
+ }
+
lldb->last_rc = ldap_search_s(lldb->ldap, base, (int)scope,
expression,
discard_const_p(char *, attrs),
diff --git a/source4/lib/ldb/tests/init_slapd.sh b/source4/lib/ldb/tests/init_slapd.sh
index 65700f6c18..fc1ed16a4c 100755
--- a/source4/lib/ldb/tests/init_slapd.sh
+++ b/source4/lib/ldb/tests/init_slapd.sh
@@ -1,6 +1,4 @@
-#!/bin/sh
-
-export PATH=/usr/sbin:$PATH
+#!/bin/sh
rm -rf tests/tmp/db
mkdir -p tests/tmp/db
diff --git a/source4/lib/ldb/tests/slapd.conf b/source4/lib/ldb/tests/slapd.conf
index 10d15b541c..61c8627e18 100644
--- a/source4/lib/ldb/tests/slapd.conf
+++ b/source4/lib/ldb/tests/slapd.conf
@@ -14,8 +14,8 @@ access to * by * write
allow update_anon bind_anon_dn
-modulepath /usr/lib/ldap
-moduleload back_bdb
+#modulepath /usr/lib/ldap
+#moduleload back_bdb
defaultsearchbase "o=University of Michigan,c=US"
diff --git a/source4/lib/ldb/tests/start_slapd.sh b/source4/lib/ldb/tests/start_slapd.sh
index d03a0fca32..a7ec69c855 100755
--- a/source4/lib/ldb/tests/start_slapd.sh
+++ b/source4/lib/ldb/tests/start_slapd.sh
@@ -1,7 +1,5 @@
#!/bin/sh
-export PATH=/usr/sbin:$PATH
-
mkdir -p tests/tmp/db
slapd -f tests/slapd.conf -h "`tests/ldapi_url.sh`" $*
diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh
index b70b817732..c4647a7ba3 100755
--- a/source4/lib/ldb/tests/test-generic.sh
+++ b/source4/lib/ldb/tests/test-generic.sh
@@ -1,3 +1,5 @@
+#!/bin/sh
+
echo "LDB_URL: $LDB_URL"
echo "Adding base elements"
diff --git a/source4/lib/ldb/tests/test-ldap.sh b/source4/lib/ldb/tests/test-ldap.sh
index 37827219c0..4fcd328cad 100755
--- a/source4/lib/ldb/tests/test-ldap.sh
+++ b/source4/lib/ldb/tests/test-ldap.sh
@@ -1,5 +1,6 @@
#!/bin/sh
+export PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
SCHEMA_NEEDED="core nis cosine inetorgperson openldap"
# setup needed schema files