diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-13 02:16:26 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-13 02:16:26 +0000 |
commit | 9a699d74efbcbbb8607c7dea2734d7acb3478896 (patch) | |
tree | 4011e11c2e25b3073f10ab9486ac884702639330 /source3/smbd | |
parent | e4a01b392c518d3706d86d4938ac85707fe275e6 (diff) | |
download | samba-9a699d74efbcbbb8607c7dea2734d7acb3478896.tar.gz samba-9a699d74efbcbbb8607c7dea2734d7acb3478896.tar.bz2 samba-9a699d74efbcbbb8607c7dea2734d7acb3478896.zip |
Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAMA Masayuki).
Don't use nstrings to hold workgroup and netbios names. The problem with them is that MB netbios
and workgroup names in unix charset (particularly utf8) may be up to 3x bigger than the name
when represented in dos charset (ie. cp932). So go back to using fstrings for these but
translate into nstrings (ie. 16 byte length values) for transport on the wire.
Jeremy.
(This used to be commit 128dec9ae68fd357550de2649d54056ca4fc65cf)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/negprot.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 28e3cf97d1..96961368fb 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -169,6 +169,8 @@ static int reply_lanman2(char *inbuf, char *outbuf) static int negprot_spnego(char *p) { DATA_BLOB blob; + nstring dos_name; + fstring unix_name; uint8 guid[17]; const char *OIDs_krb5[] = {OID_KERBEROS5, OID_KERBEROS5_OLD, @@ -181,7 +183,11 @@ static int negprot_spnego(char *p) global_spnego_negotiated = True; ZERO_STRUCT(guid); - safe_strcpy((char *)guid, global_myname(), sizeof(guid)-1); + + safe_strcpy(unix_name, global_myname(), sizeof(unix_name)-1); + strlower_m(unix_name); + push_ascii_nstring(dos_name, unix_name); + safe_strcpy((char *)guid, dos_name, sizeof(guid)-1); #ifdef DEVELOPER /* valgrind fixer... */ @@ -192,8 +198,6 @@ static int negprot_spnego(char *p) } #endif - strlower_m((char *)guid); - #if 0 /* strangely enough, NT does not sent the single OID NTLMSSP when not a ADS member, it sends no OIDs at all |