Revert "smb1cli_conn_set_encryption talloc move s3-libsmb: Convert struct smb_trans_e...
authorStefan Metzmacher <metze@samba.org>
Mon, 23 Jan 2012 14:49:12 +0000 (15:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 May 2012 16:47:04 +0000 (18:47 +0200)
This reverts commit 512dbd4e05a993440887bdaeb9e00e3ef0899498.

libcli/smb/smbXcli_base.c
libcli/smb/smbXcli_base.h
source3/libsmb/clifsinfo.c

index 270b9c338c61da779214dbf5389268a60143f897..fe85b3168054e29c1dcd19d476b2613799bac802 100644 (file)
@@ -214,13 +214,10 @@ static int smbXcli_conn_destructor(struct smbXcli_conn *conn)
                DLIST_REMOVE(conn->sessions, conn->sessions);
        }
 
-<<<<<<< HEAD
        if (conn->smb1.trans_enc) {
                TALLOC_FREE(conn->smb1.trans_enc);
        }
 
-=======
->>>>>>> 7efc635... s3-libsmb: Convert struct smb_trans_enc_state to talloc
        return 0;
 }
 
@@ -598,18 +595,13 @@ bool smb1cli_conn_signing_is_active(struct smbXcli_conn *conn)
 }
 
 void smb1cli_conn_set_encryption(struct smbXcli_conn *conn,
-                                struct smb_trans_enc_state **es)
+                                struct smb_trans_enc_state *es)
 {
        /* Replace the old state, if any. */
-<<<<<<< HEAD
        if (conn->smb1.trans_enc) {
                TALLOC_FREE(conn->smb1.trans_enc);
        }
        conn->smb1.trans_enc = es;
-=======
-       TALLOC_FREE(conn->smb1.trans_enc);
-       conn->smb1.trans_enc = talloc_move(conn, es);
->>>>>>> 7efc635... s3-libsmb: Convert struct smb_trans_enc_state to talloc
 }
 
 bool smb1cli_conn_encryption_on(struct smbXcli_conn *conn)
index 64d409ab8b7778bcea85f392fc4b223670d892ef..91dc2448351800e94e860970ef021bf54cd4c4e6 100644 (file)
@@ -82,7 +82,7 @@ bool smb1cli_conn_check_signing(struct smbXcli_conn *conn,
 bool smb1cli_conn_signing_is_active(struct smbXcli_conn *conn);
 
 void smb1cli_conn_set_encryption(struct smbXcli_conn *conn,
-                                struct smb_trans_enc_state **es);
+                                struct smb_trans_enc_state *es);
 bool smb1cli_conn_encryption_on(struct smbXcli_conn *conn);
 
 bool smb1cli_is_andx_req(uint8_t cmd);
index 019db764b8414cba73b0ef35971b8caeb97e080a..ad5128e7f8b5c52d260c03b0464eab1ae6c24e39 100644 (file)
@@ -646,7 +646,8 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
                 * gensec_security a talloc child */
                es->gensec_security = talloc_move(NULL,
                                                  &auth_generic_state->gensec_security);
-               smb1cli_conn_set_encryption(cli->conn, &es);
+               smb1cli_conn_set_encryption(cli->conn, es);
+               es = NULL;
        }
 
   fail:
@@ -665,13 +666,8 @@ NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
        DATA_BLOB param_out = data_blob_null;
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
        struct auth_generic_state *auth_generic_state;
-<<<<<<< HEAD
        struct smb_trans_enc_state *es = talloc_zero(NULL, struct smb_trans_enc_state);
-=======
-       struct smb_trans_enc_state *es;
->>>>>>> 7efc635... s3-libsmb: Convert struct smb_trans_enc_state to talloc
 
-       es = talloc_zero(NULL, struct smb_trans_enc_state);
        if (!es) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -735,8 +731,8 @@ NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
                 * gensec_security a talloc child */
                es->gensec_security = talloc_move(es,
                                                  &auth_generic_state->gensec_security);
-               TALLOC_FREE(auth_generic_state);
-               smb1cli_conn_set_encryption(cli->conn, &es);
+               smb1cli_conn_set_encryption(cli->conn, es);
+               es = NULL;
        }
 fail:
        TALLOC_FREE(es);