summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-08-23 10:17:30 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-08-23 10:17:30 +0000
commit5945be9718b8ea56c8dde99729c0ec0e56080fee (patch)
treee0b7aa5086bc50eb93a8e0bb987d775a8fedb1cb /source3/smbd
parentea1a09af136d58cd5dbcee23c16c7966dd0074c3 (diff)
downloadsamba-5945be9718b8ea56c8dde99729c0ec0e56080fee.tar.gz
samba-5945be9718b8ea56c8dde99729c0ec0e56080fee.tar.bz2
samba-5945be9718b8ea56c8dde99729c0ec0e56080fee.zip
- fixed bugs in nmb response packet checking.
- added multiple workgroup code - samba can register under different (unique) NetBIOS aliases, one per workgroup it joins. lkcl (This used to be commit f24e341e7e4d8726b98d3a0f83b24f61817fe536)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c38
-rw-r--r--source3/smbd/server.c2
2 files changed, 37 insertions, 3 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index dd9b9661ae..916d7e3cc4 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -983,8 +983,26 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data,
if (strcmp(str1, "WrLehDz") == 0) {
StrnCpy(domain, p, sizeof(fstring)-1);
- } else {
- StrnCpy(domain, lp_workgroup(), sizeof(fstring)-1);
+ }
+ else
+ {
+ /* a server will connect to us under one of samba's NetBIOS
+ name aliases, and by not giving us a domain name it
+ assumes we know which domain it's talking about.
+ do a look-up for the workgroup name against the name
+ the host connected to us as.
+ */
+
+ char *work_alias;
+ char host_alias[16];
+
+ StrnCpy(host_alias, local_machine, 15);
+ work_alias = conf_alias_to_workgroup(host_alias); /* look-up */
+
+ DEBUG(4,("host alias: %s work_alias: %s\n",
+ host_alias, work_alias));
+ if (work_alias)
+ StrnCpy(domain, work_alias, sizeof(fstring)-1);
}
if (lp_browse_list())
@@ -1668,9 +1686,23 @@ static BOOL api_RNetServerGetInfo(int cnum,int uid, char *param,char *data,
pstring comment;
uint32 servertype=DFLT_SERVER_TYPE;
+ char *work_alias;
+ char host_alias[16];
+ char domain[16];
+
+ StrnCpy(host_alias, local_machine, 15);
+ work_alias = conf_alias_to_workgroup(host_alias); /* look-up */
+
+ DEBUG(4,("host alias: %s work_alias: %s\n",
+ host_alias, work_alias));
+ if (work_alias)
+ StrnCpy(domain, work_alias, sizeof(fstring)-1);
+ else
+ *domain = 0;
+
strcpy(comment,lp_serverstring());
- if ((count=get_server_info(SV_TYPE_ALL,&servers,lp_workgroup()))>0) {
+ if ((count=get_server_info(SV_TYPE_ALL,&servers,domain))>0) {
for (i=0;i<count;i++)
if (strequal(servers[i].name,local_machine)) {
servertype = servers[i].type;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 0e0a524f16..4aaab4c087 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -3746,6 +3746,8 @@ static void usage(char *pname)
DEBUG(2,("%s changed root to %s\n",timestring(),lp_rootdir()));
}
+ read_smbbrowse_conf(myhostname);
+
process();
close_sockets();