The workgroup of this system contains a german umlaut. lmuelle@gray:~> nmblookup -A 10.10.0.161 Looking up status of 10.10.0.161 TAIT <00> - B <ACTIVE> TAIT <03> - B <ACTIVE> TAIT <20> - B <ACTIVE> ..__MSBROWSE__. <01> - <GROUP> B <ACTIVE> TAIT.. <00> - <GROUP> B <ACTIVE> TAIT.. <1b> - B <ACTIVE> TAIT.. <1c> - B <ACTIVE> TAIT.. <1d> - B <ACTIVE> TAIT.. <1e> - <GROUP> B <ACTIVE>
Created attachment 1906 [details] nmblookup report multibyte chars support After applying this patch nmblookup corectly displays national chars in workgroup and machine's name. Tested on 3.0.22
Created attachment 2758 [details] nmblookup -d10 -A ip
I have such problem on FreeBSD 6.1. Smbclient -L ip returns russian names, but nmblookup -A ip returns "......"
Comment on attachment 2758 [details] nmblookup -d10 -A ip # nmblookup -d10 -A 192.168.30.253 >INFO: Current debug levels: > all: True/10 > tdb: False/0 > printdrivers: False/0 > lanman: False/0 > smb: False/0 > rpc_parse: False/0 > rpc_srv: False/0 > rpc_cli: False/0 > passdb: False/0 > sam: False/0 > auth: False/0 > winbind: False/0 > vfs: False/0 > idmap: False/0 > quota: False/0 > acls: False/0 > locking: False/0 > msdfs: False/0 > dmapi: False/0 >lp_load: refreshing parameters >Initialising global parameters >params.c:pm_process() - Processing configuration file "/usr/local/etc/smb.conf" >Processing section "[global]" >doing parameter max log size = 50 >doing parameter display charset = cp1251 >Attempting to register new charset UCS-2LE >Registered charset UCS-2LE >Attempting to register new charset UTF-16LE >Registered charset UTF-16LE >Attempting to register new charset UCS-2BE >Registered charset UCS-2BE >Attempting to register new charset UTF-16BE >Registered charset UTF-16BE >Attempting to register new charset UTF8 >Registered charset UTF8 >Attempting to register new charset UTF-8 >Registered charset UTF-8 >Attempting to register new charset ASCII >Registered charset ASCII >Attempting to register new charset 646 >Registered charset 646 >Attempting to register new charset ISO-8859-1 >Registered charset ISO-8859-1 >Attempting to register new charset UCS2-HEX >Registered charset UCS2-HEX >doing parameter unix charset = cp1251 >doing parameter dos charset = cp866 >doing parameter preserve case = yes >doing parameter short preserve case = yes >pm_process() returned Yes >lp_servicenumber: couldn't find homes >set_server_role: role = ROLE_STANDALONE >added interface ip=192.168.30.252 bcast=192.168.30.255 nmask=255.255.255.0 >bind succeeded on port 0 >socket option SO_KEEPALIVE = 0 >socket option SO_REUSEADDR = 4 >socket option SO_BROADCAST = 32 >Could not test socket option TCP_NODELAY. >socket option IPTOS_LOWDELAY = 0 >socket option IPTOS_THROUGHPUT = 0 >socket option SO_REUSEPORT = 512 >socket option SO_SNDBUF = 9216 >socket option SO_RCVBUF = 42080 >socket option SO_SNDLOWAT = 2048 >socket option SO_RCVLOWAT = 1 >socket option SO_SNDTIMEO = 0 >socket option SO_RCVTIMEO = 0 >Socket opened. >lang_tdb_init: /usr/local/lib/samba/ru_RU.KOI8-R.msg: No such file or directory >Looking up status of 192.168.30.253 >Sending a packet of len 50 to (192.168.30.253) on port 137 >read_udp_socket: lastip 192.168.30.253 lastport 137 read: 175 >parse_nmb: packet id = 31065 >Received a packet of len 175 from (192.168.30.253) port 137 >nmb packet from 192.168.30.253(137) header: id=31065 opcode=Query(0) response=Yes > header: flags: bcast=No rec_avail=No rec_des=No trunc=No auth=Yes > header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0 > answers: nmb_name=*<00> rr_type=33 rr_class=1 ttl=0 > answers 0 char ...... hex 038B888B889220202020202020202020 > answers 10 char ...MSHOME hex 0004004D53484F4D4520202020202020 > answers 20 char ........ hex 20200084008B888B8892202020202020 > answers 30 char ....'.rn... hex 20202020200400009027A3726E000000 > answers 40 char ................ hex 00000000000000000000000000000000 > answers 50 char ................ hex 00000000000000000000000000000000 > answers 60 char ..... hex 0000000000 >-T-T-#00: flags = 0x04 >MSHOME#00: flags = 0x84 >-T-T-#20: flags = 0x04 > ..... <00> - B <ACTIVE> > MSHOME <00> - <GROUP> B <ACTIVE> > ..... <20> - B <ACTIVE> > > MAC Address = 00-00-12-A3-72-6E
Netbios does not handle character sets savely any other than ASCII and does an own HEX-to-ASCII presentation of non-ASCII names. If you give yourself a non-ASCII Netbios name your "real" Netbios name (in the HEX-to-ASCII presentation) depends on your client's local codepage. For that reason non-ASCII Netbios names have to be considered to be a broken setup. If this should be handeled by Samba at all, there should not be a conversion like suggested in comment #1 but instead non-ASCII should be printed in a \xxx HEX notation. IMHO this is a "wontfix".
Björn, I think at least we need to allow displaying nmblookup output in 'display charset'. The patch from Vladimir is along the lines though it should be done through Samba existing facilities. As for NetBIOS names issue itself, the only fix here should to force the same encoding for all NetBIOS hosts on the local network. NetBIOS has no idea of encoding for NMB names, they are treated as binary ones. Samba allows them to be treated according to an encoding on the server but this is an administrative issue to follow rules on all hosts. NetBIOS names using non-ASCII encoding are in common use, at least in Easter Europe, CIS countries, and Far East. They work perfectly if admins are careful. There is no need to forbid this usage at all. So, I'd like to accept a patch that fixes nmblookup to follow 'display charset' if someone would write it.
Alexander, as you just don't know the encoding of the Netbios name - from WHAT charset to "display charset" do you want to convert? You can simply guess that every Netbios name you see on the net is encoded in your DOS CHARSET and convert from dos charset to display charset but you cannot do that assumption. - you will have to implement workarounds for cases where the conversion from dos charset to dispay charset fails and you will also see cases where - you see wrong results is displayed because of different client codepages.
Björn, should we close this one?
I think so, yes.