summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-05 11:20:21 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-10 09:19:04 +0200
commit966faef9c61d2ec02d75fc3ccc82a61524fb77e4 (patch)
tree7650f21b43653e0f49291332e93a1269bbcd99d6 /source3/libsmb
parentc81b6f7448d7f945635784de645bea4f7f2e230f (diff)
downloadsamba-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/libsmb')
-rw-r--r--source3/libsmb/auth_generic.c15
1 files changed, 8 insertions, 7 deletions
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);