diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-08-05 11:20:21 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-08-10 09:19:04 +0200 |
commit | 966faef9c61d2ec02d75fc3ccc82a61524fb77e4 (patch) | |
tree | 7650f21b43653e0f49291332e93a1269bbcd99d6 /source3/auth | |
parent | c81b6f7448d7f945635784de645bea4f7f2e230f (diff) | |
download | samba-966faef9c61d2ec02d75fc3ccc82a61524fb77e4.tar.gz samba-966faef9c61d2ec02d75fc3ccc82a61524fb77e4.tar.bz2 samba-966faef9c61d2ec02d75fc3ccc82a61524fb77e4.zip |
auth/gensec: treat struct gensec_security_ops as const if possible.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_generic.c | 15 |
1 files changed, 8 insertions, 7 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 |