You need to sign in or sign up before continuing.
Commit e1892b03 authored by Stas Korobeynikov's avatar Stas Korobeynikov Committed by Pavel Vainerman

add nxmode enabled param use

parent 1f8b3300
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
#define HTTP_MAXHDRS 64
char *client_version_string = NULL; char *client_version_string = NULL;
char *server_version_string = NULL; char *server_version_string = NULL;
Key *previous_host_key = NULL; Key *previous_host_key = NULL;
...@@ -794,14 +796,27 @@ ssh_connect_direct(const char *host, struct addrinfo *aitop, ...@@ -794,14 +796,27 @@ ssh_connect_direct(const char *host, struct addrinfo *aitop,
memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen);
break; break;
} else { } else {
debug("connect to address %s port %s: %s", if (NxAdminModeEnabled) {
ntop, strport, strerror(errno)); fprintf(stdout, "NX> 207 nxssh: connect to address %s port %s: %s\n",
close(sock); sockaddr_ntop(ai->ai_addr, ai->ai_addrlen),
sock = -1; strport, strerror(errno));
} else if (NxAuthOnlyModeEnabled) {
fprintf(stdout, "NX> 207 nxssh: connect to address %s port %s: %s",
sockaddr_ntop(ai->ai_addr, ai->ai_addrlen),
strport, strerror(errno));
} else {
debug("connect to address %s port %s: %s",
ntop, strport, strerror(errno));
close(sock);
sock = -1;
}
} }
} }
if (sock != -1) if (sock != -1) {
if (NxModeEnabled)
logit("NX> 200 Connected to address: %.200s on port: %.200s", ntop, strport);
break; /* Successful connection. */ break; /* Successful connection. */
}
} }
/* Return failure if we didn't get a successful connection. */ /* Return failure if we didn't get a successful connection. */
...@@ -1319,7 +1334,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, ...@@ -1319,7 +1334,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
" found in DNS.\n"); " found in DNS.\n");
} }
snprintf(msg, sizeof(msg), snprintf(msg, sizeof(msg),
"The authenticity of host '%.200s (%s)' can't be " "NX> 211 The authenticity of host '%.200s (%s)' can't be "
"established%s\n" "established%s\n"
"%s key fingerprint is %s.%s%s\n%s" "%s key fingerprint is %s.%s%s\n%s"
"Are you sure you want to continue connecting " "Are you sure you want to continue connecting "
...@@ -1440,6 +1455,9 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port, ...@@ -1440,6 +1455,9 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
warn_changed_key(host_key); warn_changed_key(host_key);
error("Add correct host key in %.100s to get rid of this message.", error("Add correct host key in %.100s to get rid of this message.",
user_hostfiles[0]); user_hostfiles[0]);
if (NxModeEnabled || NxAdminModeEnabled) {
error("NX> 209 Remote host identification has changed.");
}
error("Offending %s key in %s:%lu", key_type(host_found->key), error("Offending %s key in %s:%lu", key_type(host_found->key),
host_found->file, host_found->line); host_found->file, host_found->line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment