~ubuntu-branches/ubuntu/raring/gnupg2/raring-proposed

« back to all changes in this revision

Viewing changes to agent/command-ssh.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-09-07 20:38:23 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090907203823-d7hsk7lnfqoc4yom
Tags: 2.0.13-1
* New upstream release.
* debian/control: Depend instead of Recommend gnupg-agent. (Closes:
  #538947)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2906
2906
void
2907
2907
start_command_handler_ssh (ctrl_t ctrl, gnupg_fd_t sock_client)
2908
2908
{
2909
 
  estream_t stream_sock;
2910
 
  gpg_error_t err;
 
2909
  estream_t stream_sock = NULL;
 
2910
  gpg_error_t err = 0;
2911
2911
  int ret;
2912
2912
 
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);
 
2916
  {
 
2917
    static const char *names[] = 
 
2918
      {"GPG_TTY", "DISPLAY", "TERM", "XAUTHORITY", "PINENTRY_USER_DATA", NULL};
 
2919
    int idx;
 
2920
    const char *value;
 
2921
 
 
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);
 
2926
    
 
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 ();
 
2930
 
 
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 ();
 
2934
 
 
2935
    if (err)
 
2936
      {
 
2937
        log_error ("error setting default session environment: %s\n", 
 
2938
                   gpg_strerror (err));
 
2939
        goto out;
 
2940
      }
 
2941
  }
2930
2942
 
2931
2943
 
2932
2944
  /* Create stream from socket.  */