From: Stefan Metzmacher Date: Thu, 23 Jan 2020 15:17:30 +0000 (+0100) Subject: s3:auth_sam: make sure we never handle empty usernames X-Git-Tag: ldb-2.1.1~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01b8374e7942141e7f6cbdec7623c981a008e4c1;p=thirdparty%2Fsamba.git s3:auth_sam: make sure we never handle empty usernames BUG: https://bugzilla.samba.org/show_bug.cgi?id=14247 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 91cc85544be..da38bf4caed 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -36,6 +36,12 @@ static NTSTATUS auth_sam_ignoredomain_auth(const struct auth_context *auth_conte return NT_STATUS_UNSUCCESSFUL; } + if (user_info->mapped.account_name == NULL || + user_info->mapped.account_name[0] == '\0') + { + return NT_STATUS_NOT_IMPLEMENTED; + } + DBG_DEBUG("Check auth for: [%s]\\[%s]\n", user_info->mapped.domain_name, user_info->mapped.account_name); @@ -80,6 +86,12 @@ static NTSTATUS auth_samstrict_auth(const struct auth_context *auth_context, return NT_STATUS_LOGON_FAILURE; } + if (user_info->mapped.account_name == NULL || + user_info->mapped.account_name[0] == '\0') + { + return NT_STATUS_NOT_IMPLEMENTED; + } + DBG_DEBUG("Check auth for: [%s]\\[%s]\n", user_info->mapped.domain_name, user_info->mapped.account_name); @@ -154,6 +166,12 @@ static NTSTATUS auth_sam_netlogon3_auth(const struct auth_context *auth_context, return NT_STATUS_LOGON_FAILURE; } + if (user_info->mapped.account_name == NULL || + user_info->mapped.account_name[0] == '\0') + { + return NT_STATUS_NOT_IMPLEMENTED; + } + DBG_DEBUG("Check auth for: [%s]\\[%s]\n", user_info->mapped.domain_name, user_info->mapped.account_name);