Fossil SCM
Fix logic so ignoring login requirement only affects ssh:// URLs.
Commit
9284bfb157da42c03070ba13521855eaa98b9e25
Parent
7c9347f9c70db96…
2 files changed
+1
-1
+2
-2
+1
-1
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -41,11 +41,11 @@ | ||
| 41 | 41 | Blob sig; /* The signature field */ |
| 42 | 42 | |
| 43 | 43 | zLogin = url_or_fossil_user(); |
| 44 | 44 | blob_zero(pLogin); |
| 45 | 45 | if( zLogin==0 || fossil_strcmp(g.urlUser, "anonymous")==0 || |
| 46 | - url_ssh_use_http()==0 ){ | |
| 46 | + (g .urlIsSsh && url_ssh_use_http()==0 ) ){ | |
| 47 | 47 | return; /* If no login card for users "nobody" and "anonymous" */ |
| 48 | 48 | } |
| 49 | 49 | blob_zero(&nonce); |
| 50 | 50 | blob_zero(&pw); |
| 51 | 51 | sha1sum_blob(pPayload, &nonce); |
| 52 | 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 | 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 @@ | ||
| 412 | 412 | /* |
| 413 | 413 | ** Prompt the user for the password for g.urlUser. Store the result |
| 414 | 414 | ** in g.urlPasswd. |
| 415 | 415 | */ |
| 416 | 416 | 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; | |
| 418 | 418 | if( isatty(fileno(stdin)) |
| 419 | 419 | && (g.urlFlags & URL_PROMPT_PW)!=0 |
| 420 | 420 | && (g.urlFlags & URL_PROMPTED)==0 |
| 421 | 421 | ){ |
| 422 | 422 | g.urlFlags |= URL_PROMPTED; |
| @@ -439,11 +439,11 @@ | ||
| 439 | 439 | |
| 440 | 440 | /* |
| 441 | 441 | ** Return true if http mode is in use for "ssh://" URL. |
| 442 | 442 | */ |
| 443 | 443 | 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; | |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /* |
| 448 | 448 | ** Remember the URL if requested. |
| 449 | 449 | */ |
| 450 | 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 || 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 |