Fossil SCM
Make cgi_all() check every argument, not only the first, and end the argument list of its caller on /setup_uedit with a null pointer, so that a POST holding only a login no longer creates a user.
Commit
8313916950351d329c6e8e80a0a0b7bce2041f7f824c5a44304ba179e4a777c9
Parent
123583b517ea907…
2 files changed
+1
-1
+1
-1
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1851,11 +1851,11 @@ | ||
| 1851 | 1851 | int cgi_all(const char *z, ...){ |
| 1852 | 1852 | va_list ap; |
| 1853 | 1853 | char *z2; |
| 1854 | 1854 | if( cgi_parameter(z,0)==0 ) return 0; |
| 1855 | 1855 | va_start(ap, z); |
| 1856 | - while( (z2 = va_arg(ap, char*))==0 ){ | |
| 1856 | + while( (z2 = va_arg(ap, char*))!=0 ){ | |
| 1857 | 1857 | if( cgi_parameter(z2,0)==0 ) return 0; |
| 1858 | 1858 | } |
| 1859 | 1859 | va_end(ap); |
| 1860 | 1860 | return 1; |
| 1861 | 1861 | } |
| 1862 | 1862 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1851,11 +1851,11 @@ | |
| 1851 | int cgi_all(const char *z, ...){ |
| 1852 | va_list ap; |
| 1853 | char *z2; |
| 1854 | if( cgi_parameter(z,0)==0 ) return 0; |
| 1855 | va_start(ap, z); |
| 1856 | while( (z2 = va_arg(ap, char*))==0 ){ |
| 1857 | if( cgi_parameter(z2,0)==0 ) return 0; |
| 1858 | } |
| 1859 | va_end(ap); |
| 1860 | return 1; |
| 1861 | } |
| 1862 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1851,11 +1851,11 @@ | |
| 1851 | int cgi_all(const char *z, ...){ |
| 1852 | va_list ap; |
| 1853 | char *z2; |
| 1854 | if( cgi_parameter(z,0)==0 ) return 0; |
| 1855 | va_start(ap, z); |
| 1856 | while( (z2 = va_arg(ap, char*))!=0 ){ |
| 1857 | if( cgi_parameter(z2,0)==0 ) return 0; |
| 1858 | } |
| 1859 | va_end(ap); |
| 1860 | return 1; |
| 1861 | } |
| 1862 |
+1
-1
| --- src/setupuser.c | ||
| +++ src/setupuser.c | ||
| @@ -518,11 +518,11 @@ | ||
| 518 | 518 | |
| 519 | 519 | /* If we have all the necessary information, write the new or |
| 520 | 520 | ** modified user record. After writing the user record, redirect |
| 521 | 521 | ** to the page that displays a list of users. |
| 522 | 522 | */ |
| 523 | - if( !cgi_all("login","info","pw","apply") ){ | |
| 523 | + if( !cgi_all("login","info","pw","apply",(char*)0) ){ | |
| 524 | 524 | /* need all of the above properties to make a change. Since one or |
| 525 | 525 | ** more are missing, no-op */ |
| 526 | 526 | }else if( higherUser ){ |
| 527 | 527 | /* An Admin (a) user cannot edit a Superuser (s) */ |
| 528 | 528 | }else if( zDeleteVerify!=0 ){ |
| 529 | 529 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -518,11 +518,11 @@ | |
| 518 | |
| 519 | /* If we have all the necessary information, write the new or |
| 520 | ** modified user record. After writing the user record, redirect |
| 521 | ** to the page that displays a list of users. |
| 522 | */ |
| 523 | if( !cgi_all("login","info","pw","apply") ){ |
| 524 | /* need all of the above properties to make a change. Since one or |
| 525 | ** more are missing, no-op */ |
| 526 | }else if( higherUser ){ |
| 527 | /* An Admin (a) user cannot edit a Superuser (s) */ |
| 528 | }else if( zDeleteVerify!=0 ){ |
| 529 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -518,11 +518,11 @@ | |
| 518 | |
| 519 | /* If we have all the necessary information, write the new or |
| 520 | ** modified user record. After writing the user record, redirect |
| 521 | ** to the page that displays a list of users. |
| 522 | */ |
| 523 | if( !cgi_all("login","info","pw","apply",(char*)0) ){ |
| 524 | /* need all of the above properties to make a change. Since one or |
| 525 | ** more are missing, no-op */ |
| 526 | }else if( higherUser ){ |
| 527 | /* An Admin (a) user cannot edit a Superuser (s) */ |
| 528 | }else if( zDeleteVerify!=0 ){ |
| 529 |