summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_map
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-27 15:13:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:41 -0500
commit7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2 (patch)
tree221d336d855546df8be8ececffb2e4aea013131c /source4/lib/ldb/ldb_map
parente3dcc92deef81972a6f38bdbab75256d3d038357 (diff)
downloadsamba-7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2.tar.gz
samba-7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2.tar.bz2
samba-7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2.zip
r9685: Add tests for samba3sam mapping module
Fix a couple of bugs Move samba3sam backend to lib/ldb/ Remove some more unused parameters (This used to be commit 7f864d446d6af7cfd9fb8dbc496a29b36ec57ce9)
Diffstat (limited to 'source4/lib/ldb/ldb_map')
-rw-r--r--source4/lib/ldb/ldb_map/ldb_map.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c
index dea3c24e37..2082abe79a 100644
--- a/source4/lib/ldb/ldb_map/ldb_map.c
+++ b/source4/lib/ldb/ldb_map/ldb_map.c
@@ -126,6 +126,9 @@ static struct ldb_dn *map_remote_dn(struct ldb_module *module, const struct ldb_
struct ldb_dn *newdn;
int i;
+ if (dn == NULL)
+ return NULL;
+
newdn = talloc_memdup(module, dn, sizeof(*dn));
if (!newdn)
return NULL;
@@ -183,6 +186,9 @@ static struct ldb_dn *map_local_dn(struct ldb_module *module, const struct ldb_d
int i;
struct ldb_parse_tree eqtree, *new_eqtree;
+ if (dn == NULL)
+ return NULL;
+
newdn = talloc_memdup(module, dn, sizeof(*dn));
if (!newdn)
return NULL;
@@ -252,8 +258,6 @@ static struct ldb_dn *map_local_dn(struct ldb_module *module, const struct ldb_d
return newdn;
}
-
-
/* Loop over ldb_map_attribute array and add remote_names */
static const char **ldb_map_attrs(struct ldb_module *module, const char *const attrs[])
{
@@ -261,6 +265,9 @@ static const char **ldb_map_attrs(struct ldb_module *module, const char *const a
const char **ret;
int ar_size = 0, last_element = 0;
+ if (attrs == NULL)
+ return NULL;
+
/* Start with good guess of number of elements */
for (i = 0; attrs[i]; i++);