Hi,

  When x11 forwarding is disabled by sshd_config, or x11 forwarding
  don't work for some reason else, sshd will complain "error: failed to
  create a directory for the temporary X authority file: No such file or
  directory; will use the default xauth file"
  This complain will mislead users.

  The following patch will fix for it.

Index: sshd/session.c
===================================================================
--- sshd/session.c      (revision 840)
+++ sshd/session.c      (working copy)
@@ -1866,6 +1866,7 @@ session_x11_req(Session *s)
                xfree(s->auth_data);
                s->auth_proto = NULL;
                s->auth_data = NULL;
+               return 0;
        }
 
        /*
@@ -1877,7 +1878,7 @@ session_x11_req(Session *s)
         * means that we won't set XAUTHORITY variable in child's environment
         * and xauth(1) will use the default location for the authority file.
         */
-       if (success && mkdtemp(xauthdir) != NULL) {
+       if (mkdtemp(xauthdir) != NULL) {
                s->auth_file = xmalloc(MAXPATHLEN);
                snprintf(s->auth_file, MAXPATHLEN, "%s/xauthfile",
                    xauthdir);
-------------- next part --------------
Index: sshd/session.c
===================================================================
--- sshd/session.c      (revision 840)
+++ sshd/session.c      (working copy)
@@ -1866,6 +1866,7 @@ session_x11_req(Session *s)
                xfree(s->auth_data);
                s->auth_proto = NULL;
                s->auth_data = NULL;
+               return 0;
        }
 
        /*
@@ -1877,7 +1878,7 @@ session_x11_req(Session *s)
         * means that we won't set XAUTHORITY variable in child's environment
         * and xauth(1) will use the default location for the authority file.
         */
-       if (success && mkdtemp(xauthdir) != NULL) {
+       if (mkdtemp(xauthdir) != NULL) {
                s->auth_file = xmalloc(MAXPATHLEN);
                snprintf(s->auth_file, MAXPATHLEN, "%s/xauthfile",
                    xauthdir);

Reply via email to