summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 7241aadac0..b99aef7528 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -37,6 +37,7 @@ 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
@@ -54,7 +55,6 @@ 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,6 +319,14 @@ 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);
@@ -404,12 +412,12 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
first. This is superior as the passwords are mixed case 128 length unicode */
if(smb_ntpasslen && !guest)
{
- if(!password_ok(user,smb_ntpasswd,smb_ntpasslen,NULL,True))
+ if(!password_ok(user,smb_ntpasswd,smb_ntpasslen,NULL))
DEBUG(0,("NT Password did not match ! Defaulting to Lanman\n"));
else
valid_nt_password = True;
}
- if (!valid_nt_password && !guest && !password_ok(user,smb_apasswd,smb_apasslen,NULL,False))
+ if (!valid_nt_password && !guest && !password_ok(user,smb_apasswd,smb_apasslen,NULL))
{
if (!computer_id && lp_security() >= SEC_USER) {
#if (GUEST_SESSSETUP == 0)
@@ -452,7 +460,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,lp_workgroup()); p = skip_string(p,1);
+ strcpy(p,domain); p = skip_string(p,1);
set_message(outbuf,3,PTR_DIFF(p,smb_buf(outbuf)),False);
/* perhaps grab OS version here?? */
}