summaryrefslogtreecommitdiff
path: root/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/drsuapi/dcesrv_drsuapi.c')
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c77
1 files changed, 1 insertions, 76 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 6a6bc8be7e..96cb58ef3e 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -60,7 +60,7 @@ static WERROR dcesrv_drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_C
/* if this is a DC connecting, give them system level access */
werr = drs_security_level_check(dce_call, NULL);
if (W_ERROR_IS_OK(werr)) {
- DEBUG(2,(__location__ ": doing DsBind with system_session\n"));
+ DEBUG(3,(__location__ ": doing DsBind with system_session\n"));
auth_info = system_session(dce_call->conn->dce_ctx->lp_ctx);
} else {
auth_info = dce_call->conn->auth_state.session_info;
@@ -378,81 +378,6 @@ static WERROR dcesrv_drsuapi_DsCrackNames(struct dcesrv_call_state *dce_call, TA
return WERR_UNKNOWN_LEVEL;
}
-/*
- drsuapi_DsWriteAccountSpn
-*/
-static WERROR dcesrv_drsuapi_DsWriteAccountSpn(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
- struct drsuapi_DsWriteAccountSpn *r)
-{
- struct drsuapi_bind_state *b_state;
- struct dcesrv_handle *h;
-
- *r->out.level_out = r->in.level;
-
- DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE);
- b_state = h->data;
-
- r->out.res = talloc(mem_ctx, union drsuapi_DsWriteAccountSpnResult);
- W_ERROR_HAVE_NO_MEMORY(r->out.res);
-
- switch (r->in.level) {
- case 1: {
- struct drsuapi_DsWriteAccountSpnRequest1 *req;
- struct ldb_message *msg;
- int count, i, ret;
- req = &r->in.req->req1;
- count = req->count;
-
- msg = ldb_msg_new(mem_ctx);
- if (msg == NULL) {
- return WERR_NOMEM;
- }
-
- msg->dn = ldb_dn_new(msg, b_state->sam_ctx, req->object_dn);
- if ( ! ldb_dn_validate(msg->dn)) {
- r->out.res->res1.status = WERR_OK;
- return WERR_OK;
- }
-
- /* construct mods */
- for (i = 0; i < count; i++) {
- samdb_msg_add_string(b_state->sam_ctx,
- msg, msg, "servicePrincipalName",
- req->spn_names[i].str);
- }
- for (i=0;i<msg->num_elements;i++) {
- switch (req->operation) {
- case DRSUAPI_DS_SPN_OPERATION_ADD:
- msg->elements[i].flags = LDB_FLAG_MOD_ADD;
- break;
- case DRSUAPI_DS_SPN_OPERATION_REPLACE:
- msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
- break;
- case DRSUAPI_DS_SPN_OPERATION_DELETE:
- msg->elements[i].flags = LDB_FLAG_MOD_DELETE;
- break;
- }
- }
-
- /* Apply to database */
-
- 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),
- ldb_errstring(b_state->sam_ctx)));
- r->out.res->res1.status = WERR_ACCESS_DENIED;
- } else {
- r->out.res->res1.status = WERR_OK;
- }
-
- return WERR_OK;
- }
- }
-
- return WERR_UNKNOWN_LEVEL;
-}
-
/*
drsuapi_DsRemoveDSServer