s4:rpc_server/samr: make use dcesrv_call_session_info()
authorStefan Metzmacher <metze@samba.org>
Sat, 3 Nov 2018 00:19:51 +0000 (01:19 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2019 02:13:33 +0000 (03:13 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/samr/samr_password.c

index d7d2fa4..96f6810 100644 (file)
@@ -210,6 +210,8 @@ exit:
 static NTSTATUS dcesrv_samr_Connect(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
                             struct samr_Connect *r)
 {
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(dce_call);
        struct samr_connect_state *c_state;
        struct dcesrv_handle *handle;
 
@@ -224,7 +226,7 @@ static NTSTATUS dcesrv_samr_Connect(struct dcesrv_call_state *dce_call, TALLOC_C
        c_state->sam_ctx = samdb_connect(c_state,
                                         dce_call->event_ctx,
                                         dce_call->conn->dce_ctx->lp_ctx,
-                                        dce_call->conn->auth_state.session_info,
+                                        session_info,
                                         dce_call->conn->remote_address,
                                         0);
        if (c_state->sam_ctx == NULL) {
@@ -4658,6 +4660,8 @@ static NTSTATUS dcesrv_samr_RemoveMultipleMembersFromAlias(struct dcesrv_call_st
 static NTSTATUS dcesrv_samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
                                  struct samr_GetDomPwInfo *r)
 {
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(dce_call);
        struct ldb_message **msgs;
        int ret;
        const char * const attrs[] = {"minPwdLength", "pwdProperties", NULL };
@@ -4668,7 +4672,7 @@ static NTSTATUS dcesrv_samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TAL
        sam_ctx = samdb_connect(mem_ctx,
                                dce_call->event_ctx,
                                dce_call->conn->dce_ctx->lp_ctx,
-                               dce_call->conn->auth_state.session_info,
+                               session_info,
                                dce_call->conn->remote_address,
                                0);
        if (sam_ctx == NULL) {
index 4c65698..08a499e 100644 (file)
@@ -98,6 +98,8 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
                                            TALLOC_CTX *mem_ctx,
                                            struct samr_OemChangePasswordUser2 *r)
 {
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(dce_call);
        NTSTATUS status = NT_STATUS_WRONG_PASSWORD;
        DATA_BLOB new_password, new_unicode_password;
        char *new_pass;
@@ -220,7 +222,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
        sam_ctx = samdb_connect(mem_ctx,
                                dce_call->event_ctx,
                                dce_call->conn->dce_ctx->lp_ctx,
-                               dce_call->conn->auth_state.session_info,
+                               session_info,
                                dce_call->conn->remote_address,
                                0);
        if (sam_ctx == NULL) {
@@ -295,6 +297,8 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
                                         TALLOC_CTX *mem_ctx,
                                         struct samr_ChangePasswordUser3 *r)
 {
+       struct auth_session_info *session_info =
+               dcesrv_call_session_info(dce_call);
        NTSTATUS status = NT_STATUS_WRONG_PASSWORD;
        DATA_BLOB new_password;
        struct ldb_context *sam_ctx = NULL;
@@ -423,7 +427,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
        sam_ctx = samdb_connect(mem_ctx,
                                dce_call->event_ctx,
                                dce_call->conn->dce_ctx->lp_ctx,
-                               dce_call->conn->auth_state.session_info,
+                               session_info,
                                dce_call->conn->remote_address,
                                0);
        if (sam_ctx == NULL) {