summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-04 19:40:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:08 -0500
commit638a16900cddacc4399c77c8e26ba43e93341499 (patch)
treedb8cfeadde1a6f5470bb42d0b1f4973659e25297 /source3
parent14502053e92d20d9004ffa03767b201c05619a87 (diff)
downloadsamba-638a16900cddacc4399c77c8e26ba43e93341499.tar.gz
samba-638a16900cddacc4399c77c8e26ba43e93341499.tar.bz2
samba-638a16900cddacc4399c77c8e26ba43e93341499.zip
r19073: mapping_dn can fail
(This used to be commit d234f39c79e0e50f784826d0920ebd21cc9a283d)
Diffstat (limited to 'source3')
-rw-r--r--source3/groupdb/mapping_ldb.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index 1b0053da47..23b800a378 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -139,10 +139,14 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
}
msg = ldb_msg_new(ldb);
- if (msg == NULL) return False;
+ if (msg == NULL) {
+ return False;
+ }
msg->dn = mapping_dn(msg, &map->sid);
- if (msg->dn == NULL) goto failed;
+ if (msg->dn == NULL) {
+ goto failed;
+ }
if (ldb_msg_add_string(msg, "objectClass", "groupMap") != LDB_SUCCESS ||
ldb_msg_add_string(msg, "sid",
@@ -303,6 +307,9 @@ failed:
}
dn = mapping_dn(ldb, sid);
+ if (dn == NULL) {
+ return False;
+ }
ret = ldb_delete(ldb, dn);
talloc_free(dn);
@@ -466,6 +473,9 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
}
msg.dn = mapping_dn(tmp_ctx, alias);
+ if (msg.dn == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
msg.num_elements = 1;
msg.elements = &el;
el.flags = operation;
@@ -524,6 +534,9 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
*num = 0;
dn = mapping_dn(ldb, alias);
+ if (dn == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
ret = ldb_search(ldb, dn, LDB_SCOPE_BASE, NULL, attrs, &res);
talloc_steal(dn, res);