diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-10-02 14:09:22 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-10-02 14:09:22 +0000 |
commit | 5a2f52b79e28530c454cb488a44588147640f061 (patch) | |
tree | 1f412098bbcf050bce556d00f2c3fddd470746c9 /source3/smbd/reply.c | |
parent | 11d9539d755d5c5accb4481577781b8b7bfeda50 (diff) | |
download | samba-5a2f52b79e28530c454cb488a44588147640f061.tar.gz samba-5a2f52b79e28530c454cb488a44588147640f061.tar.xz 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/reply.c')
-rw-r--r-- | source3/smbd/reply.c | 16 |
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?? */ } |