summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-02 15:41:30 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-02 15:41:30 +0000
commitafd08462ad5ff6b3c4bf621e39c55853a608175e (patch)
treefdbaf287628ee046f0db73dd13611a03089fb47b /source3/smbd
parent5a2f52b79e28530c454cb488a44588147640f061 (diff)
downloadsamba-afd08462ad5ff6b3c4bf621e39c55853a608175e.tar.gz
samba-afd08462ad5ff6b3c4bf621e39c55853a608175e.tar.bz2
samba-afd08462ad5ff6b3c4bf621e39c55853a608175e.zip
backout all the changes to nmbd.
The 1.9.16 tree is now back to 1.9.16p2 as far as nmbd is concerned apart from a small change that fixes the announce type in two places. (This used to be commit 45e66a69d320024877c8b13f12b21bf895e04410)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c57
-rw-r--r--source3/smbd/pipes.c17
-rw-r--r--source3/smbd/reply.c12
-rw-r--r--source3/smbd/server.c2
4 files changed, 15 insertions, 73 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 580aa446b6..8e81134de5 100644
--- a/source3/smbd/ipc.c
+++ b/source3/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 */
}
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 35f8d684eb..ffa46083c3 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -44,8 +44,6 @@ extern BOOL case_sensitive;
extern pstring sesssetup_user;
extern int Client;
-extern pstring local_machine;
-
/* this macro should always be used to extract an fnum (smb_fid) from
a packet to ensure chaining works correctly */
#define GETFNUM(buf,where) (chain_fnum!= -1?chain_fnum:SVAL(buf,where))
@@ -253,18 +251,9 @@ static void LsarpcTNP3(char *data,char **rdata, int *rdata_len)
{
uint32 dword1;
uint16 word1;
- int wglen;
+ char * workgroup = lp_workgroup();
+ int wglen = strlen(workgroup);
int i;
- 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);
-
- wglen = strlen(domain);
/* All kinds of mysterious numbers here */
*rdata_len = 90 + 2 * wglen;
@@ -290,7 +279,7 @@ static void LsarpcTNP3(char *data,char **rdata, int *rdata_len)
SIVAL(*rdata,0x2C,4);
SIVAL(*rdata,0x34,wglen);
for ( i = 0 ; i < wglen ; i++ )
- (*rdata)[0x38 + i * 2] = domain[i];
+ (*rdata)[0x38 + i * 2] = workgroup[i];
/* Now fill in the rest */
i = 0x38 + wglen * 2;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b99aef7528..b6c2313bf4 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -37,7 +37,6 @@ extern connection_struct Connections[];
extern files_struct Files[];
extern BOOL case_sensitive;
extern pstring sesssetup_user;
-extern fstring local_machine;
extern int Client;
/* this macro should always be used to extract an fnum (smb_fid) from
@@ -55,6 +54,7 @@ int reply_special(char *inbuf,char *outbuf)
int msg_flags = CVAL(inbuf,1);
pstring name1,name2;
extern fstring remote_machine;
+ extern fstring local_machine;
char *p;
*name1 = *name2 = 0;
@@ -319,14 +319,6 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
BOOL guest=False;
BOOL computer_id=False;
- 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);
*smb_apasswd = 0;
sess_uid = SVAL(inbuf,smb_uid);
@@ -460,7 +452,7 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
p = smb_buf(outbuf);
strcpy(p,"Unix"); p = skip_string(p,1);
strcpy(p,"Samba "); strcat(p,VERSION); p = skip_string(p,1);
- strcpy(p,domain); p = skip_string(p,1);
+ strcpy(p,lp_workgroup()); p = skip_string(p,1);
set_message(outbuf,3,PTR_DIFF(p,smb_buf(outbuf)),False);
/* perhaps grab OS version here?? */
}
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 4aaab4c087..0e0a524f16 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -3746,8 +3746,6 @@ static void usage(char *pname)
DEBUG(2,("%s changed root to %s\n",timestring(),lp_rootdir()));
}
- read_smbbrowse_conf(myhostname);
-
process();
close_sockets();