s3-auth rename auth_ntlmssp_steal_session_info()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 1 Aug 2011 22:53:10 +0000 (08:53 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Aug 2011 08:48:05 +0000 (18:48 +1000)
There is no longer any theft of memory as the underlying routines now
produce a new auth_session_info for this caller, allocating it
on the supplied memory context.

Andrew Bartlett

source3/auth/auth_ntlmssp.c
source3/auth/proto.h
source3/rpc_server/dcesrv_ntlmssp.c
source3/smbd/sesssetup.c
source3/smbd/smb2_sesssetup.c

index fc197ce605a407727fc6008761212202808d07a5..584596963154c947d535ac5b7a7d4b61af8ba32e 100644 (file)
@@ -28,9 +28,9 @@
 #include "../lib/tsocket/tsocket.h"
 #include "auth/gensec/gensec.h"
 
-NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
-                                       struct auth_ntlmssp_state *auth_ntlmssp_state,
-                                       struct auth_session_info **session_info)
+NTSTATUS auth_ntlmssp_session_info(TALLOC_CTX *mem_ctx,
+                                  struct auth_ntlmssp_state *auth_ntlmssp_state,
+                                  struct auth_session_info **session_info)
 {
        NTSTATUS nt_status;
        if (auth_ntlmssp_state->gensec_security) {
index 82bf203b5748b96ecca631995c96a8d27aa4e8f1..239e8ff45481e31a33f1a6d15c22052d470f4894 100644 (file)
@@ -69,9 +69,9 @@ NTSTATUS auth_netlogond_init(void);
 
 /* The following definitions come from auth/auth_ntlmssp.c  */
 
-NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
-                                        struct auth_ntlmssp_state *auth_ntlmssp_state,
-                                        struct auth_session_info **session_info);
+NTSTATUS auth_ntlmssp_session_info(TALLOC_CTX *mem_ctx,
+                                  struct auth_ntlmssp_state *auth_ntlmssp_state,
+                                  struct auth_session_info **session_info);
 NTSTATUS auth_ntlmssp_prepare(const struct tsocket_address *remote_address,
                              struct auth_ntlmssp_state **auth_ntlmssp_state);
 NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state *auth_ntlmssp_state);
index f9fbc060c524c420a60e00bcb0e28e64ac9c85ab..a31bb3628425c821eda456e4e164d470800e09f4 100644 (file)
@@ -117,7 +117,7 @@ NTSTATUS ntlmssp_server_get_user_info(struct auth_ntlmssp_state *ctx,
 {
        NTSTATUS status;
 
-       status = auth_ntlmssp_steal_session_info(mem_ctx, ctx, session_info);
+       status = auth_ntlmssp_session_info(mem_ctx, ctx, session_info);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, (__location__ ": Failed to get authenticated user "
                          "info: %s\n", nt_errstr(status)));
index a3440a62f69bea14cb44f3db2adaee3c217dbe32..8b133b4a541e1c2df708c21a3b9e7d8ba4dfcb69 100644 (file)
@@ -431,7 +431,7 @@ static void reply_spnego_ntlmssp(struct smb_request *req,
        struct smbd_server_connection *sconn = req->sconn;
 
        if (NT_STATUS_IS_OK(nt_status)) {
-               nt_status = auth_ntlmssp_steal_session_info(talloc_tos(),
+               nt_status = auth_ntlmssp_session_info(talloc_tos(),
                                        (*auth_ntlmssp_state), &session_info);
        }
 
index d1022cd2cfa80b2547f1be2ec4c1504514ec52e8..6517fb6d004c4f53917d9795015bf5acd8692983 100644 (file)
@@ -591,9 +591,9 @@ static NTSTATUS smbd_smb2_spnego_auth(struct smbd_smb2_session *session,
        /* If status is NT_STATUS_OK then we need to get the token.
         * Map to guest is now internal to auth_ntlmssp */
        if (NT_STATUS_IS_OK(status)) {
-               status = auth_ntlmssp_steal_session_info(session,
-                               session->auth_ntlmssp_state,
-                               &session->session_info);
+               status = auth_ntlmssp_session_info(session,
+                                                  session->auth_ntlmssp_state,
+                                                  &session->session_info);
        }
 
        if (!NT_STATUS_IS_OK(status) &&
@@ -672,9 +672,9 @@ static NTSTATUS smbd_smb2_raw_ntlmssp_auth(struct smbd_smb2_session *session,
                return status;
        }
 
-       status = auth_ntlmssp_steal_session_info(session,
-                                                session->auth_ntlmssp_state,
-                                                &session->session_info);
+       status = auth_ntlmssp_session_info(session,
+                                          session->auth_ntlmssp_state,
+                                          &session->session_info);
 
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(session->auth_ntlmssp_state);