Skip to content

Commit 1cbc124

Browse files
committed
Handle the case where username is NULL
This is never permissible except with anonymous authentication which we do not support yet. Signed-off-by: Simo Sorce <[email protected]>
1 parent f23b571 commit 1cbc124

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/gss_sec_ctx.c

+13-9
Original file line numberDiff line numberDiff line change
@@ -835,15 +835,19 @@ uint32_t gssntlm_accept_sec_context(uint32_t *minor_status,
835835
goto done;
836836
}
837837

838-
if (((usr_name == NULL) || (usr_name[0] == '\0')) &&
839-
(nt_chal_resp.length == 0) &&
840-
(((lm_chal_resp.length == 1) && (lm_chal_resp.data[0] == '\0')) ||
841-
(lm_chal_resp.length == 0))) {
842-
/* Anonymous auth */
843-
/* FIXME: not supported for now */
844-
set_GSSERR(ERR_NOTSUPPORTED);
845-
goto done;
846-
838+
if ((usr_name == NULL) || (usr_name[0] == '\0')) {
839+
if ((nt_chal_resp.length == 0) &&
840+
(((lm_chal_resp.length == 1) &&
841+
(lm_chal_resp.data[0] == '\0')) ||
842+
(lm_chal_resp.length == 0))) {
843+
/* Anonymous auth */
844+
/* FIXME: not supported for now */
845+
set_GSSERR(ERR_NOTSUPPORTED);
846+
goto done;
847+
} else {
848+
set_GSSERR(ERR_NOUSRFOUND);
849+
goto done;
850+
}
847851
} else {
848852

849853
char useratdom[1024];

0 commit comments

Comments
 (0)