summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_winsproxy.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-13 02:16:26 +0000
committerJeremy Allison <jra@samba.org>2004-03-13 02:16:26 +0000
commit9a699d74efbcbbb8607c7dea2734d7acb3478896 (patch)
tree4011e11c2e25b3073f10ab9486ac884702639330 /source3/nmbd/nmbd_winsproxy.c
parente4a01b392c518d3706d86d4938ac85707fe275e6 (diff)
downloadsamba-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/nmbd/nmbd_winsproxy.c')
-rw-r--r--source3/nmbd/nmbd_winsproxy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nmbd/nmbd_winsproxy.c b/source3/nmbd/nmbd_winsproxy.c
index bace112752..d91818698e 100644
--- a/source3/nmbd/nmbd_winsproxy.c
+++ b/source3/nmbd/nmbd_winsproxy.c
@@ -30,7 +30,7 @@ static void wins_proxy_name_query_request_success( struct subnet_record *subrec,
struct userdata_struct *userdata,
struct nmb_name *nmbname, struct in_addr ip, struct res_rec *rrec)
{
- nstring name;
+ fstring name;
struct packet_struct *original_packet;
struct subnet_record *orig_broadcast_subnet;
struct name_record *namerec;
@@ -73,7 +73,7 @@ returned for name %s.\n", nmb_namestr(nmbname) ));
if(rrec == PERMANENT_TTL)
ttl = lp_max_ttl();
- pull_ascii_nstring(name, nmbname->name);
+ pull_ascii_nstring(name, sizeof(name), nmbname->name);
namerec = add_name_to_subnet( orig_broadcast_subnet, name,
nmbname->name_type, nb_flags, ttl,
WINS_PROXY_NAME, num_ips, iplist );
@@ -193,7 +193,7 @@ void make_wins_proxy_name_query_request( struct subnet_record *subrec,
long *ud[(sizeof(struct userdata_struct) + sizeof(struct subrec *) +
sizeof(struct packet_struct *))/sizeof(long *) + 1];
struct userdata_struct *userdata = (struct userdata_struct *)ud;
- nstring qname;
+ fstring qname;
memset(ud, '\0', sizeof(ud));
@@ -205,7 +205,7 @@ void make_wins_proxy_name_query_request( struct subnet_record *subrec,
sizeof(struct packet_struct *));
/* Now use the unicast subnet to query the name with the WINS server. */
- pull_ascii_nstring(qname, question_name->name);
+ pull_ascii_nstring(qname, sizeof(qname), question_name->name);
query_name( unicast_subnet, qname, question_name->name_type,
wins_proxy_name_query_request_success,
wins_proxy_name_query_request_fail,