s3: netsamlogon_clear_cached_user only needs the SID
authorVolker Lendecke <vl@samba.org>
Sat, 11 Dec 2010 13:19:50 +0000 (14:19 +0100)
committerVolker Lendecke <vlendec@samba.org>
Sun, 19 Dec 2010 22:25:06 +0000 (23:25 +0100)
source3/include/proto.h
source3/libsmb/samlogon_cache.c
source3/winbindd/winbindd_cache.c

index 95833883623baaf0709f8117eedf13bc1305be52..11060aa6d3e3e9f6dbf48af5d8450f03e2d3395d 100644 (file)
@@ -2835,7 +2835,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 
 bool netsamlogon_cache_init(void);
 bool netsamlogon_cache_shutdown(void);
-void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3);
+void netsamlogon_clear_cached_user(const struct dom_sid *user_sid);
 bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
 bool netsamlogon_cache_have(const struct dom_sid *user_sid);
index 52fbe04351b0d9669c2c6f6a18ef4838562c0688..f3ef9547b7b38a2b10f4723a0a6b5e5980e98163 100644 (file)
@@ -99,25 +99,19 @@ bool netsamlogon_cache_shutdown(void)
  Clear cache getpwnam and getgroups entries from the winbindd cache
 ***********************************************************************/
 
-void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3)
+void netsamlogon_clear_cached_user(const struct dom_sid *user_sid)
 {
-       struct dom_sid  user_sid;
        fstring keystr;
 
-       if (!info3) {
-               return;
-       }
-
        if (!netsamlogon_cache_init()) {
                DEBUG(0,("netsamlogon_clear_cached_user: cannot open "
                        "%s for write!\n",
                        NETSAMLOGON_TDB));
                return;
        }
-       sid_compose(&user_sid, info3->base.domain_sid, info3->base.rid);
 
        /* Prepare key as DOMAIN-SID/USER-RID string */
-       sid_to_fstring(keystr, &user_sid);
+       sid_to_fstring(keystr, user_sid);
 
        DEBUG(10,("netsamlogon_clear_cached_user: SID [%s]\n", keystr));
 
index 44c6f2b80bd772fc6c80a83ea52d775050997f79..7663063aeb4f58a119bb861fbb07ca603b4fcc6c 100644 (file)
@@ -3034,7 +3034,7 @@ void wcache_invalidate_samlogon(struct winbindd_domain *domain,
        tdb_delete(cache->tdb, string_tdb_data(key_str));
 
        /* Samba/winbindd never needs this. */
-       netsamlogon_clear_cached_user(info3);
+       netsamlogon_clear_cached_user(&sid);
 }
 
 bool wcache_invalidate_cache(void)