diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_generic.c | 15 | ||||
-rw-r--r-- | source3/libads/authdata.c | 11 | ||||
-rw-r--r-- | source3/libsmb/auth_generic.c | 15 | ||||
-rw-r--r-- | source3/utils/ntlm_auth.c | 22 |
4 files changed, 33 insertions, 30 deletions
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c index a2ba4e3257..e15c87edfc 100644 --- a/source3/auth/auth_generic.c +++ b/source3/auth/auth_generic.c @@ -203,6 +203,7 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, return nt_status; } } else { + const struct gensec_security_ops **backends = NULL; struct gensec_settings *gensec_settings; struct loadparm_context *lp_ctx; size_t idx = 0; @@ -259,24 +260,24 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - gensec_settings->backends = talloc_zero_array(gensec_settings, - struct gensec_security_ops *, 4); - if (gensec_settings->backends == NULL) { + backends = talloc_zero_array(gensec_settings, + const struct gensec_security_ops *, 4); + if (backends == NULL) { TALLOC_FREE(tmp_ctx); return NT_STATUS_NO_MEMORY; } + gensec_settings->backends = backends; gensec_init(); /* These need to be in priority order, krb5 before NTLMSSP */ #if defined(HAVE_KRB5) - gensec_settings->backends[idx++] = &gensec_gse_krb5_security_ops; + backends[idx++] = &gensec_gse_krb5_security_ops; #endif - gensec_settings->backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_NTLMSSP); + backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_NTLMSSP); - gensec_settings->backends[idx++] = gensec_security_by_oid(NULL, - GENSEC_OID_SPNEGO); + backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_SPNEGO); /* * This is anonymous for now, because we just use it diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c index 582917da01..801e551edb 100644 --- a/source3/libads/authdata.c +++ b/source3/libads/authdata.c @@ -111,7 +111,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx, const char *cc = "MEMORY:kerberos_return_pac"; struct auth_session_info *session_info; struct gensec_security *gensec_server_context; - + const struct gensec_security_ops **backends; struct gensec_settings *gensec_settings; size_t idx = 0; struct auth4_context *auth_context; @@ -230,16 +230,17 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx, goto out; } - gensec_settings->backends = talloc_zero_array(gensec_settings, - struct gensec_security_ops *, 2); - if (gensec_settings->backends == NULL) { + backends = talloc_zero_array(gensec_settings, + const struct gensec_security_ops *, 2); + if (backends == NULL) { status = NT_STATUS_NO_MEMORY; goto out; } + gensec_settings->backends = backends; gensec_init(); - gensec_settings->backends[idx++] = &gensec_gse_krb5_security_ops; + backends[idx++] = &gensec_gse_krb5_security_ops; status = gensec_server_start(tmp_ctx, gensec_settings, auth_context, &gensec_server_context); diff --git a/source3/libsmb/auth_generic.c b/source3/libsmb/auth_generic.c index ba0a0ce977..e30c1b7e0f 100644 --- a/source3/libsmb/auth_generic.c +++ b/source3/libsmb/auth_generic.c @@ -54,6 +54,7 @@ NTSTATUS auth_generic_client_prepare(TALLOC_CTX *mem_ctx, struct auth_generic_st NTSTATUS nt_status; size_t idx = 0; struct gensec_settings *gensec_settings; + const struct gensec_security_ops **backends = NULL; struct loadparm_context *lp_ctx; ans = talloc_zero(mem_ctx, struct auth_generic_state); @@ -76,24 +77,24 @@ NTSTATUS auth_generic_client_prepare(TALLOC_CTX *mem_ctx, struct auth_generic_st return NT_STATUS_NO_MEMORY; } - gensec_settings->backends = talloc_zero_array(gensec_settings, - struct gensec_security_ops *, 4); - if (gensec_settings->backends == NULL) { + backends = talloc_zero_array(gensec_settings, + const struct gensec_security_ops *, 4); + if (backends == NULL) { TALLOC_FREE(ans); return NT_STATUS_NO_MEMORY; } + gensec_settings->backends = backends; gensec_init(); /* These need to be in priority order, krb5 before NTLMSSP */ #if defined(HAVE_KRB5) - gensec_settings->backends[idx++] = &gensec_gse_krb5_security_ops; + backends[idx++] = &gensec_gse_krb5_security_ops; #endif - gensec_settings->backends[idx++] = &gensec_ntlmssp3_client_ops; + backends[idx++] = &gensec_ntlmssp3_client_ops; - gensec_settings->backends[idx++] = gensec_security_by_oid(NULL, - GENSEC_OID_SPNEGO); + backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_SPNEGO); nt_status = gensec_client_start(ans, &ans->gensec_security, gensec_settings); diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index 9e0d7b812b..751f49cdc2 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -1035,7 +1035,7 @@ static NTSTATUS ntlm_auth_start_ntlmssp_server(TALLOC_CTX *mem_ctx, NTSTATUS nt_status; TALLOC_CTX *tmp_ctx; - + const struct gensec_security_ops **backends; struct gensec_settings *gensec_settings; size_t idx = 0; struct cli_credentials *server_credentials; @@ -1079,26 +1079,26 @@ static NTSTATUS ntlm_auth_start_ntlmssp_server(TALLOC_CTX *mem_ctx, gensec_settings->server_dns_name = strlower_talloc(gensec_settings, get_mydnsfullname()); - gensec_settings->backends = talloc_zero_array(gensec_settings, - struct gensec_security_ops *, 4); + backends = talloc_zero_array(gensec_settings, + const struct gensec_security_ops *, 4); - if (gensec_settings->backends == NULL) { + if (backends == NULL) { TALLOC_FREE(tmp_ctx); return NT_STATUS_NO_MEMORY; } - + gensec_settings->backends = backends; + gensec_init(); /* These need to be in priority order, krb5 before NTLMSSP */ #if defined(HAVE_KRB5) - gensec_settings->backends[idx++] = &gensec_gse_krb5_security_ops; + backends[idx++] = &gensec_gse_krb5_security_ops; #endif - - gensec_settings->backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_NTLMSSP); - gensec_settings->backends[idx++] = gensec_security_by_oid(NULL, - GENSEC_OID_SPNEGO); - + backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_NTLMSSP); + + backends[idx++] = gensec_security_by_oid(NULL, GENSEC_OID_SPNEGO); + /* * This is anonymous for now, because we just use it * to set the kerberos state at the moment |