diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-13 02:16:21 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-13 02:16:21 +0000 |
commit | b4ea493599ab414f7828b83f40a5a8b43479ff64 (patch) | |
tree | 22c0a11234617145009a9c2f26038914c5f7cb0e /source/libsmb/namequery.c | |
parent | 966e49a48c352563cdd7f75fe2768f2d6612ec7e (diff) | |
download | samba-b4ea493599ab414f7828b83f40a5a8b43479ff64.tar.gz samba-b4ea493599ab414f7828b83f40a5a8b43479ff64.tar.xz samba-b4ea493599ab414f7828b83f40a5a8b43479ff64.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.
Diffstat (limited to 'source/libsmb/namequery.c')
-rw-r--r-- | source/libsmb/namequery.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c index b6d1f8bda22..b9bc4e11664 100644 --- a/source/libsmb/namequery.c +++ b/source/libsmb/namequery.c @@ -163,7 +163,7 @@ struct node_status *node_status_query(int fd,struct nmb_name *name, a servers name given its IP. Return the matched name in *name. **************************************************************************/ -BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr to_ip, char *name) +BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr to_ip, fstring name) { struct node_status *status = NULL; struct nmb_name nname; @@ -202,7 +202,7 @@ BOOL name_status_find(const char *q_name, int q_type, int type, struct in_addr t if (i == count) goto done; - pull_ascii_nstring(name, status[i].name); + pull_ascii_nstring(name, sizeof(fstring), status[i].name); /* Store the result in the cache. */ /* but don't store an entry for 0x1c names here. Here we have |