svn commit: samba r21537 - in branches: SAMBA_3_0/source/nsswitch
SAMBA_3_0_25/source/nsswitch
gd at samba.org
gd at samba.org
Mon Feb 26 09:53:36 GMT 2007
Author: gd
Date: 2007-02-26 09:53:35 +0000 (Mon, 26 Feb 2007)
New Revision: 21537
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21537
Log:
Avoid to trigger the confusing "cached entry differs." warning when
there is just no cache around for a user.
Guenther
Modified:
branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c
branches/SAMBA_3_0_25/source/nsswitch/winbindd_pam.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c 2007-02-26 09:46:05 UTC (rev 21536)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c 2007-02-26 09:53:35 UTC (rev 21537)
@@ -249,6 +249,16 @@
}
/****************************************************************
+ Check if an ccache entry exists.
+****************************************************************/
+
+BOOL ccache_entry_exists(const char *username)
+{
+ struct WINBINDD_CCACHE_ENTRY *entry = get_ccache_by_username(username);
+ return (entry != NULL);
+}
+
+/****************************************************************
Ensure we're changing the correct entry.
****************************************************************/
@@ -305,6 +315,8 @@
entry->ref_count++;
DEBUG(10,("add_ccache_to_list: ref count on entry %s is now %d\n",
username, entry->ref_count));
+ /* FIXME: in this case we still might want to have a krb5 cred
+ * event handler created - gd*/
return NT_STATUS_OK;
}
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c 2007-02-26 09:46:05 UTC (rev 21536)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c 2007-02-26 09:53:35 UTC (rev 21537)
@@ -2147,8 +2147,14 @@
}
/* what we need here is to find the corresponding krb5 ccache name *we*
- * created for a given username and destroy it (as the user who created it) */
-
+ * created for a given username and destroy it */
+
+ if (!ccache_entry_exists(state->request.data.logoff.user)) {
+ result = NT_STATUS_OK;
+ DEBUG(10,("winbindd_pam_logoff: no entry found.\n"));
+ goto process_result;
+ }
+
if (!ccache_entry_identical(state->request.data.logoff.user,
state->request.data.logoff.uid,
state->request.data.logoff.krb5ccname)) {
Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c 2007-02-26 09:46:05 UTC (rev 21536)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_cred_cache.c 2007-02-26 09:53:35 UTC (rev 21537)
@@ -249,6 +249,16 @@
}
/****************************************************************
+ Check if an ccache entry exists.
+****************************************************************/
+
+BOOL ccache_entry_exists(const char *username)
+{
+ struct WINBINDD_CCACHE_ENTRY *entry = get_ccache_by_username(username);
+ return (entry != NULL);
+}
+
+/****************************************************************
Ensure we're changing the correct entry.
****************************************************************/
@@ -305,6 +315,8 @@
entry->ref_count++;
DEBUG(10,("add_ccache_to_list: ref count on entry %s is now %d\n",
username, entry->ref_count));
+ /* FIXME: in this case we still might want to have a krb5 cred
+ * event handler created - gd*/
return NT_STATUS_OK;
}
Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_pam.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_pam.c 2007-02-26 09:46:05 UTC (rev 21536)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_pam.c 2007-02-26 09:53:35 UTC (rev 21537)
@@ -2147,8 +2147,14 @@
}
/* what we need here is to find the corresponding krb5 ccache name *we*
- * created for a given username and destroy it (as the user who created it) */
-
+ * created for a given username and destroy it */
+
+ if (!ccache_entry_exists(state->request.data.logoff.user)) {
+ result = NT_STATUS_OK;
+ DEBUG(10,("winbindd_pam_logoff: no entry found.\n"));
+ goto process_result;
+ }
+
if (!ccache_entry_identical(state->request.data.logoff.user,
state->request.data.logoff.uid,
state->request.data.logoff.krb5ccname)) {
More information about the samba-cvs
mailing list