summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nmbd/nmbd.c')
-rw-r--r--source3/nmbd/nmbd.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index f87ab97798..5685db7452 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -3,7 +3,7 @@
NBT netbios routines and daemon - version 2
Copyright (C) Andrew Tridgell 1994-1998
Copyright (C) Jeremy Allison 1997-2002
- Copyright (C) Jelmer Vernooij 2002,2003 (Conversion to popt)
+ Copyright (C) Jelmer Vernooij 2002 (Conversion to popt)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -101,6 +101,25 @@ static void sig_hup(int sig)
sys_select_signal();
}
+/*******************************************************************
+ Print out all talloc memory info.
+********************************************************************/
+
+void return_all_talloc_info(int msg_type, pid_t src_pid, void *buf, size_t len)
+{
+ TALLOC_CTX *ctx = talloc_init("info context");
+ char *info = NULL;
+
+ if (!ctx)
+ return;
+
+ info = talloc_describe_all(ctx);
+ if (info)
+ DEBUG(10,(info));
+ message_send_pid(src_pid, MSG_TALLOC_USAGE, info, info ? strlen(info) + 1 : 0, True);
+ talloc_destroy(ctx);
+}
+
#if DUMP_CORE
/**************************************************************************** **
Prepare to dump a core file - carefully!
@@ -581,9 +600,15 @@ static BOOL open_sockets(BOOL isdaemon, int port)
{"log-stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
{"hosts", 'H', POPT_ARG_STRING, dyn_LMHOSTSFILE, 'H', "Load a netbios hosts file"},
{"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" },
- POPT_COMMON_SAMBA
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug },
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile },
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options },
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version },
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netbios_name },
+ {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base },
{ NULL }
};
+ int opt;
pstring logfile;
global_nmb_port = NMB_PORT;
@@ -599,7 +624,7 @@ static BOOL open_sockets(BOOL isdaemon, int port)
fault_setup((void (*)(void *))fault_continue );
/* POSIX demands that signals are inherited. If the invoking process has
- * these signals masked, we will have problems, as we won't receive them. */
+ * these signals masked, we will have problems, as we won't recieve them. */
BlockSignals(False, SIGHUP);
BlockSignals(False, SIGUSR1);
BlockSignals(False, SIGTERM);
@@ -618,6 +643,9 @@ static BOOL open_sockets(BOOL isdaemon, int port)
#endif
pc = poptGetContext("nmbd", argc, argv, long_options, 0);
+ while((opt = poptGetNextOpt(pc)) != -1)
+ { }
+
poptFreeContext(pc);
if ( opt_interactive ) {
@@ -691,6 +719,7 @@ static BOOL open_sockets(BOOL isdaemon, int port)
message_register(MSG_FORCE_ELECTION, nmbd_message_election);
message_register(MSG_WINS_NEW_ENTRY, nmbd_wins_new_entry);
message_register(MSG_SHUTDOWN, nmbd_terminate);
+ message_register(MSG_REQ_TALLOC_USAGE, return_all_talloc_info);
DEBUG( 3, ( "Opening sockets %d\n", global_nmb_port ) );