Overview
| Artifact ID: | da1e885becd3701d6411139a89c11ec96d121aa042798c8fb7e9b021191358fd |
|---|---|
| Ticket: | da235271f1e5c582eb54a93a893a85c2cbe2b76c
[info hostname] on Windows is limited to max NetBIOS name length |
| User & Date: | anonymous on 2020-02-21 01:41:14 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I have a Windows host named "emake-ericm-11-2-x-202002210019-win2k12". Using [info hostname] on this system gives me a result of "emake-ericm-11-". This appears to be because in InitializeHostName() (in win/tclWinSock.c), Tcl uses GetComputerNameW() to get the hostname: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcomputernamew GetComputerNameW() is defined to return the NetBIOS name of the host, which is limited to MAX_COMPUTERNAME_LENGTH, which is only 15 characters, at least on some versions of Windows. The documentation for [info hostname] states: Returns the name of the computer on which this invocation is being executed. Note that this name is not guaranteed to be the fully qualified domain name of the host. Where machines have several different names (as is common on systems with both TCP/IP (DNS) and NetBIOS-based networking installed,) it is the name that is suitable for TCP/IP networking that is returned. This seems to be in contradiction to the implementation, which returns the NetBIOS name, not the DNS name. Tcl should instead use GetComputerNameExW, which retrieves the DNS name of the host, or at least should try that first and only fall back to GetComputerNameW if GetComputerNameExW has failed. https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexw - foundin changed to: "8.6.9"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "71ade17b2c497b778fd6637b5d0e4fcf3581ad51"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "17. Commands I-L"
- title changed to:
[info hostname] on Windows is limited to max NetBIOS name length
- type changed to: "Bug"