summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_samsync_ldb.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-14 17:02:48 +0100
committerGünther Deschner <gd@samba.org>2012-12-21 13:56:00 +0100
commite3eaeb942b0a0eaee810c1d5f719854745e0dc4c (patch)
treed2c6279481c9438c22e37075f15d94aac02e278c /source4/libnet/libnet_samsync_ldb.c
parent3000fc29c373f7fcc59f4de443f209f377dbd4f6 (diff)
downloadsamba-e3eaeb942b0a0eaee810c1d5f719854745e0dc4c.tar.gz
samba-e3eaeb942b0a0eaee810c1d5f719854745e0dc4c.tar.bz2
samba-e3eaeb942b0a0eaee810c1d5f719854745e0dc4c.zip
s4-libnet: Checkr return codes in samsync_ldb_handle_domain().
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4/libnet/libnet_samsync_ldb.c')
-rw-r--r--source4/libnet/libnet_samsync_ldb.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index 20f004657b..ccf737f64c 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -161,13 +161,22 @@ static NTSTATUS samsync_ldb_handle_domain(TALLOC_CTX *mem_ctx,
/* Update the domain sid with the incoming
* domain (found on LSA pipe, database sid may
* be random) */
- samdb_msg_add_dom_sid(state->sam_ldb, mem_ctx,
- msg, "objectSid", state->dom_sid[database]);
+ ret = samdb_msg_add_dom_sid(state->sam_ldb,
+ mem_ctx,
+ msg,
+ "objectSid",
+ state->dom_sid[database]);
+ if (ret != LDB_SUCCESS) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
} else {
/* Well, we will have to use the one from the database */
state->dom_sid[database] = samdb_search_dom_sid(state->sam_ldb, state,
state->base_dn[database],
"objectSid", NULL);
+ if (state->dom_sid[database] == NULL) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
}
if (state->samsync_state->domain_guid) {
@@ -179,7 +188,10 @@ static NTSTATUS samsync_ldb_handle_domain(TALLOC_CTX *mem_ctx,
return status;
}
- ldb_msg_add_value(msg, "objectGUID", &v, NULL);
+ ret = ldb_msg_add_value(msg, "objectGUID", &v, NULL);
+ if (ret != LDB_SUCCESS) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
}
} else if (database == SAM_DATABASE_BUILTIN) {
/* work out the builtin_dn - useful for so many calls its worth