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.
Commit
f63ff9fc683b1aa3373d28cc44bb11f01dd74852
Parent
ae73c07be0f5300…
1 file changed
+6
-4
+6
-4
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -115,19 +115,20 @@ | ||
| 115 | 115 | |
| 116 | 116 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 117 | 117 | blob_init(&zCmd, zSsh, -1); |
| 118 | 118 | if( g.urlPort!=g.urlDfltPort ){ |
| 119 | 119 | #ifdef __MINGW32__ |
| 120 | - blob_appendf(&zCmd, " -T -P %d", g.urlPort); | |
| 120 | + blob_appendf(&zCmd, " -P %d", g.urlPort); | |
| 121 | 121 | #else |
| 122 | - blob_appendf(&zCmd, " -e none -T -p %d", g.urlPort); | |
| 122 | + blob_appendf(&zCmd, " -p %d", g.urlPort); | |
| 123 | 123 | #endif |
| 124 | 124 | } |
| 125 | + printf("%s", blob_str(&zCmd)); /* Show the base of the SSH command */ | |
| 125 | 126 | if( g.urlUser && g.urlUser[0] ){ |
| 126 | 127 | zHost = mprintf("%s@%s", g.urlUser, g.urlName); |
| 127 | 128 | #ifdef __MINGW32__ |
| 128 | - /* Only win32 (and specifically PLINK.EXE support the -pw option */ | |
| 129 | + /* Only win32 (and specifically PLINK.EXE) support the -pw option */ | |
| 129 | 130 | if( g.urlPasswd && g.urlPasswd[0] ){ |
| 130 | 131 | Blob pw; |
| 131 | 132 | blob_zero(&pw); |
| 132 | 133 | if( g.urlPasswd[0]=='*' ){ |
| 133 | 134 | char *zPrompt; |
| @@ -138,19 +139,20 @@ | ||
| 138 | 139 | blob_init(&pw, g.urlPasswd, -1); |
| 139 | 140 | } |
| 140 | 141 | blob_append(&zCmd, " -pw ", -1); |
| 141 | 142 | shell_escape(&zCmd, blob_str(&pw)); |
| 142 | 143 | blob_reset(&pw); |
| 144 | + printf(" -pw ********"); /* Do not show the password text */ | |
| 143 | 145 | } |
| 144 | 146 | #endif |
| 145 | 147 | }else{ |
| 146 | 148 | zHost = mprintf("%s", g.urlName); |
| 147 | 149 | } |
| 148 | 150 | blob_append(&zCmd, " ", 1); |
| 149 | 151 | shell_escape(&zCmd, zHost); |
| 152 | + printf(" %s\n", zHost); /* Show the conclusion of the SSH command */ | |
| 150 | 153 | free(zHost); |
| 151 | - /* printf("%s\n", blob_str(&zCmd)); */ | |
| 152 | 154 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 153 | 155 | if( sshPid==0 ){ |
| 154 | 156 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 155 | 157 | } |
| 156 | 158 | blob_reset(&zCmd); |
| 157 | 159 |
| --- 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 |