1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

r4970: Fix for bug 2092, allowing fallback after kerberos and allow

gnome vfs to prevent auto-anonymous logon.
Jeremy.
This commit is contained in:
Jeremy Allison
2005-01-24 20:21:15 +00:00
committed by Gerald (Jerry) Carter
parent 78975ab9a9
commit 843e85bcd9
4 changed files with 23 additions and 4 deletions

View File

@ -757,13 +757,17 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
if (ret){
SAFE_FREE(principal);
DEBUG(0, ("Kinit failed: %s\n", error_message(ret)));
if (cli->fallback_after_kerberos)
goto ntlmssp;
return ADS_ERROR_KRB5(ret);
}
}
rc = cli_session_setup_kerberos(cli, principal, domain);
SAFE_FREE(principal);
return rc;
if (ADS_ERR_OK(rc) || !cli->fallback_after_kerberos) {
SAFE_FREE(principal);
return rc;
}
}
#endif

View File

@ -584,6 +584,13 @@ SMBCSRV *smbc_server(SMBCCTX *context,
return NULL;
}
if (context->flags & SMB_CTX_FLAG_USE_KERBEROS) {
c.use_kerberos = True;
}
if (context->flags & SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS) {
c.fallback_after_kerberos = True;
}
c.timeout = context->timeout;
/* Force use of port 139 for first try, so browse lists can work */
@ -648,8 +655,9 @@ SMBCSRV *smbc_server(SMBCCTX *context,
password, strlen(password),
password, strlen(password),
workgroup) &&
/* try an anonymous login if it failed */
!cli_session_setup(&c, "", "", 1,"", 0, workgroup)) {
/* Try an anonymous login if it failed and this was allowed by flags. */
((context->flags & SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON) ||
!cli_session_setup(&c, "", "", 1,"", 0, workgroup))) {
cli_shutdown(&c);
errno = EPERM;
return NULL;