summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-11-19 03:12:10 +0000
committerMartin Pool <mbp@samba.org>2001-11-19 03:12:10 +0000
commit8654a161c8722a0059b15af12cdb81b27d49e71a (patch)
treeedf4e622fd1cbc3d165a80b5caf7b11a965519af /source3
parenteb2bf006acc4842d9b6d2749805dc24404a3d423 (diff)
downloadsamba-8654a161c8722a0059b15af12cdb81b27d49e71a.tar.gz
samba-8654a161c8722a0059b15af12cdb81b27d49e71a.tar.bz2
samba-8654a161c8722a0059b15af12cdb81b27d49e71a.zip
LMHOSTSFILE is now dynamically configured too.
(This used to be commit a779710fff5fddcbf65a8ddc8e9169b586b85481)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in6
-rw-r--r--source3/dynconfig.c2
-rw-r--r--source3/include/dynconfig.h2
-rw-r--r--source3/libsmb/namequery.c2
-rw-r--r--source3/nmbd/nmbd.c15
5 files changed, 11 insertions, 16 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 14b1878de8..5716ac0826 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -71,14 +71,16 @@ man_langs = "@manlangs@"
PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -I. -I$(srcdir)
-FLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
+FLAGS2 =
FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\" -DLIBDIR=\"$(LIBDIR)\"
FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H
FLAGS = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
FLAGS32 = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
-PATH_FLAGS = -DSBINDIR=\"$(SBINDIR)\" -DBINDIR=\"$(BINDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
+PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\"
+PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
+PATH_FLAGS = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
WINBIND_PROGS = bin/wbinfo
WINBIND_SPROGS = bin/winbindd
diff --git a/source3/dynconfig.c b/source3/dynconfig.c
index 22d6caa8cf..fd77e88309 100644
--- a/source3/dynconfig.c
+++ b/source3/dynconfig.c
@@ -43,3 +43,5 @@ char const *dyn_SBINDIR = SBINDIR,
pstring dyn_CONFIGFILE = CONFIGFILE; /**< Location of smb.conf file. **/
pstring dyn_LOGFILEBASE; /**< Log file directory. **/
+
+pstring dyn_LMHOSTSFILE; /**< Statically configured LanMan hosts. **/
diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h
index e01d1a39a8..c02ee86abf 100644
--- a/source3/include/dynconfig.h
+++ b/source3/include/dynconfig.h
@@ -28,4 +28,4 @@ extern char const *dyn_SBINDIR,
*dyn_SWATDIR;
extern pstring dyn_CONFIGFILE;
-extern pstring dyn_LOGFILEBASE;
+extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 18bab5e7fd..0e696a085b 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -748,7 +748,7 @@ static BOOL resolve_lmhosts(const char *name, int name_type,
DEBUG(3,("resolve_lmhosts: Attempting lmhosts lookup for name %s<0x%x>\n", name, name_type));
- fp = startlmhosts( LMHOSTSFILE );
+ fp = startlmhosts(dyn_LMHOSTSFILE);
if(fp) {
while (getlmhostsent(fp, lmhost_name, &name_type2, &return_ip)) {
if (strequal(name, lmhost_name) &&
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index de673b6462..595a65a0cd 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -32,7 +32,6 @@ int ClientNMB = -1;
int ClientDGRAM = -1;
int global_nmb_port = -1;
-static pstring host_file;
extern pstring global_myname;
extern fstring global_myworkgroup;
extern char **my_netbios_names;
@@ -668,7 +667,6 @@ static void usage(char *pname)
append_log = True; /* Default, override with '-o' option. */
global_nmb_port = NMB_PORT;
- *host_file = 0;
global_in_nmbd = True;
StartupTime = time(NULL);
@@ -680,10 +678,6 @@ static void usage(char *pname)
slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
setup_logging( argv[0], False );
-#ifdef LMHOSTSFILE
- pstrcpy( host_file, LMHOSTSFILE );
-#endif
-
/* this is for people who can't start the program correctly */
while (argc > 1 && (*argv[1] != '-'))
{
@@ -728,7 +722,7 @@ static void usage(char *pname)
DEBUG(0,("Obsolete option '%c' used\n",opt));
break;
case 'H':
- pstrcpy(host_file,optarg);
+ pstrcpy(dyn_LMHOSTSFILE, optarg);
break;
case 'n':
pstrcpy(global_myname,optarg);
@@ -838,11 +832,8 @@ static void usage(char *pname)
}
/* Load in any static local names. */
- if ( *host_file )
- {
- load_lmhosts_file(host_file);
- DEBUG(3,("Loaded hosts file\n"));
- }
+ load_lmhosts_file(dyn_LMHOSTSFILE);
+ DEBUG(3,("Loaded hosts file %s\n", dyn_LMHOSTSFILE));
/* If we are acting as a WINS server, initialise data structures. */
if( !initialise_wins() )