diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-02-20 14:17:34 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-03-29 02:37:25 +0200 |
commit | d82ac32eb744a0e3883b1d09832131ff9bc9bcad (patch) | |
tree | eb9ff6764aa2f101b8acc38512989a95fbf3ccb1 /source3/auth | |
parent | af9d4807399ff73a5d4baab713ef3731de0f5d62 (diff) | |
download | samba-d82ac32eb744a0e3883b1d09832131ff9bc9bcad.tar.gz |
s3-auth: Pass service_description into gensec via auth_generic_prepare()
This allows the GENSEC service description to be set from the various callers
that go via this function.
The RPC service description is the name of the interface from the IDL.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_generic.c | 9 | ||||
-rw-r--r-- | source3/auth/proto.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c index b7b9527f976..70eb5145932 100644 --- a/source3/auth/auth_generic.c +++ b/source3/auth/auth_generic.c @@ -233,6 +233,7 @@ NTSTATUS make_auth4_context(TALLOC_CTX *mem_ctx, struct auth4_context **auth4_co NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, const struct tsocket_address *remote_address, + const char *service_description, struct gensec_security **gensec_security_out) { struct gensec_security *gensec_security; @@ -377,6 +378,14 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, return nt_status; } + nt_status = gensec_set_target_service_description(gensec_security, + service_description); + + if (!NT_STATUS_IS_OK(nt_status)) { + TALLOC_FREE(tmp_ctx); + return nt_status; + } + *gensec_security_out = talloc_steal(mem_ctx, gensec_security); TALLOC_FREE(tmp_ctx); return NT_STATUS_OK; diff --git a/source3/auth/proto.h b/source3/auth/proto.h index c5f6ade1ea4..7df30048d82 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -106,6 +106,7 @@ NTSTATUS auth_domain_init(void); NTSTATUS make_auth4_context(TALLOC_CTX *mem_ctx, struct auth4_context **auth4_context_out); NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx, const struct tsocket_address *remote_address, + const char *service_description, struct gensec_security **gensec_security_out); NTSTATUS auth_check_password_session_info(struct auth4_context *auth_context, |