diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/channels.c b/channels.c index f26b3a65b..bfa025ad7 100644 --- a/channels.c +++ b/channels.c | |||
@@ -17,7 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | RCSID("$Id: channels.c,v 1.31 2000/05/17 12:34:23 damien Exp $"); | 20 | RCSID("$Id: channels.c,v 1.32 2000/06/07 09:55:44 djm Exp $"); |
21 | 21 | ||
22 | #include "ssh.h" | 22 | #include "ssh.h" |
23 | #include "packet.h" | 23 | #include "packet.h" |
@@ -2113,11 +2113,11 @@ cleanup_socket(void) | |||
2113 | } | 2113 | } |
2114 | 2114 | ||
2115 | /* | 2115 | /* |
2116 | * This if called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server. | 2116 | * This is called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server. |
2117 | * This starts forwarding authentication requests. | 2117 | * This starts forwarding authentication requests. |
2118 | */ | 2118 | */ |
2119 | 2119 | ||
2120 | void | 2120 | int |
2121 | auth_input_request_forwarding(struct passwd * pw) | 2121 | auth_input_request_forwarding(struct passwd * pw) |
2122 | { | 2122 | { |
2123 | int sock, newch; | 2123 | int sock, newch; |
@@ -2135,8 +2135,16 @@ auth_input_request_forwarding(struct passwd * pw) | |||
2135 | strlcpy(channel_forwarded_auth_socket_dir, "/tmp/ssh-XXXXXXXX", MAX_SOCKET_NAME); | 2135 | strlcpy(channel_forwarded_auth_socket_dir, "/tmp/ssh-XXXXXXXX", MAX_SOCKET_NAME); |
2136 | 2136 | ||
2137 | /* Create private directory for socket */ | 2137 | /* Create private directory for socket */ |
2138 | if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL) | 2138 | if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL) { |
2139 | packet_disconnect("mkdtemp: %.100s", strerror(errno)); | 2139 | packet_send_debug("Agent forwarding disabled: mkdtemp() failed: %.100s", |
2140 | strerror(errno)); | ||
2141 | restore_uid(); | ||
2142 | xfree(channel_forwarded_auth_socket_name); | ||
2143 | xfree(channel_forwarded_auth_socket_dir); | ||
2144 | channel_forwarded_auth_socket_name = NULL; | ||
2145 | channel_forwarded_auth_socket_dir = NULL; | ||
2146 | return 0; | ||
2147 | } | ||
2140 | snprintf(channel_forwarded_auth_socket_name, MAX_SOCKET_NAME, "%s/agent.%d", | 2148 | snprintf(channel_forwarded_auth_socket_name, MAX_SOCKET_NAME, "%s/agent.%d", |
2141 | channel_forwarded_auth_socket_dir, (int) getpid()); | 2149 | channel_forwarded_auth_socket_dir, (int) getpid()); |
2142 | 2150 | ||
@@ -2171,6 +2179,7 @@ auth_input_request_forwarding(struct passwd * pw) | |||
2171 | xstrdup("auth socket")); | 2179 | xstrdup("auth socket")); |
2172 | strlcpy(channels[newch].path, channel_forwarded_auth_socket_name, | 2180 | strlcpy(channels[newch].path, channel_forwarded_auth_socket_name, |
2173 | sizeof(channels[newch].path)); | 2181 | sizeof(channels[newch].path)); |
2182 | return 1; | ||
2174 | } | 2183 | } |
2175 | 2184 | ||
2176 | /* This is called to process an SSH_SMSG_AGENT_OPEN message. */ | 2185 | /* This is called to process an SSH_SMSG_AGENT_OPEN message. */ |