2907
2907
start_command_handler_ssh (ctrl_t ctrl, gnupg_fd_t sock_client)
2909
estream_t stream_sock;
2909
estream_t stream_sock = NULL;
2910
gpg_error_t err = 0;
2913
2913
/* Because the ssh protocol does not send us information about the
2914
2914
the current TTY setting, we resort here to use those from startup
2915
2915
or those explictly set. */
2916
if (!ctrl->display && opt.startup_display)
2917
ctrl->display = strdup (opt.startup_display);
2918
if (!ctrl->ttyname && opt.startup_ttyname)
2919
ctrl->ttyname = strdup (opt.startup_ttyname);
2920
if (!ctrl->ttytype && opt.startup_ttytype)
2921
ctrl->ttytype = strdup (opt.startup_ttytype);
2922
if (!ctrl->lc_ctype && opt.startup_lc_ctype)
2923
ctrl->lc_ctype = strdup (opt.startup_lc_ctype);
2924
if (!ctrl->lc_messages && opt.startup_lc_messages)
2925
ctrl->lc_messages = strdup (opt.startup_lc_messages);
2926
if (!ctrl->xauthority && opt.startup_xauthority)
2927
ctrl->xauthority = strdup (opt.startup_xauthority);
2928
if (!ctrl->pinentry_user_data && opt.startup_pinentry_user_data)
2929
ctrl->pinentry_user_data = strdup (opt.startup_pinentry_user_data);
2917
static const char *names[] =
2918
{"GPG_TTY", "DISPLAY", "TERM", "XAUTHORITY", "PINENTRY_USER_DATA", NULL};
2922
for (idx=0; !err && names[idx]; idx++)
2923
if (!session_env_getenv (ctrl->session_env, names[idx])
2924
&& (value = session_env_getenv (opt.startup_env, names[idx])))
2925
err = session_env_setenv (ctrl->session_env, names[idx], value);
2927
if (!err && !ctrl->lc_ctype && opt.startup_lc_ctype)
2928
if (!(ctrl->lc_ctype = xtrystrdup (opt.startup_lc_ctype)))
2929
err = gpg_error_from_syserror ();
2931
if (!err && !ctrl->lc_messages && opt.startup_lc_messages)
2932
if (!(ctrl->lc_messages = xtrystrdup (opt.startup_lc_messages)))
2933
err = gpg_error_from_syserror ();
2937
log_error ("error setting default session environment: %s\n",
2938
gpg_strerror (err));
2932
2944
/* Create stream from socket. */