summaryrefslogtreecommitdiffstats
path: root/source/nsswitch
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-08-31 15:24:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:27 -0500
commitef92d505c04397614cb0dd5ede967e9017a5e302 (patch)
treec013dfcb6e19c0ba699a13b7bc1bb78935c81eb7 /source/nsswitch
parent205ef6ab3e9332a2a4a4f775c2cdddbcd3ec739d (diff)
downloadsamba-ef92d505c04397614cb0dd5ede967e9017a5e302.tar.gz
samba-ef92d505c04397614cb0dd5ede967e9017a5e302.tar.xz
samba-ef92d505c04397614cb0dd5ede967e9017a5e302.zip
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
Diffstat (limited to 'source/nsswitch')
-rw-r--r--source/nsswitch/winbindd.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c
index d7368a3d343..913ad04c6d9 100644
--- a/source/nsswitch/winbindd.c
+++ b/source/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 */