From 039ad5c9ad4c4b930d2fa7857cf5fb4dc547e181 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 21 Jul 2017 12:29:31 +0200 Subject: [PATCH] winbindd: allow all possible logon levels in wb_irpc_SamLogon() We should just try to find the correct domain to forward the request, all logic of not implementing serveral logon levels belongs to the _winbind_SamLogon() implementation. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- source3/winbindd/winbindd_irpc.c | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/source3/winbindd/winbindd_irpc.c b/source3/winbindd/winbindd_irpc.c index c6c786c8be1..ccff769170a 100644 --- a/source3/winbindd/winbindd_irpc.c +++ b/source3/winbindd/winbindd_irpc.c @@ -133,11 +133,42 @@ static NTSTATUS wb_irpc_SamLogon(struct irpc_message *msg, struct winbind_SamLogon *req) { struct winbindd_domain *domain; - const char *target_domain_name; - if (req->in.logon.network == NULL) { + struct netr_IdentityInfo *identity_info; + const char *target_domain_name = NULL; + + switch (req->in.logon_level) { + case NetlogonInteractiveInformation: + case NetlogonServiceInformation: + case NetlogonInteractiveTransitiveInformation: + case NetlogonServiceTransitiveInformation: + if (req->in.logon.password == NULL) { + return NT_STATUS_REQUEST_NOT_ACCEPTED; + } + identity_info = &req->in.logon.password->identity_info; + break; + + case NetlogonNetworkInformation: + case NetlogonNetworkTransitiveInformation: + if (req->in.logon.network == NULL) { + return NT_STATUS_REQUEST_NOT_ACCEPTED; + } + + identity_info = &req->in.logon.network->identity_info; + break; + + case NetlogonGenericInformation: + if (req->in.logon.generic == NULL) { + return NT_STATUS_REQUEST_NOT_ACCEPTED; + } + + identity_info = &req->in.logon.generic->identity_info; + break; + + default: return NT_STATUS_REQUEST_NOT_ACCEPTED; } - target_domain_name = req->in.logon.network->identity_info.domain_name.string; + + target_domain_name = identity_info->domain_name.string; domain = find_auth_domain(0, target_domain_name); if (domain == NULL) { -- 2.11.4.GIT