]> andersk Git - openssh.git/blobdiff - channels.c
- (djm) Fix rsh path in RPMs. Report from Jason L Tibbitts III
[openssh.git] / channels.c
index 5d410870326713f624aafff952fdcfa5ad24a6bf..b485b50f6ae4c6e543be6871ad807345b89814f0 100644 (file)
@@ -2113,11 +2113,11 @@ cleanup_socket(void)
 }
 
 /*
- * This if called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server.
+ * This is called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server.
  * This starts forwarding authentication requests.
  */
 
-void
+int
 auth_input_request_forwarding(struct passwd * pw)
 {
        int sock, newch;
@@ -2135,8 +2135,16 @@ auth_input_request_forwarding(struct passwd * pw)
        strlcpy(channel_forwarded_auth_socket_dir, "/tmp/ssh-XXXXXXXX", MAX_SOCKET_NAME);
 
        /* Create private directory for socket */
-       if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL)
-               packet_disconnect("mkdtemp: %.100s", strerror(errno));
+       if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL) {
+               packet_send_debug("Agent forwarding disabled: mkdtemp() failed: %.100s",
+                   strerror(errno));
+               restore_uid();
+               xfree(channel_forwarded_auth_socket_name);
+               xfree(channel_forwarded_auth_socket_dir);
+               channel_forwarded_auth_socket_name = NULL;
+               channel_forwarded_auth_socket_dir = NULL;
+               return 0;
+       }
        snprintf(channel_forwarded_auth_socket_name, MAX_SOCKET_NAME, "%s/agent.%d",
                 channel_forwarded_auth_socket_dir, (int) getpid());
 
@@ -2171,6 +2179,7 @@ auth_input_request_forwarding(struct passwd * pw)
                                 xstrdup("auth socket"));
        strlcpy(channels[newch].path, channel_forwarded_auth_socket_name,
            sizeof(channels[newch].path));
+       return 1;
 }
 
 /* This is called to process an SSH_SMSG_AGENT_OPEN message. */
This page took 0.114135 seconds and 4 git commands to generate.