Re: [PATCH] SMB user/password caching across shares



On Sun, 2005-01-23 at 09:38 +0000, Nielsen wrote:
> This patch develops the SMB password caching further, as discussed 
> earlier on this list:
> 
> - Cache password for the entire server in addition to per share.
> - If no password is cached for a share, look for the server cached
>    password.
> - Fix threading (had no lock) problems on the cache reaping
>    callback.
> - Keep an internal password cache in additon to gnome keyring.
> - Merge default user and password cache.
> 
> Found here:
> 
> http://bugzilla.gnome.org/attachment.cgi?id=36408
> 
> Any and all comments welcome. Is this a feature or a bug fix? I guess 
> that decides whether it gets into GNOME 2.10.

 static gboolean
 initial_authentication (SmbAuthContext *actx)

+                if (lookup_user_cache (actx->for_server,
actx->for_share, actx) ||
+                    lookup_user_cache (actx->for_server, NULL, actx))
+                        return TRUE;
 	}

Should we really check this and return before checking the actual
server_cache. If we're currently connected to the server/share using a
specific password that is not the default one, we should use that.

Lets see if i can make up an example where this breaks:

Say you connect to a server anonymously, then you later access a
specific share on that server by name (because it doesn't allow
anon). Later we need another connection to the original anon share,
but now we're gonna use the user/password instead of anon for the new
connection. As long as there is an outstanding connectiong to a
specific server/share we should always use the same user/password for
that, otherwise things like access rights etc are random depending on
which connection you happen to get.



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a deeply religious misogynist vagrant searching for his wife's true 
killer. She's a violent bisexual advertising executive in the witness 
protection program. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]