r22344: Correctly create sub-struct for GSS encryption.
authorJeremy Allison <jra@samba.org>
Wed, 18 Apr 2007 21:56:18 +0000 (21:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:27 +0000 (12:19 -0500)
Jeremy.
(This used to be commit 197c90ec78545e7e3c03ff5787839ca134f3036a)

source3/libsmb/clifsinfo.c

index be988a433f19387ad0241f03e293da7ccb6d3f6b..1ec1aea5af714899eb60d249760f1e22a7ce64cb 100644 (file)
@@ -368,6 +368,21 @@ static struct smb_trans_enc_state *make_cli_enc_state(enum smb_trans_enc_type sm
        }
        ZERO_STRUCTP(es);
        es->smb_enc_type = smb_enc_type;
+
+       if (smb_enc_type == SMB_TRANS_ENC_GSS) {
+#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5)
+               es->s.gss_state = SMB_MALLOC_P(struct smb_tran_enc_state_gss);
+               if (!es->s.gss_state) {
+                       SAFE_FREE(es);
+                       return NULL;
+               }
+               ZERO_STRUCTP(es->s.gss_state);
+#else
+               DEBUG(0,("make_cli_enc_state: no krb5 compiled.\n");
+               SAFE_FREE(es);
+               return NULL;
+#endif
+       }
        return es;
 }