From c24c328a9e006473f4dba49fdf1842fb28952ec7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Jan 2005 20:21:15 +0000 Subject: r4970: Fix for bug 2092, allowing fallback after kerberos and allow gnome vfs to prevent auto-anonymous logon. Jeremy. (This used to be commit 843e85bcd978d025964c4d45d9a3886c7cf7f63c) --- source3/libsmb/libsmbclient.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/libsmbclient.c') diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index df9c4ddcad..8eeadc8a78 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -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; -- cgit