diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.422 2015/09/04 08:21:47 dtucker Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.423 2015/09/11 03:47:28 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -506,7 +506,7 @@ main(int ac, char **av) | |||
506 | int i, r, opt, exit_status, use_syslog, config_test = 0; | 506 | int i, r, opt, exit_status, use_syslog, config_test = 0; |
507 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; | 507 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; |
508 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; | 508 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; |
509 | char cname[NI_MAXHOST]; | 509 | char cname[NI_MAXHOST], uidstr[32], *conn_hash_hex; |
510 | struct stat st; | 510 | struct stat st; |
511 | struct passwd *pw; | 511 | struct passwd *pw; |
512 | int timeout_ms; | 512 | int timeout_ms; |
@@ -516,7 +516,6 @@ main(int ac, char **av) | |||
516 | struct addrinfo *addrs = NULL; | 516 | struct addrinfo *addrs = NULL; |
517 | struct ssh_digest_ctx *md; | 517 | struct ssh_digest_ctx *md; |
518 | u_char conn_hash[SSH_DIGEST_MAX_LENGTH]; | 518 | u_char conn_hash[SSH_DIGEST_MAX_LENGTH]; |
519 | char *conn_hash_hex; | ||
520 | 519 | ||
521 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | 520 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
522 | sanitise_stdfd(); | 521 | sanitise_stdfd(); |
@@ -1123,6 +1122,7 @@ main(int ac, char **av) | |||
1123 | strlcpy(shorthost, thishost, sizeof(shorthost)); | 1122 | strlcpy(shorthost, thishost, sizeof(shorthost)); |
1124 | shorthost[strcspn(thishost, ".")] = '\0'; | 1123 | shorthost[strcspn(thishost, ".")] = '\0'; |
1125 | snprintf(portstr, sizeof(portstr), "%d", options.port); | 1124 | snprintf(portstr, sizeof(portstr), "%d", options.port); |
1125 | snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid); | ||
1126 | 1126 | ||
1127 | if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL || | 1127 | if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL || |
1128 | ssh_digest_update(md, thishost, strlen(thishost)) < 0 || | 1128 | ssh_digest_update(md, thishost, strlen(thishost)) < 0 || |
@@ -1165,6 +1165,7 @@ main(int ac, char **av) | |||
1165 | "p", portstr, | 1165 | "p", portstr, |
1166 | "r", options.user, | 1166 | "r", options.user, |
1167 | "u", pw->pw_name, | 1167 | "u", pw->pw_name, |
1168 | "i", uidstr, | ||
1168 | (char *)NULL); | 1169 | (char *)NULL); |
1169 | free(cp); | 1170 | free(cp); |
1170 | } | 1171 | } |