From ac3f2e784f818fb06b20b053cf4127d331e8f63c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 31 Aug 2007 15:24:43 +0000 Subject: r24843: Add a "validate-cache" control message to winbindd. So there is a new subcommand "smbcontrol winbindd validate-cache" now. This change provides the infrastructure: The function currently returns "true" unconditionally. The call of a real cache validation function will be incorporated in subsequent changes. Michael (This used to be commit ef92d505c04397614cb0dd5ede967e9017a5e302) --- source3/nsswitch/winbindd.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index d7368a3d34..913ad04c6d 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -202,6 +202,28 @@ static void msg_shutdown(struct messaging_context *msg, do_sigterm = True; } + +static void winbind_msg_validate_cache(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id server_id, + DATA_BLOB *data) +{ + uint8 ret; + + DEBUG(10, ("winbindd_msg_validate_cache: got validate-cache " + "message.\n")); + +#if 0 + ret = (uint8)winbindd_validate_cache_nobackup(); + DEBUG(10, ("winbindd_msg_validata_cache: got return value %d\n", ret)); +#else + ret = 0; +#endif + messaging_send_buf(msg_ctx, server_id, MSG_WINBIND_VALIDATE_CACHE, &ret, + (size_t)1); +} + static struct winbindd_dispatch_table { enum winbindd_cmd cmd; void (*fn)(struct winbindd_cli_state *state); @@ -1170,6 +1192,10 @@ int main(int argc, char **argv, char **envp) messaging_register(winbind_messaging_context(), NULL, MSG_DUMP_EVENT_LIST, winbind_msg_dump_event_list); + messaging_register(winbind_messaging_context(), NULL, + MSG_WINBIND_VALIDATE_CACHE, + winbind_msg_validate_cache); + netsamlogon_cache_init(); /* Non-critical */ /* clear the cached list of trusted domains */ -- cgit