s3: add functions to flush the idmap memcache
authorGregor Beck <gbeck@sernet.de>
Fri, 18 Feb 2011 13:42:18 +0000 (14:42 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 28 Feb 2011 11:58:37 +0000 (12:58 +0100)
source3/include/proto.h
source3/passdb/lookup_sid.c

index fdc2b7b7b5d5a62f1ff09f0b11b759893bac5a10..6f4f0fc7bb3f8ee63759939e4068f64f5aec032f 100644 (file)
@@ -3631,6 +3631,8 @@ NTSTATUS get_primary_group_sid(TALLOC_CTX *mem_ctx,
                                const char *username,
                                struct passwd **_pwd,
                                struct dom_sid **_group_sid);
+void flush_uid_cache(void);
+void flush_gid_cache(void);
 
 /* The following definitions come from passdb/machine_sid.c  */
 
index 0e1b8d6c82630efc0e1b83a1e0079a4379d69f92..f1462af68665fb40fb9000ac31ed539a1b35436e 100644 (file)
@@ -1642,3 +1642,17 @@ done:
        TALLOC_FREE(tmp_ctx);
        return NT_STATUS_OK;
 }
+
+void flush_gid_cache(void)
+{
+       DEBUG(3, ("Flush GID <-> SID memcache\n"));
+       memcache_flush(NULL, SID_GID_CACHE);
+       memcache_flush(NULL, GID_SID_CACHE);
+}
+
+void flush_uid_cache(void)
+{
+       DEBUG(3, ("Flush UID <-> SID memcache\n"));
+       memcache_flush(NULL, SID_UID_CACHE);
+       memcache_flush(NULL, UID_SID_CACHE);
+}