X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=blobdiff_plain;f=source4%2Flibnet%2Flibnet_samsync_ldb.c;fp=source4%2Flibnet%2Flibnet_samsync_ldb.c;h=ccf737f64c15eebaf3b157a58eb496405451bafd;hp=20f004657bef8c6db4fd13b3aeca3989e29c433a;hb=e3eaeb942b0a0eaee810c1d5f719854745e0dc4c;hpb=3000fc29c373f7fcc59f4de443f209f377dbd4f6 diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c index 20f004657be..ccf737f64c1 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