Fossil SCM
For cloning and syncing, give all users the privileges of both "nobody" and "anonymous" without requiring a login message. Ticket [1318677c15af04480b].
Commit
134f5b374efa20b6055fc7dca9da108ceef653a7
Parent
1b883d49cf0885c…
2 files changed
+1
-1
+2
-5
+1
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -458,11 +458,11 @@ | ||
| 458 | 458 | if( g.zLogin && once ){ |
| 459 | 459 | const char *zCap; |
| 460 | 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | 462 | login_set_capabilities(zCap); |
| 463 | - if( strcmp(g.zLogin, "anonymous")!=0 ){ | |
| 463 | + if( strcmp(g.zLogin, "nobody")!=0 ){ | |
| 464 | 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | 466 | login_set_capabilities(zCap); |
| 467 | 467 | } |
| 468 | 468 | once = 0; |
| 469 | 469 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -458,11 +458,11 @@ | |
| 458 | if( g.zLogin && once ){ |
| 459 | const char *zCap; |
| 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | login_set_capabilities(zCap); |
| 463 | if( strcmp(g.zLogin, "anonymous")!=0 ){ |
| 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | login_set_capabilities(zCap); |
| 467 | } |
| 468 | once = 0; |
| 469 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -458,11 +458,11 @@ | |
| 458 | if( g.zLogin && once ){ |
| 459 | const char *zCap; |
| 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | login_set_capabilities(zCap); |
| 463 | if( strcmp(g.zLogin, "nobody")!=0 ){ |
| 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | login_set_capabilities(zCap); |
| 467 | } |
| 468 | once = 0; |
| 469 |
+2
-5
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -454,15 +454,10 @@ | ||
| 454 | 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | db_finalize(&q); |
| 459 | - | |
| 460 | - if( rc==0 ){ | |
| 461 | - /* If the login was successful. */ | |
| 462 | - login_set_anon_nobody_capabilities(); | |
| 463 | - } | |
| 464 | 459 | return rc; |
| 465 | 460 | } |
| 466 | 461 | |
| 467 | 462 | /* |
| 468 | 463 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | ||
| 631 | 626 | char *zNow; |
| 632 | 627 | |
| 633 | 628 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 634 | 629 | fossil_redirect_home(); |
| 635 | 630 | } |
| 631 | + g.zLogin = "anonymous"; | |
| 632 | + login_set_anon_nobody_capabilities(); | |
| 636 | 633 | memset(&xfer, 0, sizeof(xfer)); |
| 637 | 634 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 638 | 635 | cgi_set_content_type(g.zContentType); |
| 639 | 636 | blob_zero(&xfer.err); |
| 640 | 637 | xfer.pIn = &g.cgiIn; |
| 641 | 638 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -454,15 +454,10 @@ | |
| 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | db_finalize(&q); |
| 459 | |
| 460 | if( rc==0 ){ |
| 461 | /* If the login was successful. */ |
| 462 | login_set_anon_nobody_capabilities(); |
| 463 | } |
| 464 | return rc; |
| 465 | } |
| 466 | |
| 467 | /* |
| 468 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | |
| 631 | char *zNow; |
| 632 | |
| 633 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 634 | fossil_redirect_home(); |
| 635 | } |
| 636 | memset(&xfer, 0, sizeof(xfer)); |
| 637 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 638 | cgi_set_content_type(g.zContentType); |
| 639 | blob_zero(&xfer.err); |
| 640 | xfer.pIn = &g.cgiIn; |
| 641 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -454,15 +454,10 @@ | |
| 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | db_finalize(&q); |
| 459 | return rc; |
| 460 | } |
| 461 | |
| 462 | /* |
| 463 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | |
| 626 | char *zNow; |
| 627 | |
| 628 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 629 | fossil_redirect_home(); |
| 630 | } |
| 631 | g.zLogin = "anonymous"; |
| 632 | login_set_anon_nobody_capabilities(); |
| 633 | memset(&xfer, 0, sizeof(xfer)); |
| 634 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 635 | cgi_set_content_type(g.zContentType); |
| 636 | blob_zero(&xfer.err); |
| 637 | xfer.pIn = &g.cgiIn; |
| 638 |