version 1.298, 2018/06/06 18:29:18 |
version 1.299, 2018/06/09 02:58:02 |
|
|
|
|
if (getenv("TZ")) |
if (getenv("TZ")) |
child_set_env(&env, &envsize, "TZ", getenv("TZ")); |
child_set_env(&env, &envsize, "TZ", getenv("TZ")); |
|
if (s->term) |
|
child_set_env(&env, &envsize, "TERM", s->term); |
|
if (s->display) |
|
child_set_env(&env, &envsize, "DISPLAY", s->display); |
|
#ifdef KRB5 |
|
if (s->authctxt->krb5_ticket_file) |
|
child_set_env(&env, &envsize, "KRB5CCNAME", |
|
s->authctxt->krb5_ticket_file); |
|
#endif |
|
if (auth_sock_name != NULL) |
|
child_set_env(&env, &envsize, SSH_AUTHSOCKET_ENV_NAME, |
|
auth_sock_name); |
|
|
|
|
/* Set custom environment options from pubkey authentication. */ |
/* Set custom environment options from pubkey authentication. */ |
if (options.permit_user_env) { |
if (options.permit_user_env) { |
for (n = 0 ; n < auth_opts->nenv; n++) { |
for (n = 0 ; n < auth_opts->nenv; n++) { |
|
|
} |
} |
} |
} |
|
|
|
/* read $HOME/.ssh/environment. */ |
|
if (options.permit_user_env) { |
|
snprintf(buf, sizeof buf, "%.200s/.ssh/environment", |
|
pw->pw_dir); |
|
read_environment_file(&env, &envsize, buf); |
|
} |
|
|
/* SSH_CLIENT deprecated */ |
/* SSH_CLIENT deprecated */ |
snprintf(buf, sizeof buf, "%.50s %d %d", |
snprintf(buf, sizeof buf, "%.50s %d %d", |
ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), |
ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), |
|
|
child_set_env(&env, &envsize, "SSH_USER_AUTH", auth_info_file); |
child_set_env(&env, &envsize, "SSH_USER_AUTH", auth_info_file); |
if (s->ttyfd != -1) |
if (s->ttyfd != -1) |
child_set_env(&env, &envsize, "SSH_TTY", s->tty); |
child_set_env(&env, &envsize, "SSH_TTY", s->tty); |
if (s->term) |
|
child_set_env(&env, &envsize, "TERM", s->term); |
|
if (s->display) |
|
child_set_env(&env, &envsize, "DISPLAY", s->display); |
|
if (original_command) |
if (original_command) |
child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", |
child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", |
original_command); |
original_command); |
#ifdef KRB5 |
|
if (s->authctxt->krb5_ticket_file) |
|
child_set_env(&env, &envsize, "KRB5CCNAME", |
|
s->authctxt->krb5_ticket_file); |
|
#endif |
|
if (auth_sock_name != NULL) |
|
child_set_env(&env, &envsize, SSH_AUTHSOCKET_ENV_NAME, |
|
auth_sock_name); |
|
|
|
/* read $HOME/.ssh/environment. */ |
|
if (options.permit_user_env) { |
|
snprintf(buf, sizeof buf, "%.200s/.ssh/environment", |
|
pw->pw_dir); |
|
read_environment_file(&env, &envsize, buf); |
|
} |
|
if (debug_flag) { |
if (debug_flag) { |
/* dump the environment */ |
/* dump the environment */ |
fprintf(stderr, "Environment:\n"); |
fprintf(stderr, "Environment:\n"); |