diff options
Diffstat (limited to 'source4/auth/gensec')
-rw-r--r-- | source4/auth/gensec/gensec.c | 17 | ||||
-rw-r--r-- | source4/auth/gensec/gensec.h | 1 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c index 7e6a83d51f..7dd3eac3b7 100644 --- a/source4/auth/gensec/gensec.c +++ b/source4/auth/gensec/gensec.c @@ -1320,21 +1320,28 @@ NTSTATUS gensec_generate_session_info(TALLOC_CTX *mem_ctx, struct auth_session_info **session_info) { NTSTATUS nt_status; - uint32_t flags = AUTH_SESSION_INFO_DEFAULT_GROUPS; + uint32_t session_info_flags = 0; + + if (gensec_security->want_features & GENSEC_FEATURE_UNIX_TOKEN) { + session_info_flags |= AUTH_SESSION_INFO_UNIX_TOKEN; + } + + session_info_flags |= AUTH_SESSION_INFO_DEFAULT_GROUPS; if (user_info_dc->info->authenticated) { - flags |= AUTH_SESSION_INFO_AUTHENTICATED; + session_info_flags |= AUTH_SESSION_INFO_AUTHENTICATED; } + if (gensec_security->auth_context) { nt_status = gensec_security->auth_context->generate_session_info(mem_ctx, gensec_security->auth_context, user_info_dc, - flags, + session_info_flags, session_info); } else { - flags |= AUTH_SESSION_INFO_SIMPLE_PRIVILEGES; + session_info_flags |= AUTH_SESSION_INFO_SIMPLE_PRIVILEGES; nt_status = auth_generate_session_info(mem_ctx, NULL, NULL, - user_info_dc, flags, + user_info_dc, session_info_flags, session_info); } return nt_status; diff --git a/source4/auth/gensec/gensec.h b/source4/auth/gensec/gensec.h index e42b4aa5d2..322adce2ea 100644 --- a/source4/auth/gensec/gensec.h +++ b/source4/auth/gensec/gensec.h @@ -59,6 +59,7 @@ struct gensec_target { #define GENSEC_FEATURE_DATAGRAM_MODE 0x00000020 #define GENSEC_FEATURE_SIGN_PKT_HEADER 0x00000040 #define GENSEC_FEATURE_NEW_SPNEGO 0x00000080 +#define GENSEC_FEATURE_UNIX_TOKEN 0x00000100 /* GENSEC mode */ enum gensec_role |