#include "libsmb/nmblib.h"
#include "messages.h"
#include "util_tdb.h"
+#include "../lib/util/pidfile.h"
#if HAVE_LIBUNWIND_H
#include <libunwind.h>
{
static const char* usage = "Usage: "
"smbcontrol <dest> idmap <cmd> [arg]\n"
- "\tcmd:\tflush [gid|uid]\n"
- "\t\tdelete \"UID <uid>\"|\"GID <gid>\"|<sid>\n"
+ "\tcmd:"
+ "\tdelete \"UID <uid>\"|\"GID <gid>\"|<sid>\n"
"\t\tkill \"UID <uid>\"|\"GID <gid>\"|<sid>\n";
const char* arg = NULL;
int arglen = 0;
return false;
}
- if (strcmp(argv[1], "flush") == 0) {
- msg_type = ID_CACHE_FLUSH;
- }
- else if (strcmp(argv[1], "delete") == 0) {
+ if (strcmp(argv[1], "delete") == 0) {
msg_type = ID_CACHE_DELETE;
}
else if (strcmp(argv[1], "kill") == 0) {
const struct server_id pid,
const int argc, const char **argv)
{
- struct server_id myid;
-
- myid = messaging_server_id(msg_ctx);
-
if (argc != 1) {
fprintf(stderr, "Usage: smbcontrol <dest> dump-event-list\n");
return False;
return send_message(msg_ctx, pid, MSG_SEND_PACKET, &p, sizeof(p));
}
+static bool do_notify_cleanup(struct tevent_context *ev_ctx,
+ struct messaging_context *msg_ctx,
+ const struct server_id pid,
+ const int argc, const char **argv)
+{
+ if (argc != 1) {
+ fprintf(stderr, "Usage: smbcontrol smbd notify-cleanup\n");
+ return false;
+ }
+ return send_message(msg_ctx, pid, MSG_SMB_NOTIFY_CLEANUP, NULL, 0);
+}
+
/* A list of message type supported */
static const struct {
{ "validate-cache" , do_winbind_validate_cache,
"Validate winbind's credential cache" },
{ "dump-domain-list", do_winbind_dump_domain_list, "Dump winbind domain list"},
+ { "notify-cleanup", do_notify_cleanup },
{ "noop", do_noop, "Do nothing" },
{ NULL }
};
/* Look up other destinations in pidfile directory */
- if ((pid = pidfile_pid(dest)) != 0) {
+ if ((pid = pidfile_pid(lp_piddir(), dest)) != 0) {
return pid_to_procid(pid);
}