Menu

#148 bad display name "unix:[displaynumber]" in "list" command

v1.0_(example)
open
nobody
None
3
2023-02-09
2021-05-28
No

When issuing xauth.exe list unix:10.0, xauth emits the following error:
xauth.exe: (argv):1: bad display name "unix:10.0" in "list" command

This impacts OpenSSH X11 forwarding scenarios (e.g. https://github.com/PowerShell/Win32-OpenSSH/issues/1563#issuecomment-602498418)

Per the xauth manpage:

Display names for the add, [n]extract, [n]list, [n]merge, and remove commands use the same format as the DISPLAY environment variable and the common -display command line argument. Display-specific information (such as the screen number) is unnecessary and will be ignored. Same-machine connections (such as local-host sockets, shared memory, and the Internet Protocol hostname localhost) are referred to as hostname/unix:displaynumber so that local entries for different machines may be stored in one authority file.

Windows 10 19043.985
vcxsrv-64.1.20.9.0
xauth 1.0.10

Discussion

  • Rafael Rivera

    Rafael Rivera - 2021-05-28

    Additional context, from the OpenSSH codebase
    https://github.com/PowerShell/openssh-portable/blob/latestw_all/clientloop.c#L299-L314

    /*
    
     * Handle FamilyLocal case where $DISPLAY does
     * not match an authorization entry.  For this we
     * just try "xauth list unix:displaynum.screennum".
     * XXX: "localhost" match to determine FamilyLocal
     *      is not perfect.
     */
    if (strncmp(display, "localhost:", 10) == 0) {
      if ((r = snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
          display + 10)) < 0 ||
          (size_t)r >= sizeof(xdisplay)) {
        error_f("display name too long");
        return -1;
      }
      display = xdisplay;
    }
    
     
  • Felipe Santos

    Felipe Santos - 2023-02-09

    I'm facing the same issue, but not only with unix prefix:

    ~  & "C:\\Progra~2\\VcXsrv\\xauth.exe" list
    127.0.0.1:0  MIT-MAGIC-COOKIE-1  1b6bd6bd7a3b1f0d811cfa06832d6918
    
    ~  & "C:\\Progra~2\\VcXsrv\\xauth.exe" list 127.0.0.1:0                                                           15:00:35
    C:\Progra~2\VcXsrv\xauth.exe: (argv):1:  bad display name "127.0.0.1:0" in "list" command
    
    ~  & "C:\\Progra~2\\VcXsrv\\xauth.exe" list localhost:0                                                           15:18:39
    C:\Progra~2\VcXsrv\xauth.exe: (argv):1:  bad display name "localhost:0" in "list" command
    
     

    Last edit: Felipe Santos 2023-02-09

Log in to post a comment.

MongoDB Logo MongoDB