s3: fix id_cache_kill to delete the the id-mappig from caches
authorGregor Beck <gbeck@sernet.de>
Thu, 6 Oct 2011 11:49:02 +0000 (13:49 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 12 Oct 2011 20:45:52 +0000 (22:45 +0200)
The intendet and documented behavior of smbcontrol smbd idmap kill is to
delete the mapping from caches and additionally kill the smbd if an affected id
is in use.

Signed-off-by: Michael Adam <obnox@samba.org>
source3/lib/id_cache.c
source3/lib/id_cache.h
source3/smbd/msg_idmap.c

index 71693c14643fcf76ea211e2ea435f0a47e46a481..e71934d6e3cb010f5c418b0195e92e878042b28c 100644 (file)
@@ -138,7 +138,7 @@ static void flush_uid_cache(void)
        memcache_flush(NULL, SID_UID_CACHE);
        memcache_flush(NULL, UID_SID_CACHE);
 }
-static void delete_from_cache(const struct id_cache_ref* id)
+void id_cache_delete_from_cache(const struct id_cache_ref* id)
 {
        switch(id->type) {
        case UID:
@@ -195,7 +195,7 @@ static void id_cache_delete(struct messaging_context *msg_ctx,
                return;
        }
 
-       delete_from_cache(&id);
+       id_cache_delete_from_cache(&id);
 }
 
 void id_cache_register_msgs(struct messaging_context *ctx)
index 208ce60e96b36c229db475105f415640235e7c99..00fd2853c9177514d17d4ce16c7f37e44dc22328 100644 (file)
@@ -29,4 +29,6 @@ struct id_cache_ref {
 
 bool id_cache_ref_parse(const char* str, struct id_cache_ref* id);
 
+void id_cache_delete_from_cache(const struct id_cache_ref* id);
+
 void id_cache_register_msgs(struct messaging_context *ctx);
index e4a5652a9e4060bbfc19e856c75580ad1a3769b6..cb8fbcd42ffe622d5035b42552f5fc1264dc92c7 100644 (file)
@@ -132,6 +132,7 @@ static void id_cache_kill(struct messaging_context *msg_ctx,
        if (id_in_use(validated_users, &id)) {
                exit_server_cleanly(msg);
        }
+       id_cache_delete_from_cache(&id);
 }
 
 void id_cache_register_kill_msg(struct messaging_context *ctx)