The Samba-Bugzilla – Attachment 1111 Details for
Bug 2543
Incorrect caching of server details when anonymous login succeeds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to correct caching if session setup is done with anonymous login
libsmbclient-cache.diff (text/plain), 1.53 KB, created by
Narayana Pattipati
on 2005-03-24 02:37:21 UTC
(
hide
)
Description:
patch to correct caching if session setup is done with anonymous login
Filename:
MIME Type:
Creator:
Narayana Pattipati
Created:
2005-03-24 02:37:21 UTC
Size:
1.53 KB
patch
obsolete
>--- source/libsmb/libsmbclient.c 2005-03-24 13:55:42.227190952 -0800 >+++ source-new/libsmb/libsmbclient.c 2005-03-24 13:54:59.395702328 -0800 >@@ -541,6 +541,8 @@ SMBCSRV *smbc_server(SMBCCTX *context, > pstring ipenv; > struct in_addr ip; > int tried_reverse = 0; >+ BOOL anon_logon = False; >+ fstring cache_user; > > zero_ip(&ip); > ZERO_STRUCT(c); >@@ -647,13 +649,15 @@ SMBCSRV *smbc_server(SMBCCTX *context, > if (!cli_session_setup(&c, username, > password, strlen(password), > password, strlen(password), >- workgroup) && >- /* try an anonymous login if it failed */ >- !cli_session_setup(&c, "", "", 1,"", 0, workgroup)) { >- cli_shutdown(&c); >- errno = EPERM; >- return NULL; >- } >+ workgroup)) { >+ anon_logon = True; >+ /* try an anonymous login if it failed */ >+ if(!cli_session_setup(&c, "", "", 1,"", 0, workgroup)) { >+ cli_shutdown(&c); >+ errno = EPERM; >+ return NULL; >+ } >+ } > > DEBUG(4,(" session setup ok\n")); > >@@ -684,7 +688,14 @@ SMBCSRV *smbc_server(SMBCCTX *context, > /* now add it to the cache (internal or external) */ > /* Let the cache function set errno if it wants to */ > errno = 0; >- if (context->callbacks.add_cached_srv_fn(context, srv, server, share, workgroup, username)) { >+ >+ if (anon_logon) { >+ fstrcpy(cache_user, ""); >+ } else { >+ fstrcpy(cache_user, username); >+ } >+ >+ if (context->callbacks.add_cached_srv_fn(context, srv, server, share, workgroup, cache_user)) { > int saved_errno = errno; > DEBUG(3, (" Failed to add server to cache\n")); > errno = saved_errno;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2543
: 1111