From 9a699d74efbcbbb8607c7dea2734d7acb3478896 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Mar 2004 02:16:26 +0000 Subject: 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) --- source3/nmbd/nmbd_logonnames.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/nmbd/nmbd_logonnames.c') diff --git a/source3/nmbd/nmbd_logonnames.c b/source3/nmbd/nmbd_logonnames.c index f79fc56f7b..b6e841139f 100644 --- a/source3/nmbd/nmbd_logonnames.c +++ b/source3/nmbd/nmbd_logonnames.c @@ -35,11 +35,11 @@ static void become_logon_server_fail(struct subnet_record *subrec, struct response_record *rrec, struct nmb_name *fail_name) { - nstring failname; + fstring failname; struct work_record *work; struct server_record *servrec; - pull_ascii_nstring(failname, fail_name->name); + pull_ascii_nstring(failname, sizeof(failname), fail_name->name); work = find_workgroup_on_subnet(subrec, failname); if(!work) { DEBUG(0,("become_logon_server_fail: Error - cannot find \ @@ -76,11 +76,11 @@ static void become_logon_server_success(struct subnet_record *subrec, uint16 nb_flags, int ttl, struct in_addr registered_ip) { - nstring reg_name; + fstring reg_name; struct work_record *work; struct server_record *servrec; - pull_ascii_nstring(reg_name, registered_name->name); + pull_ascii_nstring(reg_name, sizeof(reg_name), registered_name->name); work = find_workgroup_on_subnet( subrec, reg_name); if(!work) { DEBUG(0,("become_logon_server_success: Error - cannot find \ -- cgit