Fossil SCM

Print the SSH command that is issued for ssh: access, scrubbed of any password content. Remove redundant -e and -T options from the ssh command.

drh 2011-02-17 13:43 trunk
Commit f63ff9fc683b1aa3373d28cc44bb11f01dd74852
1 file changed +6 -4
--- src/http_transport.c
+++ src/http_transport.c
@@ -115,19 +115,20 @@
115115
116116
zSsh = db_get("ssh-command", zDefaultSshCmd);
117117
blob_init(&zCmd, zSsh, -1);
118118
if( g.urlPort!=g.urlDfltPort ){
119119
#ifdef __MINGW32__
120
- blob_appendf(&zCmd, " -T -P %d", g.urlPort);
120
+ blob_appendf(&zCmd, " -P %d", g.urlPort);
121121
#else
122
- blob_appendf(&zCmd, " -e none -T -p %d", g.urlPort);
122
+ blob_appendf(&zCmd, " -p %d", g.urlPort);
123123
#endif
124124
}
125
+ printf("%s", blob_str(&zCmd)); /* Show the base of the SSH command */
125126
if( g.urlUser && g.urlUser[0] ){
126127
zHost = mprintf("%s@%s", g.urlUser, g.urlName);
127128
#ifdef __MINGW32__
128
- /* Only win32 (and specifically PLINK.EXE support the -pw option */
129
+ /* Only win32 (and specifically PLINK.EXE) support the -pw option */
129130
if( g.urlPasswd && g.urlPasswd[0] ){
130131
Blob pw;
131132
blob_zero(&pw);
132133
if( g.urlPasswd[0]=='*' ){
133134
char *zPrompt;
@@ -138,19 +139,20 @@
138139
blob_init(&pw, g.urlPasswd, -1);
139140
}
140141
blob_append(&zCmd, " -pw ", -1);
141142
shell_escape(&zCmd, blob_str(&pw));
142143
blob_reset(&pw);
144
+ printf(" -pw ********"); /* Do not show the password text */
143145
}
144146
#endif
145147
}else{
146148
zHost = mprintf("%s", g.urlName);
147149
}
148150
blob_append(&zCmd, " ", 1);
149151
shell_escape(&zCmd, zHost);
152
+ printf(" %s\n", zHost); /* Show the conclusion of the SSH command */
150153
free(zHost);
151
- /* printf("%s\n", blob_str(&zCmd)); */
152154
popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
153155
if( sshPid==0 ){
154156
fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
155157
}
156158
blob_reset(&zCmd);
157159
--- src/http_transport.c
+++ src/http_transport.c
@@ -115,19 +115,20 @@
115
116 zSsh = db_get("ssh-command", zDefaultSshCmd);
117 blob_init(&zCmd, zSsh, -1);
118 if( g.urlPort!=g.urlDfltPort ){
119 #ifdef __MINGW32__
120 blob_appendf(&zCmd, " -T -P %d", g.urlPort);
121 #else
122 blob_appendf(&zCmd, " -e none -T -p %d", g.urlPort);
123 #endif
124 }
 
125 if( g.urlUser && g.urlUser[0] ){
126 zHost = mprintf("%s@%s", g.urlUser, g.urlName);
127 #ifdef __MINGW32__
128 /* Only win32 (and specifically PLINK.EXE support the -pw option */
129 if( g.urlPasswd && g.urlPasswd[0] ){
130 Blob pw;
131 blob_zero(&pw);
132 if( g.urlPasswd[0]=='*' ){
133 char *zPrompt;
@@ -138,19 +139,20 @@
138 blob_init(&pw, g.urlPasswd, -1);
139 }
140 blob_append(&zCmd, " -pw ", -1);
141 shell_escape(&zCmd, blob_str(&pw));
142 blob_reset(&pw);
 
143 }
144 #endif
145 }else{
146 zHost = mprintf("%s", g.urlName);
147 }
148 blob_append(&zCmd, " ", 1);
149 shell_escape(&zCmd, zHost);
 
150 free(zHost);
151 /* printf("%s\n", blob_str(&zCmd)); */
152 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
153 if( sshPid==0 ){
154 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
155 }
156 blob_reset(&zCmd);
157
--- src/http_transport.c
+++ src/http_transport.c
@@ -115,19 +115,20 @@
115
116 zSsh = db_get("ssh-command", zDefaultSshCmd);
117 blob_init(&zCmd, zSsh, -1);
118 if( g.urlPort!=g.urlDfltPort ){
119 #ifdef __MINGW32__
120 blob_appendf(&zCmd, " -P %d", g.urlPort);
121 #else
122 blob_appendf(&zCmd, " -p %d", g.urlPort);
123 #endif
124 }
125 printf("%s", blob_str(&zCmd)); /* Show the base of the SSH command */
126 if( g.urlUser && g.urlUser[0] ){
127 zHost = mprintf("%s@%s", g.urlUser, g.urlName);
128 #ifdef __MINGW32__
129 /* Only win32 (and specifically PLINK.EXE) support the -pw option */
130 if( g.urlPasswd && g.urlPasswd[0] ){
131 Blob pw;
132 blob_zero(&pw);
133 if( g.urlPasswd[0]=='*' ){
134 char *zPrompt;
@@ -138,19 +139,20 @@
139 blob_init(&pw, g.urlPasswd, -1);
140 }
141 blob_append(&zCmd, " -pw ", -1);
142 shell_escape(&zCmd, blob_str(&pw));
143 blob_reset(&pw);
144 printf(" -pw ********"); /* Do not show the password text */
145 }
146 #endif
147 }else{
148 zHost = mprintf("%s", g.urlName);
149 }
150 blob_append(&zCmd, " ", 1);
151 shell_escape(&zCmd, zHost);
152 printf(" %s\n", zHost); /* Show the conclusion of the SSH command */
153 free(zHost);
 
154 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
155 if( sshPid==0 ){
156 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
157 }
158 blob_reset(&zCmd);
159

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button