doveadm-kick.c revision a75d470c9223a75801418fcdda258885c36317e0
/* Copyright (c) 2010-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "network.h"
#include "hash.h"
#include "doveadm.h"
#include "doveadm-who.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
struct kick_user {
const char *username;
ignored when the -f switch is given. */
};
struct kick_pid {
bool kick;
};
struct kick_context {
struct who_context who;
bool force_kick;
ARRAY(const char *) kicked_users;
};
static void
{
}
if (user_match)
return;
}
}
}
static bool
bool *show_warning)
{
unsigned int kick_count = 0;
return FALSE;
} else {
kick_count++;
}
if (kick_count == 0)
return FALSE;
!ctx->force_kick) {
}
}
*show_warning = TRUE;
return FALSE;
}
}
return TRUE;
}
static void
{
unsigned int i, count;
const char *const *users;
printf("no users kicked\n");
return;
}
if (show_warning) {
printf("warning: other connections would also be "
"kicked from following users:\n");
} else
printf("kicked connections from the following users:\n");
for (i = 1; i < count; i++) {
}
printf("\n");
if (show_warning)
printf("Use the '-f' option to enforce the disconnect.\n");
}
{
bool show_enforce_warning = FALSE;
struct hash_iterate_context *iter;
void *key;
}
if (show_enforce_warning) {
return;
}
continue;
} else {
}
}
}
}
{
struct kick_context ctx;
int c;
switch (c) {
case 'a':
break;
case 'f':
break;
default:
}
}
}
kick_users(&ctx);
}
struct doveadm_cmd doveadm_cmd_kick = {
cmd_kick, "kick",
};