summaryrefslogtreecommitdiff
path: root/source3/smbd/pipes.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-02 14:09:22 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-02 14:09:22 +0000
commit5a2f52b79e28530c454cb488a44588147640f061 (patch)
tree1f412098bbcf050bce556d00f2c3fddd470746c9 /source3/smbd/pipes.c
parent11d9539d755d5c5accb4481577781b8b7bfeda50 (diff)
downloadsamba-5a2f52b79e28530c454cb488a44588147640f061.tar.gz
samba-5a2f52b79e28530c454cb488a44588147640f061.tar.bz2
samba-5a2f52b79e28530c454cb488a44588147640f061.zip
- a huge pile of changes from Luke which implement the browse.conf
stuff and also fix a pile of nmbd bugs. Unfortunately I found it very hard to disentangle the new features from the bug fixes so I am putting in the new code. I hope this is the last big pile of changes to the 1.9.16 series! (This used to be commit 20b6203dac4bbb43e4e7bea0b214496d76d679d9)
Diffstat (limited to 'source3/smbd/pipes.c')
-rw-r--r--source3/smbd/pipes.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index ffa46083c3..35f8d684eb 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -44,6 +44,8 @@ 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))
@@ -251,9 +253,18 @@ static void LsarpcTNP3(char *data,char **rdata, int *rdata_len)
{
uint32 dword1;
uint16 word1;
- char * workgroup = lp_workgroup();
- int wglen = strlen(workgroup);
+ int wglen;
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;
@@ -279,7 +290,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] = workgroup[i];
+ (*rdata)[0x38 + i * 2] = domain[i];
/* Now fill in the rest */
i = 0x38 + wglen * 2;