Fossil SCM

Fix logic so ignoring login requirement only affects ssh:// URLs.

andybradford 2013-08-09 07:49 ssh-test-http
Commit 9284bfb157da42c03070ba13521855eaa98b9e25
2 files changed +1 -1 +2 -2
+1 -1
--- src/http.c
+++ src/http.c
@@ -41,11 +41,11 @@
4141
Blob sig; /* The signature field */
4242
4343
zLogin = url_or_fossil_user();
4444
blob_zero(pLogin);
4545
if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ||
46
- url_ssh_use_http()==0 ){
46
+ (g .urlIsSsh && url_ssh_use_http()==0 ) ){
4747
return; /* If no login card for users "nobody" and "anonymous" */
4848
}
4949
blob_zero(&nonce);
5050
blob_zero(&pw);
5151
sha1sum_blob(pPayload, &nonce);
5252
--- src/http.c
+++ src/http.c
@@ -41,11 +41,11 @@
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 url_ssh_use_http()==0 ){
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
--- src/http.c
+++ src/http.c
@@ -41,11 +41,11 @@
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()==0 ) ){
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
+2 -2
--- src/url.c
+++ src/url.c
@@ -412,11 +412,11 @@
412412
/*
413413
** Prompt the user for the password for g.urlUser. Store the result
414414
** in g.urlPasswd.
415415
*/
416416
void url_prompt_for_password(void){
417
- if( g.urlIsFile || url_ssh_use_http()==0 ) return;
417
+ if( g.urlIsFile || ( g.urlIsSsh && url_ssh_use_http()==0 ) ) return;
418418
if( isatty(fileno(stdin))
419419
&& (g.urlFlags & URL_PROMPT_PW)!=0
420420
&& (g.urlFlags & URL_PROMPTED)==0
421421
){
422422
g.urlFlags |= URL_PROMPTED;
@@ -439,11 +439,11 @@
439439
440440
/*
441441
** Return true if http mode is in use for "ssh://" URL.
442442
*/
443443
int url_ssh_use_http(void){
444
- return g.urlIsSsh && ( db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp );
444
+ return db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp;
445445
}
446446
447447
/*
448448
** Remember the URL if requested.
449449
*/
450450
--- src/url.c
+++ src/url.c
@@ -412,11 +412,11 @@
412 /*
413 ** Prompt the user for the password for g.urlUser. Store the result
414 ** in g.urlPasswd.
415 */
416 void url_prompt_for_password(void){
417 if( g.urlIsFile || url_ssh_use_http()==0 ) return;
418 if( isatty(fileno(stdin))
419 && (g.urlFlags & URL_PROMPT_PW)!=0
420 && (g.urlFlags & URL_PROMPTED)==0
421 ){
422 g.urlFlags |= URL_PROMPTED;
@@ -439,11 +439,11 @@
439
440 /*
441 ** Return true if http mode is in use for "ssh://" URL.
442 */
443 int url_ssh_use_http(void){
444 return g.urlIsSsh && ( db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp );
445 }
446
447 /*
448 ** Remember the URL if requested.
449 */
450
--- src/url.c
+++ src/url.c
@@ -412,11 +412,11 @@
412 /*
413 ** Prompt the user for the password for g.urlUser. Store the result
414 ** in g.urlPasswd.
415 */
416 void url_prompt_for_password(void){
417 if( g.urlIsFile || ( g.urlIsSsh && url_ssh_use_http()==0 ) ) return;
418 if( isatty(fileno(stdin))
419 && (g.urlFlags & URL_PROMPT_PW)!=0
420 && (g.urlFlags & URL_PROMPTED)==0
421 ){
422 g.urlFlags |= URL_PROMPTED;
@@ -439,11 +439,11 @@
439
440 /*
441 ** Return true if http mode is in use for "ssh://" URL.
442 */
443 int url_ssh_use_http(void){
444 return db_get_boolean("ssh-use-http", 0) || g.fSshUseHttp;
445 }
446
447 /*
448 ** Remember the URL if requested.
449 */
450

Keyboard Shortcuts

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