summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-01-16 18:03:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:09 -0500
commitf7519540090b2f47259f72d81b267b3e7a1a8950 (patch)
tree20eaaca6175ccfb7c96c3f3546a3513265378d6f
parentbc1a5b7935defef610240e4d76e7ff170a612df6 (diff)
downloadsamba-f7519540090b2f47259f72d81b267b3e7a1a8950.tar.gz
samba-f7519540090b2f47259f72d81b267b3e7a1a8950.tar.bz2
samba-f7519540090b2f47259f72d81b267b3e7a1a8950.zip
r12967: BUG 1061: don't corrupt the file name when reading an lmhosts file (-H) in nmbd. Patch from Andrew Esh <Andrew_Esh@adaptec.com>
(This used to be commit 14160c496112e06e4ea0d0a5aa5bad2b58e90601)
-rw-r--r--source3/nmbd/nmbd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 68004bad59..ea7e9a5288 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -657,13 +657,14 @@ static BOOL open_sockets(BOOL isdaemon, int port)
pstring logfile;
static BOOL opt_interactive;
poptContext pc;
+ static char *p_lmhosts = dyn_LMHOSTSFILE;
struct poptOption long_options[] = {
POPT_AUTOHELP
{"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon(default)" },
{"interactive", 'i', POPT_ARG_VAL, &opt_interactive, True, "Run interactive (not a daemon)" },
{"foreground", 'F', POPT_ARG_VAL, &Fork, False, "Run daemon in foreground (for daemontools & etc)" },
{"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"},
+ {"hosts", 'H', POPT_ARG_STRING, &p_lmhosts, '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 }
@@ -803,8 +804,8 @@ static BOOL open_sockets(BOOL isdaemon, int port)
}
/* Load in any static local names. */
- load_lmhosts_file(dyn_LMHOSTSFILE);
- DEBUG(3,("Loaded hosts file %s\n", dyn_LMHOSTSFILE));
+ load_lmhosts_file(p_lmhosts);
+ DEBUG(3,("Loaded hosts file %s\n", p_lmhosts));
/* If we are acting as a WINS server, initialise data structures. */
if( !initialise_wins() ) {