diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/samdb.c | 28 | ||||
-rw-r--r-- | source4/libnet/libnet_join.c | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_samsync_ldb.c | 16 | ||||
-rw-r--r-- | source4/ntptr/simple_ldb/ntptr_simple_ldb.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 2 | ||||
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 11 | ||||
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 12 |
7 files changed, 26 insertions, 49 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index 6eb2ecffae..310ef17c24 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -1022,30 +1022,6 @@ int samdb_msg_set_string(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struc } /* - add a record -*/ -int samdb_add(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg) -{ - return ldb_add(sam_ldb, msg); -} - -/* - delete a record -*/ -int samdb_delete(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *dn) -{ - return ldb_delete(sam_ldb, dn); -} - -/* - modify a record -*/ -int samdb_modify(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg) -{ - return ldb_modify(sam_ldb, msg); -} - -/* replace elements in a record */ int samdb_replace(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg) @@ -1058,7 +1034,7 @@ int samdb_replace(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_m } /* modify the samdb record */ - return samdb_modify(sam_ldb, mem_ctx, msg); + return ldb_modify(sam_ldb, msg); } /* @@ -1992,7 +1968,7 @@ NTSTATUS samdb_create_foreign_security_principal(struct ldb_context *sam_ctx, TA "foreignSecurityPrincipal"); /* create the alias */ - ret = samdb_add(sam_ctx, mem_ctx, msg); + ret = ldb_add(sam_ctx, msg); if (ret != 0) { DEBUG(0,("Failed to create foreignSecurityPrincipal " "record %s: %s\n", diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index 215217bfef..d80ff34d0f 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -1136,7 +1136,7 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx, } /* create the secret */ - ret = samdb_add(ldb, tmp_mem, msg); + ret = ldb_add(ldb, msg); if (ret != 0) { r->out.error_string = talloc_asprintf(mem_ctx, "Failed to create secret record %s", ldb_dn_get_linearized(msg->dn)); diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c index 86e5af2d6e..8ec058d845 100644 --- a/source4/libnet/libnet_samsync_ldb.c +++ b/source4/libnet/libnet_samsync_ldb.c @@ -101,7 +101,7 @@ static NTSTATUS samsync_ldb_add_foreignSecurityPrincipal(TALLOC_CTX *mem_ctx, *fsp_dn = msg->dn; /* create the alias */ - ret = samdb_add(state->sam_ldb, mem_ctx, msg); + ret = ldb_add(state->sam_ldb, msg); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to create foreignSecurityPrincipal " "record %s: %s", @@ -429,7 +429,7 @@ static NTSTATUS samsync_ldb_handle_user(TALLOC_CTX *mem_ctx, } } - ret = samdb_add(state->sam_ldb, mem_ctx, msg); + ret = ldb_add(state->sam_ldb, msg); if (ret != 0) { struct ldb_dn *first_try_dn = msg->dn; /* Try again with the default DN */ @@ -440,7 +440,7 @@ static NTSTATUS samsync_ldb_handle_user(TALLOC_CTX *mem_ctx, return NT_STATUS_INTERNAL_DB_CORRUPTION; } else { msg->dn = talloc_steal(msg, remote_msgs[0]->dn); - ret = samdb_add(state->sam_ldb, mem_ctx, msg); + ret = ldb_add(state->sam_ldb, msg); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to create user record. Tried both %s and %s: %s", ldb_dn_get_linearized(first_try_dn), @@ -493,7 +493,7 @@ static NTSTATUS samsync_ldb_delete_user(TALLOC_CTX *mem_ctx, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - ret = samdb_delete(state->sam_ldb, mem_ctx, msgs[0]->dn); + ret = ldb_delete(state->sam_ldb, msgs[0]->dn); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to delete user record %s: %s", ldb_dn_get_linearized(msgs[0]->dn), @@ -582,7 +582,7 @@ static NTSTATUS samsync_ldb_handle_group(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - ret = samdb_add(state->sam_ldb, mem_ctx, msg); + ret = ldb_add(state->sam_ldb, msg); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to create group record %s: %s", ldb_dn_get_linearized(msg->dn), @@ -632,7 +632,7 @@ static NTSTATUS samsync_ldb_delete_group(TALLOC_CTX *mem_ctx, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - ret = samdb_delete(state->sam_ldb, mem_ctx, msgs[0]->dn); + ret = ldb_delete(state->sam_ldb, msgs[0]->dn); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to delete group record %s: %s", ldb_dn_get_linearized(msgs[0]->dn), @@ -796,7 +796,7 @@ static NTSTATUS samsync_ldb_handle_alias(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - ret = samdb_add(state->sam_ldb, mem_ctx, msg); + ret = ldb_add(state->sam_ldb, msg); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to create alias record %s: %s", ldb_dn_get_linearized(msg->dn), @@ -841,7 +841,7 @@ static NTSTATUS samsync_ldb_delete_alias(TALLOC_CTX *mem_ctx, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - ret = samdb_delete(state->sam_ldb, mem_ctx, msgs[0]->dn); + ret = ldb_delete(state->sam_ldb, msgs[0]->dn); if (ret != 0) { *error_string = talloc_asprintf(mem_ctx, "Failed to delete alias record %s: %s", ldb_dn_get_linearized(msgs[0]->dn), diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c index e59d84ff91..2a163943ad 100644 --- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c +++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c @@ -318,7 +318,7 @@ static WERROR sptr_AddPrintServerForm(struct ntptr_GenericHandle *server, TALLOC return WERR_UNKNOWN_LEVEL; } - ret = samdb_add(sptr_db, mem_ctx, msg); + ret = ldb_add(sptr_db, msg); if (ret != 0) { return WERR_FOOBAR; } @@ -424,7 +424,7 @@ static WERROR sptr_DeletePrintServerForm(struct ntptr_GenericHandle *server, TAL return WERR_FOOBAR; } - ret = samdb_delete(sptr_db, mem_ctx, msgs[0]->dn); + ret = ldb_delete(sptr_db, msgs[0]->dn); if (ret != 0) { return WERR_FOOBAR; } diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 21c4d36e9b..a0663a588d 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -431,7 +431,7 @@ static WERROR dcesrv_drsuapi_DsWriteAccountSpn(struct dcesrv_call_state *dce_cal /* Apply to database */ - ret = samdb_modify(b_state->sam_ctx, mem_ctx, msg); + ret = ldb_modify(b_state->sam_ctx, msg); if (ret != 0) { DEBUG(0,("Failed to modify SPNs on %s: %s\n", ldb_dn_get_linearized(msg->dn), diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 0b426145c6..93c1ee9e4d 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -100,7 +100,8 @@ static NTSTATUS dcesrv_lsa_Delete(struct dcesrv_call_state *dce_call, TALLOC_CTX DCESRV_PULL_HANDLE(h, r->in.handle, DCESRV_HANDLE_ANY); if (h->wire_handle.handle_type == LSA_HANDLE_SECRET) { struct lsa_secret_state *secret_state = h->data; - ret = samdb_delete(secret_state->sam_ldb, mem_ctx, secret_state->secret_dn); + ret = ldb_delete(secret_state->sam_ldb, + secret_state->secret_dn); talloc_free(h); if (ret != 0) { return NT_STATUS_INVALID_HANDLE; @@ -109,8 +110,8 @@ static NTSTATUS dcesrv_lsa_Delete(struct dcesrv_call_state *dce_call, TALLOC_CTX return NT_STATUS_OK; } else if (h->wire_handle.handle_type == LSA_HANDLE_TRUSTED_DOMAIN) { struct lsa_trusted_domain_state *trusted_domain_state = h->data; - ret = samdb_delete(trusted_domain_state->policy->sam_ldb, mem_ctx, - trusted_domain_state->trusted_domain_dn); + ret = ldb_delete(trusted_domain_state->policy->sam_ldb, + trusted_domain_state->trusted_domain_dn); talloc_free(h); if (ret != 0) { return NT_STATUS_INVALID_HANDLE; @@ -1478,7 +1479,7 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_ return NT_STATUS_OK; } - ret = samdb_modify(state->sam_ldb, mem_ctx, msg); + ret = ldb_modify(state->sam_ldb, msg); if (ret != 0) { if (ldb_flag == LDB_FLAG_MOD_DELETE && ret == LDB_ERR_NO_SUCH_ATTRIBUTE) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; @@ -1747,7 +1748,7 @@ static NTSTATUS dcesrv_lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALL secret_state->secret_dn = talloc_reference(secret_state, msg->dn); /* create the secret */ - ret = samdb_add(secret_state->sam_ldb, mem_ctx, msg); + ret = ldb_add(secret_state->sam_ldb, msg); if (ret != 0) { DEBUG(0,("Failed to create secret record %s: %s\n", ldb_dn_get_linearized(msg->dn), diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index e0d965da9e..9d208f8444 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -1021,7 +1021,7 @@ static NTSTATUS dcesrv_samr_CreateDomainGroup(struct dcesrv_call_state *dce_call samdb_msg_add_string(d_state->sam_ctx, mem_ctx, msg, "objectClass", "group"); /* create the group */ - ret = samdb_add(d_state->sam_ctx, mem_ctx, msg); + ret = ldb_add(d_state->sam_ctx, msg); switch (ret) { case LDB_SUCCESS: break; @@ -1303,7 +1303,7 @@ static NTSTATUS dcesrv_samr_CreateUser2(struct dcesrv_call_state *dce_call, TALL /* Start a transaction, so we can query and do a subsequent atomic modify */ /* create the user */ - ret = samdb_add(d_state->sam_ctx, mem_ctx, msg); + ret = ldb_add(d_state->sam_ctx, msg); switch (ret) { case LDB_SUCCESS: break; @@ -1586,7 +1586,7 @@ static NTSTATUS dcesrv_samr_CreateDomAlias(struct dcesrv_call_state *dce_call, T samdb_msg_add_int(d_state->sam_ctx, mem_ctx, msg, "groupType", GTYPE_SECURITY_DOMAIN_LOCAL_GROUP); /* create the alias */ - ret = samdb_add(d_state->sam_ctx, mem_ctx, msg); + ret = ldb_add(d_state->sam_ctx, msg); switch (ret) { case LDB_SUCCESS: break; @@ -2263,7 +2263,7 @@ static NTSTATUS dcesrv_samr_DeleteDomainGroup(struct dcesrv_call_state *dce_call a_state = h->data; - ret = samdb_delete(a_state->sam_ctx, mem_ctx, a_state->account_dn); + ret = ldb_delete(a_state->sam_ctx, a_state->account_dn); if (ret != 0) { return NT_STATUS_UNSUCCESSFUL; } @@ -2637,7 +2637,7 @@ static NTSTATUS dcesrv_samr_DeleteDomAlias(struct dcesrv_call_state *dce_call, T a_state = h->data; - ret = samdb_delete(a_state->sam_ctx, mem_ctx, a_state->account_dn); + ret = ldb_delete(a_state->sam_ctx, a_state->account_dn); if (ret != 0) { return NT_STATUS_UNSUCCESSFUL; } @@ -2910,7 +2910,7 @@ static NTSTATUS dcesrv_samr_DeleteUser(struct dcesrv_call_state *dce_call, TALLO a_state = h->data; - ret = samdb_delete(a_state->sam_ctx, mem_ctx, a_state->account_dn); + ret = ldb_delete(a_state->sam_ctx, a_state->account_dn); if (ret != 0) { return NT_STATUS_UNSUCCESSFUL; } |