version 1.478, 2018/06/01 03:11:49 |
version 1.479, 2018/06/01 03:33:53 |
|
|
strlcpy(shorthost, thishost, sizeof(shorthost)); |
strlcpy(shorthost, thishost, sizeof(shorthost)); |
shorthost[strcspn(thishost, ".")] = '\0'; |
shorthost[strcspn(thishost, ".")] = '\0'; |
snprintf(portstr, sizeof(portstr), "%d", options.port); |
snprintf(portstr, sizeof(portstr), "%d", options.port); |
snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid); |
snprintf(uidstr, sizeof(uidstr), "%llu", |
|
(unsigned long long)pw->pw_uid); |
|
|
if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL || |
if ((md = ssh_digest_start(SSH_DIGEST_SHA1)) == NULL || |
ssh_digest_update(md, thishost, strlen(thishost)) < 0 || |
ssh_digest_update(md, thishost, strlen(thishost)) < 0 || |
|
|
"L", shorthost, |
"L", shorthost, |
"d", pw->pw_dir, |
"d", pw->pw_dir, |
"h", host, |
"h", host, |
|
"i", uidstr, |
"l", thishost, |
"l", thishost, |
"n", host_arg, |
"n", host_arg, |
"p", portstr, |
"p", portstr, |
|
|
"C", conn_hash_hex, |
"C", conn_hash_hex, |
"L", shorthost, |
"L", shorthost, |
"h", host, |
"h", host, |
|
"i", uidstr, |
"l", thishost, |
"l", thishost, |
"n", host_arg, |
"n", host_arg, |
"p", portstr, |
"p", portstr, |
|
|
} else { |
} else { |
p = tilde_expand_filename(options.identity_agent, |
p = tilde_expand_filename(options.identity_agent, |
original_real_uid); |
original_real_uid); |
cp = percent_expand(p, "d", pw->pw_dir, |
cp = percent_expand(p, |
"u", pw->pw_name, "l", thishost, "h", host, |
"d", pw->pw_dir, |
"r", options.user, (char *)NULL); |
"h", host, |
|
"i", uidstr, |
|
"l", thishost, |
|
"r", options.user, |
|
"u", pw->pw_name, |
|
(char *)NULL); |
setenv(SSH_AUTHSOCKET_ENV_NAME, cp, 1); |
setenv(SSH_AUTHSOCKET_ENV_NAME, cp, 1); |
free(cp); |
free(cp); |
free(p); |
free(p); |
|
|
"L", shorthost, |
"L", shorthost, |
"d", pw->pw_dir, |
"d", pw->pw_dir, |
"h", host, |
"h", host, |
|
"i", uidstr, |
"l", thishost, |
"l", thishost, |
"n", host_arg, |
"n", host_arg, |
"p", portstr, |
"p", portstr, |
|
|
for (i = 0; i < options.num_certificate_files; i++) { |
for (i = 0; i < options.num_certificate_files; i++) { |
cp = tilde_expand_filename(options.certificate_files[i], |
cp = tilde_expand_filename(options.certificate_files[i], |
original_real_uid); |
original_real_uid); |
filename = percent_expand(cp, "d", pw->pw_dir, |
filename = percent_expand(cp, |
"u", pw->pw_name, "l", thishost, "h", host, |
"d", pw->pw_dir, |
"r", options.user, (char *)NULL); |
"h", host, |
|
"i", host, |
|
"l", thishost, |
|
"r", options.user, |
|
"u", pw->pw_name, |
|
(char *)NULL); |
free(cp); |
free(cp); |
|
|
public = key_load_public(filename, NULL); |
public = key_load_public(filename, NULL); |