summaryrefslogtreecommitdiffstats
path: root/source/smbd/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/ipc.c')
-rw-r--r--source/smbd/ipc.c57
1 files changed, 10 insertions, 47 deletions
diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c
index 580aa446b6a..8e81134de51 100644
--- a/source/smbd/ipc.c
+++ b/source/smbd/ipc.c
@@ -812,7 +812,10 @@ static int get_server_info(uint32 servertype,
if (!next_token(&ptr,s->name , NULL)) continue;
if (!next_token(&ptr,stype , NULL)) continue;
if (!next_token(&ptr,s->comment, NULL)) continue;
- if (!next_token(&ptr,s->domain , NULL)) continue;
+ if (!next_token(&ptr,s->domain , NULL)) {
+ /* this allows us to cope with an old nmbd */
+ strcpy(s->domain,lp_workgroup());
+ }
if (sscanf(stype,"%X",&s->type) != 1) {
DEBUG(4,("r:host file "));
@@ -980,22 +983,8 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data,
if (strcmp(str1, "WrLehDz") == 0) {
StrnCpy(domain, p, 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;
-
- work_alias = conf_alias_to_workgroup(local_machine); /* look-up */
-
- if (work_alias)
- StrnCpy(domain, work_alias, sizeof(fstring)-1);
+ } else {
+ StrnCpy(domain, lp_workgroup(), sizeof(fstring)-1);
}
if (lp_browse_list())
@@ -1679,19 +1668,9 @@ static BOOL api_RNetServerGetInfo(int cnum,int uid, char *param,char *data,
pstring comment;
uint32 servertype=DFLT_SERVER_TYPE;
- char *work_alias;
- char domain[16];
-
- work_alias = conf_alias_to_workgroup(local_machine); /* look-up */
-
- 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,domain))>0) {
+ if ((count=get_server_info(SV_TYPE_ALL,&servers,lp_workgroup()))>0) {
for (i=0;i<count;i++)
if (strequal(servers[i].name,local_machine)) {
servertype = servers[i].type;
@@ -1744,14 +1723,6 @@ static BOOL api_NetWkstaGetInfo(int cnum,int uid, char *param,char *data,
char *p2;
extern pstring sesssetup_user;
int level = SVAL(p,0);
- char domain[17];
-
- char *work_alias = conf_alias_to_workgroup(local_machine); /* look-up */
-
- if (work_alias)
- StrnCpy(domain, work_alias, 16);
- else
- StrnCpy(domain, lp_workgroup(), 16);
DEBUG(4,("NetWkstaGetInfo level %d\n",level));
@@ -1782,7 +1753,7 @@ static BOOL api_NetWkstaGetInfo(int cnum,int uid, char *param,char *data,
p += 4;
SIVAL(p,0,PTR_DIFF(p2,*rdata));
- StrCpy(p2,domain);
+ strcpy(p2,lp_workgroup());
p2 = skip_string(p2,1);
p += 4;
@@ -1791,7 +1762,7 @@ static BOOL api_NetWkstaGetInfo(int cnum,int uid, char *param,char *data,
p += 2;
SIVAL(p,0,PTR_DIFF(p2,*rdata));
- strcpy(p2,domain); /* login domain?? */
+ strcpy(p2,lp_workgroup()); /* login domain?? */
p2 = skip_string(p2,1);
p += 4;
@@ -2014,14 +1985,6 @@ static BOOL api_WWkstaUserLogon(int cnum,int uid, char *param,char *data,
int uLevel;
struct pack_desc desc;
char* name;
- char domain[17];
-
- char *work_alias = conf_alias_to_workgroup(local_machine); /* look-up */
-
- if (work_alias)
- StrnCpy(domain, work_alias, 16);
- else
- StrnCpy(domain, lp_workgroup(), 16);
uLevel = SVAL(p,0);
name = p + 2;
@@ -2064,7 +2027,7 @@ static BOOL api_WWkstaUserLogon(int cnum,int uid, char *param,char *data,
strupper(mypath);
PACKS(&desc,"z",mypath); /* computer */
}
- PACKS(&desc,"z",domain);/* domain */
+ PACKS(&desc,"z",lp_workgroup());/* domain */
PACKS(&desc,"z",lp_logon_script()); /* script path */
PACKI(&desc,"D",0); /* reserved */
}