Skip to content
Tcl Source Code History Of Ticket da235271f1
Login

History Of Ticket da235271f1

Artifacts Associated With Ticket da235271f1

  1. Ticket change [da1e885bec] (rid 179228) by anonymous on 2020-02-21 01:41:14:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized 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
      
    5. foundin initialized to: "8.6.9"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "71ade17b2c497b778fd6637b5d0e4fcf3581ad51"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "17. Commands I-L"
    15. title initialized to:
      [info hostname] on Windows is limited to max NetBIOS name length
      
    16. type initialized to: "Bug"
  2. Ticket change [c9b00da9c1] (rid 179239) by oehhar on 2020-02-21 09:03:39:

    1. icomment:
      Yes, tahnk you for the proposal.
      
      I suppose, the code is from the aera where Netbios name was prefered and DNS was (not jet) present in the Microsoft world.
      
      What do you think about the code in branch [bug-da235271f1-win-netbios-host-prefered].
      
      Would this fix your issue ?
      
      Thank you,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  3. Ticket change [b586dae029] (rid 179244) by jan.nijtmans on 2020-02-21 09:30:45:

    1. icomment:
      @Harald. You were faster then me, I only saw your commit after I committed my solutions.
      
      @emelski: Do you prefer to use GetComputerNameExW(), or do you prefer Harald's solution (using hostname()).
      
      My preference whould be GetComputerNameExW(), since it - theoretically - can handle more than ASCII.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  4. Ticket change [dd35cc9d30] (rid 179245) by oehhar on 2020-02-21 09:44:53:

    1. icomment:
      Jan,
      
      thank you for the great fix.
      
      I suppose, this is ok.
      
      Don't you think, the order should be inverted and the netbios name should be taken as fallback?
      
      So first call it with ComputerNameDnsFullyQualified, then with ComputerNameNetBIOS?
      
      Thank you,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  5. Ticket change [8677bb0b6a] (rid 179246) by anonymous on 2020-02-21 17:27:04:

    1. icomment:
      Sorry, I don't know how to view the patches you have created -- I tried looking in
      https://core.tcl-lang.org/tcl/brlist but I couldn't find them.
      
      In any case, I think GetComputerNameExW is the right method to use, and it should 
      try DNS first and then NetBIOS.  The entire problem here is that Tcl is preferring 
      the NetBIOS name instead of the DNS name.  I'm not even sure it's possible to get 
      a name longer than 15 characters from NetBIOS -- that is, I don't know if that is 
      a limit inherent to NetBIOS or if that is "just" a limit of GetComputerNameW.  It 
      seems best therefore to default to the DNS name, and only try for the NetBIOS name 
      if there is no DNS name.
      
      - emelski
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  6. Ticket change [ca10369b04] (rid 179289) by oehhar on 2020-02-25 13:27:14:

    1. icomment:
      Please first log in as anonymous (or your login if you have one):
      
      https://core.tcl-lang.org/tcl/login
      
      When logged in, there is a "ZIP Archive" link in the page of each checkin:
      
      Jan: [632704e948]
      
      Harald: [7fedbce431]
      
      We are interseted, if this solves your issue.
      
      Thank you,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  7. Ticket change [5100337dd7] (rid 182319) by apnadkarni on 2020-04-23 12:37:38:

    1. icomment:
      I would suggest the use of ComputerNamePhysicalDnsFullyQualified instead of ComputerNameDnsFullyQualified in the call to GetComputerNameExW. The latter will return the virtual name of the cluster if part of one whereas I think [info hostname] should return the real name of this system, not the cluster's DNS name.
      
      /Ashok
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  8. Ticket change [a0881b1b0e] (rid 182872) by oehhar on 2020-04-30 15:43:51:

    1. icomment:
      Thank you, Ashok.
      I think, that is reasonable.
      
      Performed Actions:
      
         *   Ashok's proposal is in branch [core-8-6-branch] with checkin [2ba1cd687f].
         *   Close branch [bug-da235271f1-win-netbios-host-prefered].
      
      May I ask the original author again, if the issue is fixed by this modification ?
      Otherwise, I may close the ticket next week.
      
      Thank you all,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  9. Ticket change [051d34bc8b] (rid 258158) by serhiy.storchaka on 2026-10-15 11:39:52:

    1. icomment:
      Fixed by [632704e948] and [2ba1cd687f], first released in 8.6.11.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  10. Ticket change [51e3b22b22] (rid 259950) by serhiy.storchaka on 2026-10-22 17:19:27:

    1. closedate changed to: "2461328.986020428"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"