summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>1998-09-29 04:43:40 +0000
committerRichard Sharpe <sharpe@samba.org>1998-09-29 04:43:40 +0000
commitb665756bfc813b229ad50b0d5f53e8b779537a3f (patch)
treea8b0b0547583f5a01ee25b89bdae6d599621fbfa
parent14ee57f336100634993e7968ba54a441ac2813db (diff)
downloadsamba-b665756bfc813b229ad50b0d5f53e8b779537a3f.tar.gz
samba-b665756bfc813b229ad50b0d5f53e8b779537a3f.tar.xz
samba-b665756bfc813b229ad50b0d5f53e8b779537a3f.zip
Now have a better solution to the need to have smblcient find
a WINS server if running on the WINS server. As suggested by Andrew, we have a flag, in_client=False by default, and set it to True in the client. loadparam.c checks this and sets szWINSserver to 127.0.0.1 when in_client && bWINSsupport. BTW, we seem to have picked up and unused value in some of Luke's new code.
-rw-r--r--source/client/client.c3
-rw-r--r--source/param/loadparm.c10
2 files changed, 13 insertions, 0 deletions
diff --git a/source/client/client.c b/source/client/client.c
index e34131d6d00..0d27039cb93 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -29,6 +29,7 @@
pstring cur_dir = "\\";
pstring cd_path = "";
+extern BOOL in_client;
extern pstring service;
extern pstring desthost;
extern pstring global_myname;
@@ -3789,6 +3790,8 @@ static void usage(char *pname)
DEBUG(0,("Failed to get my hostname.\n"));
}
+ in_client = True;
+
if (!lp_load(servicesf,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
}
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 2fd2212a4c3..05ed6484ac5 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -65,6 +65,7 @@
#define KANJI "sbcs"
#endif /* KANJI */
+BOOL in_client = False; /* Not in the client by default */
BOOL bLoaded = False;
extern int DEBUGLEVEL;
@@ -2480,6 +2481,15 @@ BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc)
set_default_server_announce_type();
+ /* We set a WINS server address of 127.0.0.1 if we are in the client */
+ /* and we have WINS support enabled */
+
+ if (in_client && Globals.bWINSsupport) {
+
+ string_set(&Globals.szWINSserver, "127.0.0.1");
+
+ }
+
bLoaded = True;
return (bRetval);