#5064 [info hostname] does not observe case sensitivity

obsolete: 8.5.11

OS: Windows XP, Windows 7

Problem Behavior: A windows' machines hostname is "Mof13.somedomain". But [info hostname] returns "mof13.somedomain" (with a lower-case "m"), which can cause problems if the hostname is passed to other applications that need the string in correct case.

Platform-dependant workaround is [exec hostname], in my case.

Expected Behavior: [info hostname] should return the hostname with unchanged upper and lower case.


  • mof

    Well, you are right.

    I just found out that it is PVM (Parallel Virtual Machine) by Oak Ridge National Laboratory (http://www.csm.ornl.gov/pvm/pvm_home.html) that has the case sensitivity in the hostname, which is possibly a bug.

    So I confirm it's not a bug in tcl, but couldn't it be a feature? Providing the hostname in "correct" case should not break anything...

    Thank you very much for the hint to twapis get_computer_netbios_name!

  • mof

    edit: Unfortunately ::twapi::get_computer_netbios_name and ::twapi::get_computer_name respond with all-upper-case strings

    • labels: 105658 --> 27. Channel Types
    • status: open --> pending-invalid
  • Tcl converts the result of the GetComputerName() Win32/Win64 call to lower case (as NetBIOS names are always uppercase and the case _shouldn't matter_) but otherwise does nothing with returned cases. In particular, it never messes with names retrieved from DNS or from the Unix gethostname() call.

    If you've got a deployment where you've got critical case sensitivity in DNS names, You're Doing It Wrong.