View | Details | Raw Unified | Return to bug 2449
Collapse All | Expand All

(-)a/ssh.c (-1 / +4 lines)
Lines 505-511 main(int ac, char **av) Link Here
505
{
505
{
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
	    uidstr[11];
509
	char cname[NI_MAXHOST];
510
	char cname[NI_MAXHOST];
510
	struct stat st;
511
	struct stat st;
511
	struct passwd *pw;
512
	struct passwd *pw;
Lines 1122-1127 main(int ac, char **av) Link Here
1122
	strlcpy(shorthost, thishost, sizeof(shorthost));
1123
	strlcpy(shorthost, thishost, sizeof(shorthost));
1123
	shorthost[strcspn(thishost, ".")] = '\0';
1124
	shorthost[strcspn(thishost, ".")] = '\0';
1124
	snprintf(portstr, sizeof(portstr), "%d", options.port);
1125
	snprintf(portstr, sizeof(portstr), "%d", options.port);
1126
	snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid);
1125
1127
1126
	if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL ||
1128
	if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL ||
1127
	    ssh_digest_update(md, thishost, strlen(thishost)) < 0 ||
1129
	    ssh_digest_update(md, thishost, strlen(thishost)) < 0 ||
Lines 1164-1169 main(int ac, char **av) Link Here
1164
		    "p", portstr,
1166
		    "p", portstr,
1165
		    "r", options.user,
1167
		    "r", options.user,
1166
		    "u", pw->pw_name,
1168
		    "u", pw->pw_name,
1169
		    "i", uidstr,
1167
		    (char *)NULL);
1170
		    (char *)NULL);
1168
		free(cp);
1171
		free(cp);
1169
	}
1172
	}
(-)a/ssh_config.5 (-2 / +3 lines)
Lines 538-544 the destination port, Link Here
538
.Ql %r
538
.Ql %r
539
by the remote login username,
539
by the remote login username,
540
.Ql %u
540
.Ql %u
541
by the username of the user running
541
by the username and
542
.Ql %i
543
by the numeric user id (uid) of the user running
542
.Xr ssh 1 , and
544
.Xr ssh 1 , and
543
.Ql \&%C
545
.Ql \&%C
544
by a hash of the concatenation: %l%h%p%r.
546
by a hash of the concatenation: %l%h%p%r.
545
- 

Return to bug 2449