Fossil

Check-in [0088ab83]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Only print SSH command string if --sshtrace is enabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ssh-transport-changes
Files: files | file ages | folders
SHA1:0088ab83f64faf33ed0a40ec1d9032a57340e05b
User & Date: amb 2013-09-10 02:49:14
Context
2013-09-13
02:39
Leave original prompt as current SSH behavior does not require a password. check-in: 746a93e1 user: amb tags: ssh-transport-changes
2013-09-10
02:49
Only print SSH command string if --sshtrace is enabled. check-in: 0088ab83 user: amb tags: ssh-transport-changes
2013-09-07
21:57
Bring in latest fixes and features. check-in: e880c032 user: andybradford tags: ssh-transport-changes
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/http_transport.c.

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
** SSH initialization of the transport layer
*/
int transport_ssh_open(void){
  /* For SSH we need to create and run SSH fossil http 
  ** to talk to the remote machine.
  */
  static int fPrintSshCmd = 1;  /* Print SSH command only once */
  const char *zSsh;  /* The base SSH command */
  Blob zCmd;         /* The SSH command */
  char *zHost;       /* The host name to contact */
  int n;             /* Size of prefix string */

  socket_ssh_resolve_addr();
  zSsh = db_get("ssh-command", zDefaultSshCmd);
................................................................................
  if( g.urlPort!=g.urlDfltPort && g.urlPort ){
#ifdef __MINGW32__
    blob_appendf(&zCmd, " -P %d", g.urlPort);
#else
    blob_appendf(&zCmd, " -p %d", g.urlPort);
#endif
  }
  if( fPrintSshCmd ){
    fossil_force_newline();
    fossil_print("%s", blob_str(&zCmd));  /* Show the base of the SSH command */
  }
  if( g.urlUser && g.urlUser[0] ){
    zHost = mprintf("%s@%s", g.urlUser, g.urlName);
  }else{
    zHost = mprintf("%s", g.urlName);
................................................................................
  blob_append(&zCmd, " ", 1);
  shell_escape(&zCmd, mprintf("%s", g.urlFossil));
  blob_append(&zCmd, " test-http", 10);
  if( g.urlPath && g.urlPath[0] ){
    blob_append(&zCmd, " ", 1);
    shell_escape(&zCmd, mprintf("%s", g.urlPath));
  }
  if( fPrintSshCmd ){
    fossil_print("%s\n", blob_str(&zCmd)+n);  /* Show tail of SSH command */
    fPrintSshCmd = 0;
  }
  free(zHost);
  popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
  if( sshPid==0 ){
    socket_set_errmsg("cannot start ssh tunnel using [%b]", &zCmd);
  }
  blob_reset(&zCmd);







<







 







|







 







|

<







88
89
90
91
92
93
94

95
96
97
98
99
100
101
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
122
123
124
125
126
127
128
129
130

131
132
133
134
135
136
137
/*
** SSH initialization of the transport layer
*/
int transport_ssh_open(void){
  /* For SSH we need to create and run SSH fossil http 
  ** to talk to the remote machine.
  */

  const char *zSsh;  /* The base SSH command */
  Blob zCmd;         /* The SSH command */
  char *zHost;       /* The host name to contact */
  int n;             /* Size of prefix string */

  socket_ssh_resolve_addr();
  zSsh = db_get("ssh-command", zDefaultSshCmd);
................................................................................
  if( g.urlPort!=g.urlDfltPort && g.urlPort ){
#ifdef __MINGW32__
    blob_appendf(&zCmd, " -P %d", g.urlPort);
#else
    blob_appendf(&zCmd, " -p %d", g.urlPort);
#endif
  }
  if( g.fSshTrace ){
    fossil_force_newline();
    fossil_print("%s", blob_str(&zCmd));  /* Show the base of the SSH command */
  }
  if( g.urlUser && g.urlUser[0] ){
    zHost = mprintf("%s@%s", g.urlUser, g.urlName);
  }else{
    zHost = mprintf("%s", g.urlName);
................................................................................
  blob_append(&zCmd, " ", 1);
  shell_escape(&zCmd, mprintf("%s", g.urlFossil));
  blob_append(&zCmd, " test-http", 10);
  if( g.urlPath && g.urlPath[0] ){
    blob_append(&zCmd, " ", 1);
    shell_escape(&zCmd, mprintf("%s", g.urlPath));
  }
  if( g.fSshTrace ){
    fossil_print("%s\n", blob_str(&zCmd)+n);  /* Show tail of SSH command */

  }
  free(zHost);
  popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
  if( sshPid==0 ){
    socket_set_errmsg("cannot start ssh tunnel using [%b]", &zCmd);
  }
  blob_reset(&zCmd);