Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ttxssh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2980 by maya, Wed Jun 6 14:10:12 2007 UTC revision 2981 by maya, Tue Jun 12 14:55:20 2007 UTC
# Line 3642  static void PASCAL FAR TTXSetCommandLine Line 3642  static void PASCAL FAR TTXSetCommandLine
3642  {  {
3643          char tmpFile[MAX_PATH];          char tmpFile[MAX_PATH];
3644          char tmpPath[1024];          char tmpPath[1024];
3645          char buf[1024];          char *buf;
3646          int i;          int i;
3647          GET_VAR();          GET_VAR();
3648    
# Line 3653  static void PASCAL FAR TTXSetCommandLine Line 3653  static void PASCAL FAR TTXSetCommandLine
3653          }          }
3654    
3655          if (i < cmdlen) {          if (i < cmdlen) {
3656                  strncpy(buf, cmd + i, sizeof(buf));                  buf = malloc(cmdlen+1);
3657                    strncpy(buf, cmd + i, cmdlen);
3658                    buf[cmdlen] = 0;
3659                  cmd[i] = 0;                  cmd[i] = 0;
3660    
3661                  write_ssh_options(pvar, tmpFile, &pvar->settings, FALSE);                  write_ssh_options(pvar, tmpFile, &pvar->settings, FALSE);
3662    
3663                  strncat(cmd, " /ssh-consume=", cmdlen);                  strncat(cmd, " /ssh-consume=", cmdlen-1-strlen(cmd));
3664                  strncat(cmd, tmpFile, cmdlen);                  strncat(cmd, tmpFile, cmdlen);
3665    
3666                  strncat(cmd, buf, cmdlen);                  strncat(cmd, buf, cmdlen-1-strlen(cmd));
3667    
3668                  if (pvar->hostdlg_Enabled) {                  if (pvar->hostdlg_Enabled) {
3669                          strncat(cmd, " /ssh", cmdlen);                          strncat(cmd, " /ssh", cmdlen-1-strlen(cmd));
3670    
3671                          // add option of SSH protcol version (2004.10.11 yutaka)                          // add option of SSH protcol version (2004.10.11 yutaka)
3672                          if (pvar->settings.ssh_protocol_version == 2) {                          if (pvar->settings.ssh_protocol_version == 2) {
3673                                  strncat(cmd, " /2", cmdlen);                                  strncat(cmd, " /2", cmdlen-1-strlen(cmd));
3674                          } else {                          } else {
3675                                  strncat(cmd, " /1", cmdlen);                                  strncat(cmd, " /1", cmdlen-1-strlen(cmd));
3676                          }                          }
3677    
3678                  }                  }
# Line 3683  static void PASCAL FAR TTXSetCommandLine Line 3685  static void PASCAL FAR TTXSetCommandLine
3685                          // 自動ログインの場合は下記フラグが0のため、必要なコマンドを付加する。                          // 自動ログインの場合は下記フラグが0のため、必要なコマンドを付加する。
3686                          if (!pvar->hostdlg_Enabled) {                          if (!pvar->hostdlg_Enabled) {
3687                                  _snprintf(tmp, sizeof(tmp), " /ssh /%d", pvar->settings.ssh_protocol_version);                                  _snprintf(tmp, sizeof(tmp), " /ssh /%d", pvar->settings.ssh_protocol_version);
3688                                  strncat(cmd, tmp, cmdlen);                                  strncat(cmd, tmp, cmdlen-1-strlen(cmd));
3689                          }                          }
3690    
3691                          // パスワードを覚えている場合のみ、コマンドラインに渡す。(2006.8.3 yutaka)                          // パスワードを覚えている場合のみ、コマンドラインに渡す。(2006.8.3 yutaka)
# Line 3691  static void PASCAL FAR TTXSetCommandLine Line 3693  static void PASCAL FAR TTXSetCommandLine
3693                                  pvar->auth_state.cur_cred.method == SSH_AUTH_PASSWORD) {                                  pvar->auth_state.cur_cred.method == SSH_AUTH_PASSWORD) {
3694                                  replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));                                  replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));
3695                                  _snprintf(tmp, sizeof(tmp), " /auth=password /user=%s /passwd=%s", pvar->auth_state.user, mark);                                  _snprintf(tmp, sizeof(tmp), " /auth=password /user=%s /passwd=%s", pvar->auth_state.user, mark);
3696                                  strncat(cmd, tmp, cmdlen);                                  strncat(cmd, tmp, cmdlen-1-strlen(cmd));
3697    
3698                          } else if (pvar->settings.remember_password &&                          } else if (pvar->settings.remember_password &&
3699                                                  pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {                                                  pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {
3700                                  replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));                                  replace_blank_to_mark(pvar->auth_state.cur_cred.password, mark, sizeof(mark));
3701                                  _snprintf(tmp, sizeof(tmp), " /auth=publickey /user=%s /passwd=%s", pvar->auth_state.user, mark);                                  _snprintf(tmp, sizeof(tmp), " /auth=publickey /user=%s /passwd=%s", pvar->auth_state.user, mark);
3702                                  strncat(cmd, tmp, cmdlen);                                  strncat(cmd, tmp, cmdlen-1-strlen(cmd));
3703    
3704                                  replace_blank_to_mark(pvar->session_settings.DefaultRSAPrivateKeyFile, mark, sizeof(mark));                                  replace_blank_to_mark(pvar->session_settings.DefaultRSAPrivateKeyFile, mark, sizeof(mark));
3705                                  _snprintf(tmp, sizeof(tmp), " /keyfile=%s", mark);                                  _snprintf(tmp, sizeof(tmp), " /keyfile=%s", mark);
3706                                  strncat(cmd, tmp, cmdlen);                                  strncat(cmd, tmp, cmdlen-1-strlen(cmd));
3707    
3708                          } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {                          } else if (pvar->auth_state.cur_cred.method == SSH_AUTH_TIS) {
3709                                  // keyboard-interactive認証の場合は何もしない。                                  // keyboard-interactive認証の場合は何もしない。
# Line 3712  static void PASCAL FAR TTXSetCommandLine Line 3714  static void PASCAL FAR TTXSetCommandLine
3714                          }                          }
3715    
3716                  }                  }
3717                    free(buf);
3718          }          }
3719  }  }
3720    
# Line 3861  int CALLBACK LibMain(HANDLE hInstance, W Line 3863  int CALLBACK LibMain(HANDLE hInstance, W
3863    
3864  /*  /*
3865   * $Log: not supported by cvs2svn $   * $Log: not supported by cvs2svn $
3866     * Revision 1.61  2007/06/06 14:10:12  maya
3867     * プリプロセッサにより構造体が変わってしまうので、INET6 と I18N の #define を逆転させた。
3868     *
3869   * Revision 1.60  2007/04/24 16:33:36  maya   * Revision 1.60  2007/04/24 16:33:36  maya
3870   * TCPLocalEcho/TCPCRSend を無効にするオプションを追加した。   * TCPLocalEcho/TCPCRSend を無効にするオプションを追加した。
3871   *   *

Legend:
Removed from v.2980  
changed lines
  Added in v.2981

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26