Fossil SCM

Separate SSH transport changes from shared account features to simplify integration.

andybradford 2013-09-07 21:21 ssh-transport-changes
Commit 915c79cb4f7af92dd20befea7d650b9647b51d42
+3 -3
--- src/cgi.c
+++ src/cgi.c
@@ -460,15 +460,15 @@
460460
*/
461461
void cgi_replace_parameter(const char *zName, const char *zValue){
462462
int i;
463463
for(i=0; i<nUsedQP; i++){
464464
if( fossil_strcmp(aParamQP[i].zName,zName)==0 ){
465
- aParamQP[i].zValue = mprintf("%s",zValue);
465
+ aParamQP[i].zValue = zValue;
466466
return;
467467
}
468468
}
469
- cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
469
+ cgi_set_parameter_nocopy(zName, zValue, 0);
470470
}
471471
472472
/*
473473
** Add a query parameter. The zName portion is fixed but a copy
474474
** must be made of zValue.
@@ -1391,11 +1391,11 @@
13911391
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
13921392
if( zToken[i] ) zToken[i++] = 0;
13931393
if( nCycles==0 ){
13941394
cgi_setenv("PATH_INFO", zToken);
13951395
}else{
1396
- cgi_replace_parameter("PATH_INFO", zToken);
1396
+ cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
13971397
}
13981398
13991399
/* Get all the optional fields that follow the first line.
14001400
*/
14011401
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
14021402
--- src/cgi.c
+++ src/cgi.c
@@ -460,15 +460,15 @@
460 */
461 void cgi_replace_parameter(const char *zName, const char *zValue){
462 int i;
463 for(i=0; i<nUsedQP; i++){
464 if( fossil_strcmp(aParamQP[i].zName,zName)==0 ){
465 aParamQP[i].zValue = mprintf("%s",zValue);
466 return;
467 }
468 }
469 cgi_set_parameter_nocopy(zName, mprintf("%s",zValue), 0);
470 }
471
472 /*
473 ** Add a query parameter. The zName portion is fixed but a copy
474 ** must be made of zValue.
@@ -1391,11 +1391,11 @@
1391 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1392 if( zToken[i] ) zToken[i++] = 0;
1393 if( nCycles==0 ){
1394 cgi_setenv("PATH_INFO", zToken);
1395 }else{
1396 cgi_replace_parameter("PATH_INFO", zToken);
1397 }
1398
1399 /* Get all the optional fields that follow the first line.
1400 */
1401 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1402
--- src/cgi.c
+++ src/cgi.c
@@ -460,15 +460,15 @@
460 */
461 void cgi_replace_parameter(const char *zName, const char *zValue){
462 int i;
463 for(i=0; i<nUsedQP; i++){
464 if( fossil_strcmp(aParamQP[i].zName,zName)==0 ){
465 aParamQP[i].zValue = zValue;
466 return;
467 }
468 }
469 cgi_set_parameter_nocopy(zName, zValue, 0);
470 }
471
472 /*
473 ** Add a query parameter. The zName portion is fixed but a copy
474 ** must be made of zValue.
@@ -1391,11 +1391,11 @@
1391 for(i=0; zToken[i] && zToken[i]!='?'; i++){}
1392 if( zToken[i] ) zToken[i++] = 0;
1393 if( nCycles==0 ){
1394 cgi_setenv("PATH_INFO", zToken);
1395 }else{
1396 cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
1397 }
1398
1399 /* Get all the optional fields that follow the first line.
1400 */
1401 while( fgets(zLine,sizeof(zLine),g.httpIn) ){
1402
+2 -21
--- src/clone.c
+++ src/clone.c
@@ -90,31 +90,28 @@
9090
** URL must be in one of the following form: ([...] mean optional)
9191
** HTTP/HTTPS protocol:
9292
** http[s]://[userid[:password]@]host[:port][/path]
9393
**
9494
** SSH protocol:
95
-** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil
95
+** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil\\
96
+** [?fossil=path/to/fossil.exe]
9697
**
9798
** Filesystem:
9899
** [file://]path/to/repo.fossil
99100
**
100101
** Note: For ssh and filesystem, path must have an extra leading
101102
** '/' to use an absolute path.
102103
**
103
-** Note: the userid for SSH is the SSH account, not the Fossil account.
104
-**
105104
** By default, your current login name is used to create the default
106105
** admin user. This can be overridden using the -A|--admin-user
107106
** parameter.
108107
**
109108
** Options:
110109
** --admin-user|-A USERNAME Make USERNAME the administrator
111110
** --private Also clone private branches
112111
** --ssl-identity=filename Use the SSL identity if requested by the server
113
-** --ssh-fossil|-f /fossil Use this path as remote fossil command
114112
** --ssh-command|-c 'command' Use this SSH command
115
-** --ssh-fossil-user|-l user Fossil user to use for SSH if different.
116113
**
117114
** See also: init
118115
*/
119116
void clone_cmd(void){
120117
char *zPassword;
@@ -199,38 +196,22 @@
199196
200197
/*
201198
** Look for SSH clone command line options and setup in globals.
202199
*/
203200
void clone_ssh_find_options(void){
204
- const char *zSshFossilCmd; /* Path to remote fossil command for SSH */
205201
const char *zSshCmd; /* SSH command string */
206
- const char *zFossilUser; /* Fossil user if login specified for SSH */
207202
208
- zSshFossilCmd = find_option("ssh-fossil","f",1);
209
- if( zSshFossilCmd && zSshFossilCmd[0] ){
210
- g.zSshFossilCmd = mprintf("%s", zSshFossilCmd);
211
- }
212203
zSshCmd = find_option("ssh-command","c",1);
213204
if( zSshCmd && zSshCmd[0] ){
214205
g.zSshCmd = mprintf("%s", zSshCmd);
215206
}
216
- zFossilUser = find_option("ssh-fossil-user","l",1);
217
- if( zFossilUser && zFossilUser[0] ){
218
- g.zFossilUser = mprintf("%s", zFossilUser);
219
- }
220207
}
221208
222209
/*
223210
** Set SSH options discovered in global variables (set from command line
224211
** options).
225212
*/
226213
void clone_ssh_db_set_options(void){
227
- if( g.zSshFossilCmd && g.zSshFossilCmd[0] ){
228
- db_set("ssh-fossil", g.zSshFossilCmd, 0);
229
- }
230214
if( g.zSshCmd && g.zSshCmd[0] ){
231215
db_set("ssh-command", g.zSshCmd, 0);
232216
}
233
- if( g.zFossilUser && g.zFossilUser[0] ){
234
- db_set("ssh-fossil-user", g.zFossilUser, 0);
235
- }
236217
}
237218
--- src/clone.c
+++ src/clone.c
@@ -90,31 +90,28 @@
90 ** URL must be in one of the following form: ([...] mean optional)
91 ** HTTP/HTTPS protocol:
92 ** http[s]://[userid[:password]@]host[:port][/path]
93 **
94 ** SSH protocol:
95 ** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil
 
96 **
97 ** Filesystem:
98 ** [file://]path/to/repo.fossil
99 **
100 ** Note: For ssh and filesystem, path must have an extra leading
101 ** '/' to use an absolute path.
102 **
103 ** Note: the userid for SSH is the SSH account, not the Fossil account.
104 **
105 ** By default, your current login name is used to create the default
106 ** admin user. This can be overridden using the -A|--admin-user
107 ** parameter.
108 **
109 ** Options:
110 ** --admin-user|-A USERNAME Make USERNAME the administrator
111 ** --private Also clone private branches
112 ** --ssl-identity=filename Use the SSL identity if requested by the server
113 ** --ssh-fossil|-f /fossil Use this path as remote fossil command
114 ** --ssh-command|-c 'command' Use this SSH command
115 ** --ssh-fossil-user|-l user Fossil user to use for SSH if different.
116 **
117 ** See also: init
118 */
119 void clone_cmd(void){
120 char *zPassword;
@@ -199,38 +196,22 @@
199
200 /*
201 ** Look for SSH clone command line options and setup in globals.
202 */
203 void clone_ssh_find_options(void){
204 const char *zSshFossilCmd; /* Path to remote fossil command for SSH */
205 const char *zSshCmd; /* SSH command string */
206 const char *zFossilUser; /* Fossil user if login specified for SSH */
207
208 zSshFossilCmd = find_option("ssh-fossil","f",1);
209 if( zSshFossilCmd && zSshFossilCmd[0] ){
210 g.zSshFossilCmd = mprintf("%s", zSshFossilCmd);
211 }
212 zSshCmd = find_option("ssh-command","c",1);
213 if( zSshCmd && zSshCmd[0] ){
214 g.zSshCmd = mprintf("%s", zSshCmd);
215 }
216 zFossilUser = find_option("ssh-fossil-user","l",1);
217 if( zFossilUser && zFossilUser[0] ){
218 g.zFossilUser = mprintf("%s", zFossilUser);
219 }
220 }
221
222 /*
223 ** Set SSH options discovered in global variables (set from command line
224 ** options).
225 */
226 void clone_ssh_db_set_options(void){
227 if( g.zSshFossilCmd && g.zSshFossilCmd[0] ){
228 db_set("ssh-fossil", g.zSshFossilCmd, 0);
229 }
230 if( g.zSshCmd && g.zSshCmd[0] ){
231 db_set("ssh-command", g.zSshCmd, 0);
232 }
233 if( g.zFossilUser && g.zFossilUser[0] ){
234 db_set("ssh-fossil-user", g.zFossilUser, 0);
235 }
236 }
237
--- src/clone.c
+++ src/clone.c
@@ -90,31 +90,28 @@
90 ** URL must be in one of the following form: ([...] mean optional)
91 ** HTTP/HTTPS protocol:
92 ** http[s]://[userid[:password]@]host[:port][/path]
93 **
94 ** SSH protocol:
95 ** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil\\
96 ** [?fossil=path/to/fossil.exe]
97 **
98 ** Filesystem:
99 ** [file://]path/to/repo.fossil
100 **
101 ** Note: For ssh and filesystem, path must have an extra leading
102 ** '/' to use an absolute path.
103 **
 
 
104 ** By default, your current login name is used to create the default
105 ** admin user. This can be overridden using the -A|--admin-user
106 ** parameter.
107 **
108 ** Options:
109 ** --admin-user|-A USERNAME Make USERNAME the administrator
110 ** --private Also clone private branches
111 ** --ssl-identity=filename Use the SSL identity if requested by the server
 
112 ** --ssh-command|-c 'command' Use this SSH command
 
113 **
114 ** See also: init
115 */
116 void clone_cmd(void){
117 char *zPassword;
@@ -199,38 +196,22 @@
196
197 /*
198 ** Look for SSH clone command line options and setup in globals.
199 */
200 void clone_ssh_find_options(void){
 
201 const char *zSshCmd; /* SSH command string */
 
202
 
 
 
 
203 zSshCmd = find_option("ssh-command","c",1);
204 if( zSshCmd && zSshCmd[0] ){
205 g.zSshCmd = mprintf("%s", zSshCmd);
206 }
 
 
 
 
207 }
208
209 /*
210 ** Set SSH options discovered in global variables (set from command line
211 ** options).
212 */
213 void clone_ssh_db_set_options(void){
 
 
 
214 if( g.zSshCmd && g.zSshCmd[0] ){
215 db_set("ssh-command", g.zSshCmd, 0);
216 }
 
 
 
217 }
218
-3
--- src/db.c
+++ src/db.c
@@ -2136,11 +2136,10 @@
21362136
{ "proxy", 0, 32, 0, "off" },
21372137
{ "relative-paths",0, 0, 0, "on" },
21382138
{ "repo-cksum", 0, 0, 0, "on" },
21392139
{ "self-register", 0, 0, 0, "off" },
21402140
{ "ssh-command", 0, 40, 0, "" },
2141
- { "ssh-fossil", 0, 40, 0, "" },
21422141
{ "ssl-ca-location",0, 40, 0, "" },
21432142
{ "ssl-identity", 0, 40, 0, "" },
21442143
#ifdef FOSSIL_ENABLE_TCL
21452144
{ "tcl", 0, 0, 0, "off" },
21462145
{ "tcl-setup", 0, 40, 0, "" },
@@ -2308,12 +2307,10 @@
23082307
** users can not be deleted. Default: off.
23092308
**
23102309
** ssh-command Command used to talk to a remote machine with
23112310
** the "ssh://" protocol.
23122311
**
2313
-** ssh-fossil Remote fossil command to run with the "ssh://" protocol.
2314
-**
23152312
** ssl-ca-location The full pathname to a file containing PEM encoded
23162313
** CA root certificates, or a directory of certificates
23172314
** with filenames formed from the certificate hashes as
23182315
** required by OpenSSL.
23192316
** If set, this will override the OS default list of
23202317
--- src/db.c
+++ src/db.c
@@ -2136,11 +2136,10 @@
2136 { "proxy", 0, 32, 0, "off" },
2137 { "relative-paths",0, 0, 0, "on" },
2138 { "repo-cksum", 0, 0, 0, "on" },
2139 { "self-register", 0, 0, 0, "off" },
2140 { "ssh-command", 0, 40, 0, "" },
2141 { "ssh-fossil", 0, 40, 0, "" },
2142 { "ssl-ca-location",0, 40, 0, "" },
2143 { "ssl-identity", 0, 40, 0, "" },
2144 #ifdef FOSSIL_ENABLE_TCL
2145 { "tcl", 0, 0, 0, "off" },
2146 { "tcl-setup", 0, 40, 0, "" },
@@ -2308,12 +2307,10 @@
2308 ** users can not be deleted. Default: off.
2309 **
2310 ** ssh-command Command used to talk to a remote machine with
2311 ** the "ssh://" protocol.
2312 **
2313 ** ssh-fossil Remote fossil command to run with the "ssh://" protocol.
2314 **
2315 ** ssl-ca-location The full pathname to a file containing PEM encoded
2316 ** CA root certificates, or a directory of certificates
2317 ** with filenames formed from the certificate hashes as
2318 ** required by OpenSSL.
2319 ** If set, this will override the OS default list of
2320
--- src/db.c
+++ src/db.c
@@ -2136,11 +2136,10 @@
2136 { "proxy", 0, 32, 0, "off" },
2137 { "relative-paths",0, 0, 0, "on" },
2138 { "repo-cksum", 0, 0, 0, "on" },
2139 { "self-register", 0, 0, 0, "off" },
2140 { "ssh-command", 0, 40, 0, "" },
 
2141 { "ssl-ca-location",0, 40, 0, "" },
2142 { "ssl-identity", 0, 40, 0, "" },
2143 #ifdef FOSSIL_ENABLE_TCL
2144 { "tcl", 0, 0, 0, "off" },
2145 { "tcl-setup", 0, 40, 0, "" },
@@ -2308,12 +2307,10 @@
2307 ** users can not be deleted. Default: off.
2308 **
2309 ** ssh-command Command used to talk to a remote machine with
2310 ** the "ssh://" protocol.
2311 **
 
 
2312 ** ssl-ca-location The full pathname to a file containing PEM encoded
2313 ** CA root certificates, or a directory of certificates
2314 ** with filenames formed from the certificate hashes as
2315 ** required by OpenSSL.
2316 ** If set, this will override the OS default list of
2317
+8 -8
--- src/http.c
+++ src/http.c
@@ -38,20 +38,22 @@
3838
const char *zLogin; /* The user login name */
3939
const char *zPw; /* The user password */
4040
Blob pw; /* The nonce with user password appended */
4141
Blob sig; /* The signature field */
4242
43
- zLogin = url_or_fossil_user();
4443
blob_zero(pLogin);
45
- if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ||
46
- ( g.urlIsSsh && ! url_ssh_use_http() ) ){
47
- return; /* If no login card for users "nobody" and "anonymous" */
44
+ if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
45
+ return; /* If no login card for users "nobody" and "anonymous" */
46
+ }
47
+ if( g.urlIsSsh ){
48
+ return; /* If no login card for SSH: */
4849
}
4950
blob_zero(&nonce);
5051
blob_zero(&pw);
5152
sha1sum_blob(pPayload, &nonce);
5253
blob_copy(&pw, &nonce);
54
+ zLogin = g.urlUser;
5355
if( g.urlPasswd ){
5456
zPw = g.urlPasswd;
5557
}else if( g.cgiOutput ){
5658
/* Password failure while doing a sync from the web interface */
5759
cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
@@ -88,13 +90,11 @@
8890
** the complete payload (including the login card) already compressed.
8991
*/
9092
static void http_build_header(Blob *pPayload, Blob *pHdr){
9193
int i;
9294
const char *zSep;
93
- const char *zLogin;
9495
95
- zLogin = url_or_fossil_user();
9696
blob_zero(pHdr);
9797
i = strlen(g.urlPath);
9898
if( i>0 && g.urlPath[i-1]=='/' ){
9999
zSep = "";
100100
}else{
@@ -102,12 +102,12 @@
102102
}
103103
blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
104104
if( g.urlProxyAuth ){
105105
blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
106106
}
107
- if( g.urlPasswd && zLogin && g.urlPasswd[0]=='#' ){
108
- char *zCredentials = mprintf("%s:%s", zLogin, &g.urlPasswd[1]);
107
+ if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){
108
+ char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]);
109109
char *zEncoded = encode64(zCredentials, -1);
110110
blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
111111
fossil_free(zEncoded);
112112
fossil_free(zCredentials);
113113
}
114114
--- src/http.c
+++ src/http.c
@@ -38,20 +38,22 @@
38 const char *zLogin; /* The user login name */
39 const char *zPw; /* The user password */
40 Blob pw; /* The nonce with user password appended */
41 Blob sig; /* The signature field */
42
43 zLogin = url_or_fossil_user();
44 blob_zero(pLogin);
45 if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ||
46 ( g.urlIsSsh && ! url_ssh_use_http() ) ){
47 return; /* If no login card for users "nobody" and "anonymous" */
 
 
48 }
49 blob_zero(&nonce);
50 blob_zero(&pw);
51 sha1sum_blob(pPayload, &nonce);
52 blob_copy(&pw, &nonce);
 
53 if( g.urlPasswd ){
54 zPw = g.urlPasswd;
55 }else if( g.cgiOutput ){
56 /* Password failure while doing a sync from the web interface */
57 cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
@@ -88,13 +90,11 @@
88 ** the complete payload (including the login card) already compressed.
89 */
90 static void http_build_header(Blob *pPayload, Blob *pHdr){
91 int i;
92 const char *zSep;
93 const char *zLogin;
94
95 zLogin = url_or_fossil_user();
96 blob_zero(pHdr);
97 i = strlen(g.urlPath);
98 if( i>0 && g.urlPath[i-1]=='/' ){
99 zSep = "";
100 }else{
@@ -102,12 +102,12 @@
102 }
103 blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
104 if( g.urlProxyAuth ){
105 blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
106 }
107 if( g.urlPasswd && zLogin && g.urlPasswd[0]=='#' ){
108 char *zCredentials = mprintf("%s:%s", zLogin, &g.urlPasswd[1]);
109 char *zEncoded = encode64(zCredentials, -1);
110 blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
111 fossil_free(zEncoded);
112 fossil_free(zCredentials);
113 }
114
--- src/http.c
+++ src/http.c
@@ -38,20 +38,22 @@
38 const char *zLogin; /* The user login name */
39 const char *zPw; /* The user password */
40 Blob pw; /* The nonce with user password appended */
41 Blob sig; /* The signature field */
42
 
43 blob_zero(pLogin);
44 if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){
45 return; /* If no login card for users "nobody" and "anonymous" */
46 }
47 if( g.urlIsSsh ){
48 return; /* If no login card for SSH: */
49 }
50 blob_zero(&nonce);
51 blob_zero(&pw);
52 sha1sum_blob(pPayload, &nonce);
53 blob_copy(&pw, &nonce);
54 zLogin = g.urlUser;
55 if( g.urlPasswd ){
56 zPw = g.urlPasswd;
57 }else if( g.cgiOutput ){
58 /* Password failure while doing a sync from the web interface */
59 cgi_printf("*** incorrect or missing password for user %h\n", zLogin);
@@ -88,13 +90,11 @@
90 ** the complete payload (including the login card) already compressed.
91 */
92 static void http_build_header(Blob *pPayload, Blob *pHdr){
93 int i;
94 const char *zSep;
 
95
 
96 blob_zero(pHdr);
97 i = strlen(g.urlPath);
98 if( i>0 && g.urlPath[i-1]=='/' ){
99 zSep = "";
100 }else{
@@ -102,12 +102,12 @@
102 }
103 blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep);
104 if( g.urlProxyAuth ){
105 blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth);
106 }
107 if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){
108 char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]);
109 char *zEncoded = encode64(zCredentials, -1);
110 blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded);
111 fossil_free(zEncoded);
112 fossil_free(zCredentials);
113 }
114
--- src/http_transport.c
+++ src/http_transport.c
@@ -91,19 +91,17 @@
9191
int transport_ssh_open(void){
9292
/* For SSH we need to create and run SSH fossil http
9393
** to talk to the remote machine.
9494
*/
9595
static int fPrintSshCmd = 1; /* Print SSH command only once */
96
- const char *zSshFossilCmd; /* Path to fossil on remote host */
9796
const char *zSsh; /* The base SSH command */
9897
Blob zCmd; /* The SSH command */
9998
char *zHost; /* The host name to contact */
10099
int n; /* Size of prefix string */
101100
102101
socket_ssh_resolve_addr();
103102
zSsh = db_get("ssh-command", zDefaultSshCmd);
104
- zSshFossilCmd = db_get("ssh-fossil", "fossil");
105103
blob_init(&zCmd, zSsh, -1);
106104
if( g.urlPort!=g.urlDfltPort && g.urlPort ){
107105
#ifdef __MINGW32__
108106
blob_appendf(&zCmd, " -P %d", g.urlPort);
109107
#else
@@ -121,16 +119,12 @@
121119
}
122120
n = blob_size(&zCmd);
123121
blob_append(&zCmd, " ", 1);
124122
shell_escape(&zCmd, zHost);
125123
blob_append(&zCmd, " ", 1);
126
- shell_escape(&zCmd, mprintf("%s", zSshFossilCmd));
127
- if( url_ssh_use_http() ){
128
- blob_append(&zCmd, " http", 5);
129
- }else{
130
- blob_append(&zCmd, " test-http", 10);
131
- }
124
+ shell_escape(&zCmd, mprintf("%s", g.urlFossil));
125
+ blob_append(&zCmd, " test-http", 10);
132126
if( g.urlPath && g.urlPath[0] ){
133127
blob_append(&zCmd, " ", 1);
134128
shell_escape(&zCmd, mprintf("%s", g.urlPath));
135129
}
136130
if( fPrintSshCmd ){
137131
--- src/http_transport.c
+++ src/http_transport.c
@@ -91,19 +91,17 @@
91 int transport_ssh_open(void){
92 /* For SSH we need to create and run SSH fossil http
93 ** to talk to the remote machine.
94 */
95 static int fPrintSshCmd = 1; /* Print SSH command only once */
96 const char *zSshFossilCmd; /* Path to fossil on remote host */
97 const char *zSsh; /* The base SSH command */
98 Blob zCmd; /* The SSH command */
99 char *zHost; /* The host name to contact */
100 int n; /* Size of prefix string */
101
102 socket_ssh_resolve_addr();
103 zSsh = db_get("ssh-command", zDefaultSshCmd);
104 zSshFossilCmd = db_get("ssh-fossil", "fossil");
105 blob_init(&zCmd, zSsh, -1);
106 if( g.urlPort!=g.urlDfltPort && g.urlPort ){
107 #ifdef __MINGW32__
108 blob_appendf(&zCmd, " -P %d", g.urlPort);
109 #else
@@ -121,16 +119,12 @@
121 }
122 n = blob_size(&zCmd);
123 blob_append(&zCmd, " ", 1);
124 shell_escape(&zCmd, zHost);
125 blob_append(&zCmd, " ", 1);
126 shell_escape(&zCmd, mprintf("%s", zSshFossilCmd));
127 if( url_ssh_use_http() ){
128 blob_append(&zCmd, " http", 5);
129 }else{
130 blob_append(&zCmd, " test-http", 10);
131 }
132 if( g.urlPath && g.urlPath[0] ){
133 blob_append(&zCmd, " ", 1);
134 shell_escape(&zCmd, mprintf("%s", g.urlPath));
135 }
136 if( fPrintSshCmd ){
137
--- src/http_transport.c
+++ src/http_transport.c
@@ -91,19 +91,17 @@
91 int transport_ssh_open(void){
92 /* For SSH we need to create and run SSH fossil http
93 ** to talk to the remote machine.
94 */
95 static int fPrintSshCmd = 1; /* Print SSH command only once */
 
96 const char *zSsh; /* The base SSH command */
97 Blob zCmd; /* The SSH command */
98 char *zHost; /* The host name to contact */
99 int n; /* Size of prefix string */
100
101 socket_ssh_resolve_addr();
102 zSsh = db_get("ssh-command", zDefaultSshCmd);
 
103 blob_init(&zCmd, zSsh, -1);
104 if( g.urlPort!=g.urlDfltPort && g.urlPort ){
105 #ifdef __MINGW32__
106 blob_appendf(&zCmd, " -P %d", g.urlPort);
107 #else
@@ -121,16 +119,12 @@
119 }
120 n = blob_size(&zCmd);
121 blob_append(&zCmd, " ", 1);
122 shell_escape(&zCmd, zHost);
123 blob_append(&zCmd, " ", 1);
124 shell_escape(&zCmd, mprintf("%s", g.urlFossil));
125 blob_append(&zCmd, " test-http", 10);
 
 
 
 
126 if( g.urlPath && g.urlPath[0] ){
127 blob_append(&zCmd, " ", 1);
128 shell_escape(&zCmd, mprintf("%s", g.urlPath));
129 }
130 if( fPrintSshCmd ){
131
+1
--- src/json.c
+++ src/json.c
@@ -1307,10 +1307,11 @@
13071307
CSTR(g, urlPath);
13081308
CSTR(g, urlUser);
13091309
CSTR(g, urlPasswd);
13101310
CSTR(g, urlCanonical);
13111311
CSTR(g, urlProxyAuth);
1312
+ CSTR(g, urlFossil);
13121313
CSTR(g, zLogin);
13131314
CSTR(g, zSSLIdentity);
13141315
CSTR(g, zIpAddr);
13151316
CSTR(g, zNonce);
13161317
CSTR(g, zCsrfToken);
13171318
--- src/json.c
+++ src/json.c
@@ -1307,10 +1307,11 @@
1307 CSTR(g, urlPath);
1308 CSTR(g, urlUser);
1309 CSTR(g, urlPasswd);
1310 CSTR(g, urlCanonical);
1311 CSTR(g, urlProxyAuth);
 
1312 CSTR(g, zLogin);
1313 CSTR(g, zSSLIdentity);
1314 CSTR(g, zIpAddr);
1315 CSTR(g, zNonce);
1316 CSTR(g, zCsrfToken);
1317
--- src/json.c
+++ src/json.c
@@ -1307,10 +1307,11 @@
1307 CSTR(g, urlPath);
1308 CSTR(g, urlUser);
1309 CSTR(g, urlPasswd);
1310 CSTR(g, urlCanonical);
1311 CSTR(g, urlProxyAuth);
1312 CSTR(g, urlFossil);
1313 CSTR(g, zLogin);
1314 CSTR(g, zSSLIdentity);
1315 CSTR(g, zIpAddr);
1316 CSTR(g, zNonce);
1317 CSTR(g, zCsrfToken);
1318
+1 -4
--- src/main.c
+++ src/main.c
@@ -136,13 +136,11 @@
136136
int fQuiet; /* True if -quiet flag is present */
137137
int fHttpTrace; /* Trace outbound HTTP requests */
138138
int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
139139
int fSshTrace; /* Trace the SSH setup traffic */
140140
int fSshClient; /* HTTP client flags for SSH client */
141
- char *zSshFossilCmd; /* Path to remoe fossil command for SSH */
142141
char *zSshCmd; /* SSH command string */
143
- char *zFossilUser; /* Fossil user if different from URL user */
144142
int fNoSync; /* Do not do an autosync ever. --nosync */
145143
char *zPath; /* Name of webpage being served */
146144
char *zExtra; /* Extra path information past the webpage name */
147145
char *zBaseURL; /* Full text of the URL being served */
148146
char *zTop; /* Parent directory of zPath */
@@ -179,10 +177,11 @@
179177
char *urlPath; /* Pathname for http: */
180178
char *urlUser; /* User id for http: */
181179
char *urlPasswd; /* Password for http: */
182180
char *urlCanonical; /* Canonical representation of the URL */
183181
char *urlProxyAuth; /* Proxy-Authorizer: string */
182
+ char *urlFossil; /* The fossil query parameter on ssh: */
184183
unsigned urlFlags; /* Boolean flags controlling URL processing */
185184
186185
const char *zLogin; /* Login name. "" if not logged in. */
187186
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
188187
** SSL client identity */
@@ -585,13 +584,11 @@
585584
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
586585
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
587586
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
588587
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
589588
g.fSshClient = 0;
590
- g.zSshFossilCmd = 0;
591589
g.zSshCmd = 0;
592
- g.zFossilUser = 0;
593590
if( g.fSqlTrace ) g.fSqlStats = 1;
594591
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
595592
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
596593
g.zLogin = find_option("user", "U", 1);
597594
g.zSSLIdentity = find_option("ssl-identity", 0, 1);
598595
--- src/main.c
+++ src/main.c
@@ -136,13 +136,11 @@
136 int fQuiet; /* True if -quiet flag is present */
137 int fHttpTrace; /* Trace outbound HTTP requests */
138 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
139 int fSshTrace; /* Trace the SSH setup traffic */
140 int fSshClient; /* HTTP client flags for SSH client */
141 char *zSshFossilCmd; /* Path to remoe fossil command for SSH */
142 char *zSshCmd; /* SSH command string */
143 char *zFossilUser; /* Fossil user if different from URL user */
144 int fNoSync; /* Do not do an autosync ever. --nosync */
145 char *zPath; /* Name of webpage being served */
146 char *zExtra; /* Extra path information past the webpage name */
147 char *zBaseURL; /* Full text of the URL being served */
148 char *zTop; /* Parent directory of zPath */
@@ -179,10 +177,11 @@
179 char *urlPath; /* Pathname for http: */
180 char *urlUser; /* User id for http: */
181 char *urlPasswd; /* Password for http: */
182 char *urlCanonical; /* Canonical representation of the URL */
183 char *urlProxyAuth; /* Proxy-Authorizer: string */
 
184 unsigned urlFlags; /* Boolean flags controlling URL processing */
185
186 const char *zLogin; /* Login name. "" if not logged in. */
187 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
188 ** SSL client identity */
@@ -585,13 +584,11 @@
585 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
586 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
587 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
588 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
589 g.fSshClient = 0;
590 g.zSshFossilCmd = 0;
591 g.zSshCmd = 0;
592 g.zFossilUser = 0;
593 if( g.fSqlTrace ) g.fSqlStats = 1;
594 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
595 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
596 g.zLogin = find_option("user", "U", 1);
597 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
598
--- src/main.c
+++ src/main.c
@@ -136,13 +136,11 @@
136 int fQuiet; /* True if -quiet flag is present */
137 int fHttpTrace; /* Trace outbound HTTP requests */
138 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
139 int fSshTrace; /* Trace the SSH setup traffic */
140 int fSshClient; /* HTTP client flags for SSH client */
 
141 char *zSshCmd; /* SSH command string */
 
142 int fNoSync; /* Do not do an autosync ever. --nosync */
143 char *zPath; /* Name of webpage being served */
144 char *zExtra; /* Extra path information past the webpage name */
145 char *zBaseURL; /* Full text of the URL being served */
146 char *zTop; /* Parent directory of zPath */
@@ -179,10 +177,11 @@
177 char *urlPath; /* Pathname for http: */
178 char *urlUser; /* User id for http: */
179 char *urlPasswd; /* Password for http: */
180 char *urlCanonical; /* Canonical representation of the URL */
181 char *urlProxyAuth; /* Proxy-Authorizer: string */
182 char *urlFossil; /* The fossil query parameter on ssh: */
183 unsigned urlFlags; /* Boolean flags controlling URL processing */
184
185 const char *zLogin; /* Login name. "" if not logged in. */
186 const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
187 ** SSL client identity */
@@ -585,13 +584,11 @@
584 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
585 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
586 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
587 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
588 g.fSshClient = 0;
 
589 g.zSshCmd = 0;
 
590 if( g.fSqlTrace ) g.fSqlStats = 1;
591 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
592 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
593 g.zLogin = find_option("user", "U", 1);
594 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
595
+8 -24
--- src/sync.c
+++ src/sync.c
@@ -49,16 +49,14 @@
4949
}else{
5050
/* Autosync defaults on. To make it default off, "return" here. */
5151
}
5252
url_parse(0, URL_REMEMBER);
5353
if( g.urlProtocol==0 ) return 0;
54
- if( ( url_or_fossil_user()!=0 ) && g.urlPasswd==0 ){
54
+ if( g.urlUser!=0 && g.urlPasswd==0 ){
5555
g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
56
- if( g.urlIsSsh && g.urlPasswd==0 ){
57
- g.urlFlags |= URL_PROMPT_PW;
58
- url_prompt_for_password();
59
- }
56
+ g.urlFlags |= URL_PROMPT_PW;
57
+ url_prompt_for_password();
6058
}
6159
#if 0 /* Disabled for now */
6260
if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){
6361
/* When doing an automatic pull, also automatically pull shuns from
6462
** the server if pull_shuns is enabled.
@@ -69,13 +67,11 @@
6967
*/
7068
configSync = CONFIGSET_SHUN;
7169
}
7270
#endif
7371
if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
74
- is_fossil_user() ?
75
- fossil_print("Autosync: (%s) %s\n", get_fossil_user(), g.urlCanonical) :
76
- fossil_print("Autosync: %s\n", g.urlCanonical);
72
+ fossil_print("Autosync: %s\n", g.urlCanonical);
7773
url_enable_proxy("via proxy: ");
7874
rc = client_sync(flags, configSync, 0);
7975
if( rc ) fossil_warning("Autosync failed");
8076
return rc;
8177
}
@@ -114,13 +110,10 @@
114110
db_open_config(0);
115111
if( g.argc==2 ){
116112
if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
117113
}else if( g.argc==3 ){
118114
zUrl = g.argv[2];
119
- if( urlFlags & URL_REMEMBER ){
120
- db_unset("ssh-fossil-user", 0);
121
- }
122115
}
123116
if( urlFlags & URL_REMEMBER ){
124117
clone_ssh_db_set_options();
125118
}
126119
url_parse(zUrl, urlFlags);
@@ -129,21 +122,15 @@
129122
usage("URL");
130123
}
131124
user_select();
132125
if( g.argc==2 ){
133126
if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
134
- is_fossil_user() ?
135
- fossil_print("Sync with (%s) %s\n",get_fossil_user(),g.urlCanonical):
136
- fossil_print("Sync with %s\n", g.urlCanonical);
127
+ fossil_print("Sync with %s\n", g.urlCanonical);
137128
}else if( (*pSyncFlags) & SYNC_PUSH ){
138
- is_fossil_user() ?
139
- fossil_print("Push to (%s) %s\n", get_fossil_user(), g.urlCanonical):
140
- fossil_print("Push to %s\n", g.urlCanonical);
129
+ fossil_print("Push to %s\n", g.urlCanonical);
141130
}else if( (*pSyncFlags) & SYNC_PULL ){
142
- is_fossil_user() ?
143
- fossil_print("Pull from (%s) %s\n",get_fossil_user(),g.urlCanonical):
144
- fossil_print("Pull from %s\n", g.urlCanonical);
131
+ fossil_print("Pull from %s\n", g.urlCanonical);
145132
}
146133
}
147134
url_enable_proxy("via proxy: ");
148135
*pConfigFlags |= configSync;
149136
}
@@ -274,20 +261,17 @@
274261
usage("remote-url ?URL|off?");
275262
}
276263
if( g.argc==3 ){
277264
db_unset("last-sync-url", 0);
278265
db_unset("last-sync-pw", 0);
279
- db_unset("ssh-fossil-user", 0);
280266
if( is_false(g.argv[2]) ) return;
281267
url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW);
282268
}
283269
zUrl = db_get("last-sync-url", 0);
284270
if( zUrl==0 ){
285271
fossil_print("off\n");
286272
return;
287273
}else{
288274
url_parse(zUrl, 0);
289
- is_fossil_user() ?
290
- fossil_print("(%s) %s\n", get_fossil_user(), g.urlCanonical) :
291
- fossil_print("%s\n", g.urlCanonical);
275
+ fossil_print("%s\n", g.urlCanonical);
292276
}
293277
}
294278
--- src/sync.c
+++ src/sync.c
@@ -49,16 +49,14 @@
49 }else{
50 /* Autosync defaults on. To make it default off, "return" here. */
51 }
52 url_parse(0, URL_REMEMBER);
53 if( g.urlProtocol==0 ) return 0;
54 if( ( url_or_fossil_user()!=0 ) && g.urlPasswd==0 ){
55 g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
56 if( g.urlIsSsh && g.urlPasswd==0 ){
57 g.urlFlags |= URL_PROMPT_PW;
58 url_prompt_for_password();
59 }
60 }
61 #if 0 /* Disabled for now */
62 if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){
63 /* When doing an automatic pull, also automatically pull shuns from
64 ** the server if pull_shuns is enabled.
@@ -69,13 +67,11 @@
69 */
70 configSync = CONFIGSET_SHUN;
71 }
72 #endif
73 if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
74 is_fossil_user() ?
75 fossil_print("Autosync: (%s) %s\n", get_fossil_user(), g.urlCanonical) :
76 fossil_print("Autosync: %s\n", g.urlCanonical);
77 url_enable_proxy("via proxy: ");
78 rc = client_sync(flags, configSync, 0);
79 if( rc ) fossil_warning("Autosync failed");
80 return rc;
81 }
@@ -114,13 +110,10 @@
114 db_open_config(0);
115 if( g.argc==2 ){
116 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
117 }else if( g.argc==3 ){
118 zUrl = g.argv[2];
119 if( urlFlags & URL_REMEMBER ){
120 db_unset("ssh-fossil-user", 0);
121 }
122 }
123 if( urlFlags & URL_REMEMBER ){
124 clone_ssh_db_set_options();
125 }
126 url_parse(zUrl, urlFlags);
@@ -129,21 +122,15 @@
129 usage("URL");
130 }
131 user_select();
132 if( g.argc==2 ){
133 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
134 is_fossil_user() ?
135 fossil_print("Sync with (%s) %s\n",get_fossil_user(),g.urlCanonical):
136 fossil_print("Sync with %s\n", g.urlCanonical);
137 }else if( (*pSyncFlags) & SYNC_PUSH ){
138 is_fossil_user() ?
139 fossil_print("Push to (%s) %s\n", get_fossil_user(), g.urlCanonical):
140 fossil_print("Push to %s\n", g.urlCanonical);
141 }else if( (*pSyncFlags) & SYNC_PULL ){
142 is_fossil_user() ?
143 fossil_print("Pull from (%s) %s\n",get_fossil_user(),g.urlCanonical):
144 fossil_print("Pull from %s\n", g.urlCanonical);
145 }
146 }
147 url_enable_proxy("via proxy: ");
148 *pConfigFlags |= configSync;
149 }
@@ -274,20 +261,17 @@
274 usage("remote-url ?URL|off?");
275 }
276 if( g.argc==3 ){
277 db_unset("last-sync-url", 0);
278 db_unset("last-sync-pw", 0);
279 db_unset("ssh-fossil-user", 0);
280 if( is_false(g.argv[2]) ) return;
281 url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW);
282 }
283 zUrl = db_get("last-sync-url", 0);
284 if( zUrl==0 ){
285 fossil_print("off\n");
286 return;
287 }else{
288 url_parse(zUrl, 0);
289 is_fossil_user() ?
290 fossil_print("(%s) %s\n", get_fossil_user(), g.urlCanonical) :
291 fossil_print("%s\n", g.urlCanonical);
292 }
293 }
294
--- src/sync.c
+++ src/sync.c
@@ -49,16 +49,14 @@
49 }else{
50 /* Autosync defaults on. To make it default off, "return" here. */
51 }
52 url_parse(0, URL_REMEMBER);
53 if( g.urlProtocol==0 ) return 0;
54 if( g.urlUser!=0 && g.urlPasswd==0 ){
55 g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
56 g.urlFlags |= URL_PROMPT_PW;
57 url_prompt_for_password();
 
 
58 }
59 #if 0 /* Disabled for now */
60 if( (flags & AUTOSYNC_PULL)!=0 && db_get_boolean("auto-shun",1) ){
61 /* When doing an automatic pull, also automatically pull shuns from
62 ** the server if pull_shuns is enabled.
@@ -69,13 +67,11 @@
67 */
68 configSync = CONFIGSET_SHUN;
69 }
70 #endif
71 if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE;
72 fossil_print("Autosync: %s\n", g.urlCanonical);
 
 
73 url_enable_proxy("via proxy: ");
74 rc = client_sync(flags, configSync, 0);
75 if( rc ) fossil_warning("Autosync failed");
76 return rc;
77 }
@@ -114,13 +110,10 @@
110 db_open_config(0);
111 if( g.argc==2 ){
112 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
113 }else if( g.argc==3 ){
114 zUrl = g.argv[2];
 
 
 
115 }
116 if( urlFlags & URL_REMEMBER ){
117 clone_ssh_db_set_options();
118 }
119 url_parse(zUrl, urlFlags);
@@ -129,21 +122,15 @@
122 usage("URL");
123 }
124 user_select();
125 if( g.argc==2 ){
126 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){
127 fossil_print("Sync with %s\n", g.urlCanonical);
 
 
128 }else if( (*pSyncFlags) & SYNC_PUSH ){
129 fossil_print("Push to %s\n", g.urlCanonical);
 
 
130 }else if( (*pSyncFlags) & SYNC_PULL ){
131 fossil_print("Pull from %s\n", g.urlCanonical);
 
 
132 }
133 }
134 url_enable_proxy("via proxy: ");
135 *pConfigFlags |= configSync;
136 }
@@ -274,20 +261,17 @@
261 usage("remote-url ?URL|off?");
262 }
263 if( g.argc==3 ){
264 db_unset("last-sync-url", 0);
265 db_unset("last-sync-pw", 0);
 
266 if( is_false(g.argv[2]) ) return;
267 url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW);
268 }
269 zUrl = db_get("last-sync-url", 0);
270 if( zUrl==0 ){
271 fossil_print("off\n");
272 return;
273 }else{
274 url_parse(zUrl, 0);
275 fossil_print("%s\n", g.urlCanonical);
 
 
276 }
277 }
278
+37 -29
--- src/url.c
+++ src/url.c
@@ -64,11 +64,11 @@
6464
**
6565
** http://userid:password@host:port/path
6666
**
6767
** SSH url format is:
6868
**
69
-** ssh://userid:password@host:port/path
69
+** ssh://userid:password@host:port/path?fossil=path/to/fossil.exe
7070
**
7171
*/
7272
void url_parse(const char *zUrl, unsigned int urlFlags){
7373
int i, j, c;
7474
char *zFile = 0;
@@ -77,18 +77,10 @@
7777
7878
if( zUrl==0 ){
7979
zUrl = db_get("last-sync-url", 0);
8080
if( zUrl==0 ) return;
8181
g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
82
- if( g.zFossilUser==0 ){
83
- g.zFossilUser = db_get("ssh-fossil-user", 0);
84
- }else{
85
- if( g.urlPasswd ) {
86
- free(g.urlPasswd);
87
- g.urlPasswd = 0;
88
- }
89
- }
9082
bSetUrl = 0;
9183
}
9284
9385
if( strncmp(zUrl, "http://", 7)==0
9486
|| strncmp(zUrl, "https://", 8)==0
@@ -107,10 +99,11 @@
10799
iStart = 8;
108100
}else if( zUrl[0]=='s' ){
109101
g.urlIsSsh = 1;
110102
g.urlProtocol = "ssh";
111103
g.urlDfltPort = 22;
104
+ g.urlFossil = "fossil";
112105
iStart = 6;
113106
}else{
114107
g.urlIsHttps = 0;
115108
g.urlProtocol = "http";
116109
g.urlDfltPort = 80;
@@ -157,21 +150,44 @@
157150
for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){}
158151
if( g.urlPath[i] ){
159152
g.urlPath[i] = 0;
160153
i++;
161154
}
155
+ zExe = mprintf("");
156
+ while( g.urlPath[i]!=0 ){
157
+ char *zName, *zValue;
158
+ zName = &g.urlPath[i];
159
+ zValue = zName;
160
+ while( g.urlPath[i] && g.urlPath[i]!='=' ){ i++; }
161
+ if( g.urlPath[i]=='=' ){
162
+ g.urlPath[i] = 0;
163
+ i++;
164
+ zValue = &g.urlPath[i];
165
+ while( g.urlPath[i] && g.urlPath[i]!='&' ){ i++; }
166
+ }
167
+ if( g.urlPath[i] ){
168
+ g.urlPath[i] = 0;
169
+ i++;
170
+ }
171
+ if( fossil_strcmp(zName,"fossil")==0 ){
172
+ g.urlFossil = zValue;
173
+ dehttpize(g.urlFossil);
174
+ zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil);
175
+ cQuerySep = '&';
176
+ }
177
+ }
162178
163179
dehttpize(g.urlPath);
164180
if( g.urlDfltPort==g.urlPort ){
165181
g.urlCanonical = mprintf(
166
- "%s://%s%T%T",
167
- g.urlProtocol, zLogin, g.urlName, g.urlPath
182
+ "%s://%s%T%T%s",
183
+ g.urlProtocol, zLogin, g.urlName, g.urlPath, zExe
168184
);
169185
}else{
170186
g.urlCanonical = mprintf(
171
- "%s://%s%T:%d%T",
172
- g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath
187
+ "%s://%s%T:%d%T%s",
188
+ g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath, zExe
173189
);
174190
}
175191
if( g.urlIsSsh && g.urlPath[1] ) g.urlPath++;
176192
free(zLogin);
177193
}else if( strncmp(zUrl, "file:", 5)==0 ){
@@ -205,20 +221,19 @@
205221
g.urlProtocol = "file";
206222
g.urlPath = "";
207223
g.urlName = mprintf("%b", &cfile);
208224
g.urlCanonical = mprintf("file://%T", g.urlName);
209225
blob_reset(&cfile);
210
- }else if( url_or_fossil_user()!=0 &&
211
- g.urlPasswd==0 && (urlFlags & URL_PROMPT_PW) ){
226
+ }else if( g.urlUser!=0 && g.urlPasswd==0 && (urlFlags & URL_PROMPT_PW) ){
212227
url_prompt_for_password();
213228
bPrompted = 1;
214229
}
215230
if( urlFlags & URL_REMEMBER ){
216231
if( bSetUrl ){
217232
db_set("last-sync-url", g.urlCanonical, 0);
218233
}
219
- if( !bPrompted && g.urlPasswd && url_or_fossil_user() ){
234
+ if( !bPrompted && g.urlPasswd && g.urlUser ){
220235
db_set("last-sync-pw", obscure(g.urlPasswd), 0);
221236
}
222237
}
223238
}
224239
@@ -254,10 +269,11 @@
254269
fossil_print("g.urlHostname = %s\n", g.urlHostname);
255270
fossil_print("g.urlPath = %s\n", g.urlPath);
256271
fossil_print("g.urlUser = %s\n", g.urlUser);
257272
fossil_print("g.urlPasswd = %s\n", g.urlPasswd);
258273
fossil_print("g.urlCanonical = %s\n", g.urlCanonical);
274
+ fossil_print("g.urlFossil = %s\n", g.urlFossil);
259275
fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags);
260276
if( g.urlIsFile || g.urlIsSsh ) break;
261277
if( i==0 ){
262278
fossil_print("********\n");
263279
url_enable_proxy("Using proxy: ");
@@ -416,17 +432,17 @@
416432
/*
417433
** Prompt the user for the password for g.urlUser. Store the result
418434
** in g.urlPasswd.
419435
*/
420436
void url_prompt_for_password(void){
421
- if( g.urlIsFile || ( g.urlIsSsh && ! url_ssh_use_http() ) ) return;
437
+ if( g.urlIsSsh || g.urlIsFile ) return;
422438
if( isatty(fileno(stdin))
423439
&& (g.urlFlags & URL_PROMPT_PW)!=0
424440
&& (g.urlFlags & URL_PROMPTED)==0
425441
){
426442
g.urlFlags |= URL_PROMPTED;
427
- g.urlPasswd = prompt_for_user_password(url_or_fossil_user());
443
+ g.urlPasswd = prompt_for_user_password(g.urlUser);
428444
if( g.urlPasswd[0]
429445
&& (g.urlFlags & (URL_REMEMBER|URL_ASK_REMEMBER_PW))!=0
430446
){
431447
if( save_password_prompt() ){
432448
g.urlFlags |= URL_REMEMBER_PW;
@@ -435,19 +451,12 @@
435451
}
436452
}
437453
}
438454
}else{
439455
fossil_fatal("missing or incorrect password for user \"%s\"",
440
- url_or_fossil_user() );
441
- }
442
-}
443
-
444
-/*
445
-** Return true if http mode is in use for "ssh://" URL.
446
-*/
447
-int url_ssh_use_http(void){
448
- return get_fossil_user()!=0;
456
+ g.urlUser);
457
+ }
449458
}
450459
451460
/*
452461
** Remember the URL if requested.
453462
*/
@@ -461,13 +470,12 @@
461470
462471
/* Preemptively prompt for a password if a username is given in the
463472
** URL but no password.
464473
*/
465474
void url_get_password_if_needed(void){
466
- const char *zFossilUser = url_or_fossil_user();
467
- if( ( zFossilUser && zFossilUser[0] )
475
+ if( (g.urlUser && g.urlUser[0])
468476
&& (g.urlPasswd==0 || g.urlPasswd[0]==0)
469477
&& isatty(fileno(stdin))
470478
){
471479
url_prompt_for_password();
472480
}
473481
}
474482
--- src/url.c
+++ src/url.c
@@ -64,11 +64,11 @@
64 **
65 ** http://userid:password@host:port/path
66 **
67 ** SSH url format is:
68 **
69 ** ssh://userid:password@host:port/path
70 **
71 */
72 void url_parse(const char *zUrl, unsigned int urlFlags){
73 int i, j, c;
74 char *zFile = 0;
@@ -77,18 +77,10 @@
77
78 if( zUrl==0 ){
79 zUrl = db_get("last-sync-url", 0);
80 if( zUrl==0 ) return;
81 g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
82 if( g.zFossilUser==0 ){
83 g.zFossilUser = db_get("ssh-fossil-user", 0);
84 }else{
85 if( g.urlPasswd ) {
86 free(g.urlPasswd);
87 g.urlPasswd = 0;
88 }
89 }
90 bSetUrl = 0;
91 }
92
93 if( strncmp(zUrl, "http://", 7)==0
94 || strncmp(zUrl, "https://", 8)==0
@@ -107,10 +99,11 @@
107 iStart = 8;
108 }else if( zUrl[0]=='s' ){
109 g.urlIsSsh = 1;
110 g.urlProtocol = "ssh";
111 g.urlDfltPort = 22;
 
112 iStart = 6;
113 }else{
114 g.urlIsHttps = 0;
115 g.urlProtocol = "http";
116 g.urlDfltPort = 80;
@@ -157,21 +150,44 @@
157 for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){}
158 if( g.urlPath[i] ){
159 g.urlPath[i] = 0;
160 i++;
161 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
163 dehttpize(g.urlPath);
164 if( g.urlDfltPort==g.urlPort ){
165 g.urlCanonical = mprintf(
166 "%s://%s%T%T",
167 g.urlProtocol, zLogin, g.urlName, g.urlPath
168 );
169 }else{
170 g.urlCanonical = mprintf(
171 "%s://%s%T:%d%T",
172 g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath
173 );
174 }
175 if( g.urlIsSsh && g.urlPath[1] ) g.urlPath++;
176 free(zLogin);
177 }else if( strncmp(zUrl, "file:", 5)==0 ){
@@ -205,20 +221,19 @@
205 g.urlProtocol = "file";
206 g.urlPath = "";
207 g.urlName = mprintf("%b", &cfile);
208 g.urlCanonical = mprintf("file://%T", g.urlName);
209 blob_reset(&cfile);
210 }else if( url_or_fossil_user()!=0 &&
211 g.urlPasswd==0 && (urlFlags & URL_PROMPT_PW) ){
212 url_prompt_for_password();
213 bPrompted = 1;
214 }
215 if( urlFlags & URL_REMEMBER ){
216 if( bSetUrl ){
217 db_set("last-sync-url", g.urlCanonical, 0);
218 }
219 if( !bPrompted && g.urlPasswd && url_or_fossil_user() ){
220 db_set("last-sync-pw", obscure(g.urlPasswd), 0);
221 }
222 }
223 }
224
@@ -254,10 +269,11 @@
254 fossil_print("g.urlHostname = %s\n", g.urlHostname);
255 fossil_print("g.urlPath = %s\n", g.urlPath);
256 fossil_print("g.urlUser = %s\n", g.urlUser);
257 fossil_print("g.urlPasswd = %s\n", g.urlPasswd);
258 fossil_print("g.urlCanonical = %s\n", g.urlCanonical);
 
259 fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags);
260 if( g.urlIsFile || g.urlIsSsh ) break;
261 if( i==0 ){
262 fossil_print("********\n");
263 url_enable_proxy("Using proxy: ");
@@ -416,17 +432,17 @@
416 /*
417 ** Prompt the user for the password for g.urlUser. Store the result
418 ** in g.urlPasswd.
419 */
420 void url_prompt_for_password(void){
421 if( g.urlIsFile || ( g.urlIsSsh && ! url_ssh_use_http() ) ) return;
422 if( isatty(fileno(stdin))
423 && (g.urlFlags & URL_PROMPT_PW)!=0
424 && (g.urlFlags & URL_PROMPTED)==0
425 ){
426 g.urlFlags |= URL_PROMPTED;
427 g.urlPasswd = prompt_for_user_password(url_or_fossil_user());
428 if( g.urlPasswd[0]
429 && (g.urlFlags & (URL_REMEMBER|URL_ASK_REMEMBER_PW))!=0
430 ){
431 if( save_password_prompt() ){
432 g.urlFlags |= URL_REMEMBER_PW;
@@ -435,19 +451,12 @@
435 }
436 }
437 }
438 }else{
439 fossil_fatal("missing or incorrect password for user \"%s\"",
440 url_or_fossil_user() );
441 }
442 }
443
444 /*
445 ** Return true if http mode is in use for "ssh://" URL.
446 */
447 int url_ssh_use_http(void){
448 return get_fossil_user()!=0;
449 }
450
451 /*
452 ** Remember the URL if requested.
453 */
@@ -461,13 +470,12 @@
461
462 /* Preemptively prompt for a password if a username is given in the
463 ** URL but no password.
464 */
465 void url_get_password_if_needed(void){
466 const char *zFossilUser = url_or_fossil_user();
467 if( ( zFossilUser && zFossilUser[0] )
468 && (g.urlPasswd==0 || g.urlPasswd[0]==0)
469 && isatty(fileno(stdin))
470 ){
471 url_prompt_for_password();
472 }
473 }
474
--- src/url.c
+++ src/url.c
@@ -64,11 +64,11 @@
64 **
65 ** http://userid:password@host:port/path
66 **
67 ** SSH url format is:
68 **
69 ** ssh://userid:password@host:port/path?fossil=path/to/fossil.exe
70 **
71 */
72 void url_parse(const char *zUrl, unsigned int urlFlags){
73 int i, j, c;
74 char *zFile = 0;
@@ -77,18 +77,10 @@
77
78 if( zUrl==0 ){
79 zUrl = db_get("last-sync-url", 0);
80 if( zUrl==0 ) return;
81 g.urlPasswd = unobscure(db_get("last-sync-pw", 0));
 
 
 
 
 
 
 
 
82 bSetUrl = 0;
83 }
84
85 if( strncmp(zUrl, "http://", 7)==0
86 || strncmp(zUrl, "https://", 8)==0
@@ -107,10 +99,11 @@
99 iStart = 8;
100 }else if( zUrl[0]=='s' ){
101 g.urlIsSsh = 1;
102 g.urlProtocol = "ssh";
103 g.urlDfltPort = 22;
104 g.urlFossil = "fossil";
105 iStart = 6;
106 }else{
107 g.urlIsHttps = 0;
108 g.urlProtocol = "http";
109 g.urlDfltPort = 80;
@@ -157,21 +150,44 @@
150 for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){}
151 if( g.urlPath[i] ){
152 g.urlPath[i] = 0;
153 i++;
154 }
155 zExe = mprintf("");
156 while( g.urlPath[i]!=0 ){
157 char *zName, *zValue;
158 zName = &g.urlPath[i];
159 zValue = zName;
160 while( g.urlPath[i] && g.urlPath[i]!='=' ){ i++; }
161 if( g.urlPath[i]=='=' ){
162 g.urlPath[i] = 0;
163 i++;
164 zValue = &g.urlPath[i];
165 while( g.urlPath[i] && g.urlPath[i]!='&' ){ i++; }
166 }
167 if( g.urlPath[i] ){
168 g.urlPath[i] = 0;
169 i++;
170 }
171 if( fossil_strcmp(zName,"fossil")==0 ){
172 g.urlFossil = zValue;
173 dehttpize(g.urlFossil);
174 zExe = mprintf("%cfossil=%T", cQuerySep, g.urlFossil);
175 cQuerySep = '&';
176 }
177 }
178
179 dehttpize(g.urlPath);
180 if( g.urlDfltPort==g.urlPort ){
181 g.urlCanonical = mprintf(
182 "%s://%s%T%T%s",
183 g.urlProtocol, zLogin, g.urlName, g.urlPath, zExe
184 );
185 }else{
186 g.urlCanonical = mprintf(
187 "%s://%s%T:%d%T%s",
188 g.urlProtocol, zLogin, g.urlName, g.urlPort, g.urlPath, zExe
189 );
190 }
191 if( g.urlIsSsh && g.urlPath[1] ) g.urlPath++;
192 free(zLogin);
193 }else if( strncmp(zUrl, "file:", 5)==0 ){
@@ -205,20 +221,19 @@
221 g.urlProtocol = "file";
222 g.urlPath = "";
223 g.urlName = mprintf("%b", &cfile);
224 g.urlCanonical = mprintf("file://%T", g.urlName);
225 blob_reset(&cfile);
226 }else if( g.urlUser!=0 && g.urlPasswd==0 && (urlFlags & URL_PROMPT_PW) ){
 
227 url_prompt_for_password();
228 bPrompted = 1;
229 }
230 if( urlFlags & URL_REMEMBER ){
231 if( bSetUrl ){
232 db_set("last-sync-url", g.urlCanonical, 0);
233 }
234 if( !bPrompted && g.urlPasswd && g.urlUser ){
235 db_set("last-sync-pw", obscure(g.urlPasswd), 0);
236 }
237 }
238 }
239
@@ -254,10 +269,11 @@
269 fossil_print("g.urlHostname = %s\n", g.urlHostname);
270 fossil_print("g.urlPath = %s\n", g.urlPath);
271 fossil_print("g.urlUser = %s\n", g.urlUser);
272 fossil_print("g.urlPasswd = %s\n", g.urlPasswd);
273 fossil_print("g.urlCanonical = %s\n", g.urlCanonical);
274 fossil_print("g.urlFossil = %s\n", g.urlFossil);
275 fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags);
276 if( g.urlIsFile || g.urlIsSsh ) break;
277 if( i==0 ){
278 fossil_print("********\n");
279 url_enable_proxy("Using proxy: ");
@@ -416,17 +432,17 @@
432 /*
433 ** Prompt the user for the password for g.urlUser. Store the result
434 ** in g.urlPasswd.
435 */
436 void url_prompt_for_password(void){
437 if( g.urlIsSsh || g.urlIsFile ) return;
438 if( isatty(fileno(stdin))
439 && (g.urlFlags & URL_PROMPT_PW)!=0
440 && (g.urlFlags & URL_PROMPTED)==0
441 ){
442 g.urlFlags |= URL_PROMPTED;
443 g.urlPasswd = prompt_for_user_password(g.urlUser);
444 if( g.urlPasswd[0]
445 && (g.urlFlags & (URL_REMEMBER|URL_ASK_REMEMBER_PW))!=0
446 ){
447 if( save_password_prompt() ){
448 g.urlFlags |= URL_REMEMBER_PW;
@@ -435,19 +451,12 @@
451 }
452 }
453 }
454 }else{
455 fossil_fatal("missing or incorrect password for user \"%s\"",
456 g.urlUser);
457 }
 
 
 
 
 
 
 
458 }
459
460 /*
461 ** Remember the URL if requested.
462 */
@@ -461,13 +470,12 @@
470
471 /* Preemptively prompt for a password if a username is given in the
472 ** URL but no password.
473 */
474 void url_get_password_if_needed(void){
475 if( (g.urlUser && g.urlUser[0])
 
476 && (g.urlPasswd==0 || g.urlPasswd[0]==0)
477 && isatty(fileno(stdin))
478 ){
479 url_prompt_for_password();
480 }
481 }
482
-28
--- src/user.c
+++ src/user.c
@@ -156,34 +156,10 @@
156156
zPw = mprintf("%b", &x);
157157
blob_reset(&x);
158158
return zPw;
159159
}
160160
161
-/*
162
-** Return Fossil user if allocated and URL is SSH or URL user
163
-*/
164
-const char *url_or_fossil_user(void){
165
- return is_fossil_user() ? get_fossil_user() : g.urlUser;
166
-}
167
-
168
-/*
169
-** Return the Fossil user from global variable (set from command line)
170
-** or ssh-fossil-user database setting.
171
-*/
172
-const char *get_fossil_user(void){
173
- return ( g.zFossilUser && g.zFossilUser[0] ) ? g.zFossilUser :
174
- db_get("ssh-fossil-user", 0);
175
-}
176
-
177
-/*
178
-** Return true if URL is SSH and Fossil user is allocated
179
-*/
180
-int is_fossil_user(void) {
181
- return g.urlIsSsh && ( g.zFossilUser && g.zFossilUser[0] ||
182
- db_get("ssh-fossil-user", 0)!=0 );
183
-}
184
-
185161
/*
186162
** Prompt the user to enter a single line of text.
187163
*/
188164
void prompt_user(const char *zPrompt, Blob *pIn){
189165
char *z;
@@ -370,12 +346,10 @@
370346
**
371347
** (7) Try the USERNAME environment variable.
372348
**
373349
** (8) Check if the user can be extracted from the remote URL.
374350
**
375
-** (9) Check if the user was supplied as SSH command-line option.
376
-**
377351
** The user name is stored in g.zLogin. The uid is in g.userUid.
378352
*/
379353
void user_select(void){
380354
if( g.userUid ) return;
381355
if( g.zLogin ){
@@ -399,12 +373,10 @@
399373
if( attempt_user(fossil_getenv("USERNAME")) ) return;
400374
401375
url_parse(0, 0);
402376
if( g.urlUser && attempt_user(g.urlUser) ) return;
403377
404
- if( g.zFossilUser && attempt_user(g.zFossilUser) ) return;
405
-
406378
fossil_print(
407379
"Cannot figure out who you are! Consider using the --user\n"
408380
"command line option, setting your USER environment variable,\n"
409381
"or setting a default user with \"fossil user default USER\".\n"
410382
);
411383
--- src/user.c
+++ src/user.c
@@ -156,34 +156,10 @@
156 zPw = mprintf("%b", &x);
157 blob_reset(&x);
158 return zPw;
159 }
160
161 /*
162 ** Return Fossil user if allocated and URL is SSH or URL user
163 */
164 const char *url_or_fossil_user(void){
165 return is_fossil_user() ? get_fossil_user() : g.urlUser;
166 }
167
168 /*
169 ** Return the Fossil user from global variable (set from command line)
170 ** or ssh-fossil-user database setting.
171 */
172 const char *get_fossil_user(void){
173 return ( g.zFossilUser && g.zFossilUser[0] ) ? g.zFossilUser :
174 db_get("ssh-fossil-user", 0);
175 }
176
177 /*
178 ** Return true if URL is SSH and Fossil user is allocated
179 */
180 int is_fossil_user(void) {
181 return g.urlIsSsh && ( g.zFossilUser && g.zFossilUser[0] ||
182 db_get("ssh-fossil-user", 0)!=0 );
183 }
184
185 /*
186 ** Prompt the user to enter a single line of text.
187 */
188 void prompt_user(const char *zPrompt, Blob *pIn){
189 char *z;
@@ -370,12 +346,10 @@
370 **
371 ** (7) Try the USERNAME environment variable.
372 **
373 ** (8) Check if the user can be extracted from the remote URL.
374 **
375 ** (9) Check if the user was supplied as SSH command-line option.
376 **
377 ** The user name is stored in g.zLogin. The uid is in g.userUid.
378 */
379 void user_select(void){
380 if( g.userUid ) return;
381 if( g.zLogin ){
@@ -399,12 +373,10 @@
399 if( attempt_user(fossil_getenv("USERNAME")) ) return;
400
401 url_parse(0, 0);
402 if( g.urlUser && attempt_user(g.urlUser) ) return;
403
404 if( g.zFossilUser && attempt_user(g.zFossilUser) ) return;
405
406 fossil_print(
407 "Cannot figure out who you are! Consider using the --user\n"
408 "command line option, setting your USER environment variable,\n"
409 "or setting a default user with \"fossil user default USER\".\n"
410 );
411
--- src/user.c
+++ src/user.c
@@ -156,34 +156,10 @@
156 zPw = mprintf("%b", &x);
157 blob_reset(&x);
158 return zPw;
159 }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161 /*
162 ** Prompt the user to enter a single line of text.
163 */
164 void prompt_user(const char *zPrompt, Blob *pIn){
165 char *z;
@@ -370,12 +346,10 @@
346 **
347 ** (7) Try the USERNAME environment variable.
348 **
349 ** (8) Check if the user can be extracted from the remote URL.
350 **
 
 
351 ** The user name is stored in g.zLogin. The uid is in g.userUid.
352 */
353 void user_select(void){
354 if( g.userUid ) return;
355 if( g.zLogin ){
@@ -399,12 +373,10 @@
373 if( attempt_user(fossil_getenv("USERNAME")) ) return;
374
375 url_parse(0, 0);
376 if( g.urlUser && attempt_user(g.urlUser) ) return;
377
 
 
378 fossil_print(
379 "Cannot figure out who you are! Consider using the --user\n"
380 "command line option, setting your USER environment variable,\n"
381 "or setting a default user with \"fossil user default USER\".\n"
382 );
383
+1 -3
--- src/xfer.c
+++ src/xfer.c
@@ -1779,13 +1779,11 @@
17791779
if( fossil_strcmp(zMsg, "login failed")==0 ){
17801780
if( nCycle<2 ){
17811781
g.urlPasswd = 0;
17821782
go = 1;
17831783
if( g.cgiOutput==0 ){
1784
- if( g.urlIsSsh ){
1785
- g.urlFlags |= URL_PROMPT_PW;
1786
- }
1784
+ g.urlFlags |= URL_PROMPT_PW;
17871785
url_prompt_for_password();
17881786
}
17891787
}
17901788
}else{
17911789
blob_appendf(&xfer.err, "server says: %s\n", zMsg);
17921790
--- src/xfer.c
+++ src/xfer.c
@@ -1779,13 +1779,11 @@
1779 if( fossil_strcmp(zMsg, "login failed")==0 ){
1780 if( nCycle<2 ){
1781 g.urlPasswd = 0;
1782 go = 1;
1783 if( g.cgiOutput==0 ){
1784 if( g.urlIsSsh ){
1785 g.urlFlags |= URL_PROMPT_PW;
1786 }
1787 url_prompt_for_password();
1788 }
1789 }
1790 }else{
1791 blob_appendf(&xfer.err, "server says: %s\n", zMsg);
1792
--- src/xfer.c
+++ src/xfer.c
@@ -1779,13 +1779,11 @@
1779 if( fossil_strcmp(zMsg, "login failed")==0 ){
1780 if( nCycle<2 ){
1781 g.urlPasswd = 0;
1782 go = 1;
1783 if( g.cgiOutput==0 ){
1784 g.urlFlags |= URL_PROMPT_PW;
 
 
1785 url_prompt_for_password();
1786 }
1787 }
1788 }else{
1789 blob_appendf(&xfer.err, "server says: %s\n", zMsg);
1790

Keyboard Shortcuts

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