s3:smbcontrol: let smbd pass the idmap msg to its children for convenience
authorGregor Beck <gbeck@sernet.de>
Wed, 24 Aug 2011 08:52:01 +0000 (10:52 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 13:20:56 +0000 (15:20 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/smbd/msg_idmap.c

index 2a00f1bbb919d2518542308b2e1c2342bddb2174..564952b2c4b02b4c0084a49a448bb4d07570ed16 100644 (file)
@@ -149,6 +149,17 @@ static void delete_from_cache(const struct id* id)
        }
 }
 
+static void messaging_send_to_children(struct messaging_context *msg_ctx,
+                                      uint32_t msg_type, DATA_BLOB* data)
+{
+       struct child_pid *child;
+       for (child = children; child != NULL; child = child->next) {
+               messaging_send(msg_ctx, pid_to_procid(child->pid),
+                              msg_type, data);
+       }
+}
+
+
 
 static void message_idmap_flush(struct messaging_context *msg_ctx,
                                void* private_data,
@@ -167,7 +178,10 @@ static void message_idmap_flush(struct messaging_context *msg_ctx,
                flush_uid_cache();
        } else {
                DEBUG(0, ("Invalid argument: %s\n", msg));
+               return;
        }
+
+       messaging_send_to_children(msg_ctx, msg_type, data);
 }
 
 
@@ -187,6 +201,8 @@ static void message_idmap_delete(struct messaging_context *msg_ctx,
                return;
        }
 
+       messaging_send_to_children(msg_ctx, msg_type, data);
+
        if( do_kill && id_in_use(validated_users, &id) ) {
                exit_server_cleanly(msg);
        } else {