Fossil SCM

When a server records the URL a client gives for itself, parse it only if it begins with http:// or https://, as for links the server sends. Any other text was parsed as a path on the server and, if no repository was there, ended the request with an error.

dmestas 2026-11-18 21:20 UTC small-fixes
Commit f56a138ee179e152235338b5db4399a373244db85419cebaa26601b7535f5785
1 file changed +5 -1
+5 -1
--- src/xfer.c
+++ src/xfer.c
@@ -1304,11 +1304,15 @@
13041304
** Add a "syncfrom:URL" entry instead of "syncwith:URL" if bSyncFrom is true.
13051305
*/
13061306
static void xfer_syncwith(const char *zUrl, int bSyncFrom){
13071307
UrlData x;
13081308
memset(&x, 0, sizeof(x));
1309
- url_parse_local(zUrl, URL_OMIT_USER, &x);
1309
+ if( fossil_strnicmp(zUrl, "http://", 7)==0
1310
+ || fossil_strnicmp(zUrl, "https://", 8)==0
1311
+ ){
1312
+ url_parse_local(zUrl, URL_OMIT_USER, &x);
1313
+ }
13101314
if( x.protocol && strncmp(x.protocol,"http",4)==0
13111315
&& x.name && sqlite3_strlike("%localhost%", x.name, 0)!=0
13121316
){
13131317
db_unprotect(PROTECT_CONFIG);
13141318
db_multi_exec("REPLACE INTO config(name,value,mtime)"
13151319
--- src/xfer.c
+++ src/xfer.c
@@ -1304,11 +1304,15 @@
1304 ** Add a "syncfrom:URL" entry instead of "syncwith:URL" if bSyncFrom is true.
1305 */
1306 static void xfer_syncwith(const char *zUrl, int bSyncFrom){
1307 UrlData x;
1308 memset(&x, 0, sizeof(x));
1309 url_parse_local(zUrl, URL_OMIT_USER, &x);
 
 
 
 
1310 if( x.protocol && strncmp(x.protocol,"http",4)==0
1311 && x.name && sqlite3_strlike("%localhost%", x.name, 0)!=0
1312 ){
1313 db_unprotect(PROTECT_CONFIG);
1314 db_multi_exec("REPLACE INTO config(name,value,mtime)"
1315
--- src/xfer.c
+++ src/xfer.c
@@ -1304,11 +1304,15 @@
1304 ** Add a "syncfrom:URL" entry instead of "syncwith:URL" if bSyncFrom is true.
1305 */
1306 static void xfer_syncwith(const char *zUrl, int bSyncFrom){
1307 UrlData x;
1308 memset(&x, 0, sizeof(x));
1309 if( fossil_strnicmp(zUrl, "http://", 7)==0
1310 || fossil_strnicmp(zUrl, "https://", 8)==0
1311 ){
1312 url_parse_local(zUrl, URL_OMIT_USER, &x);
1313 }
1314 if( x.protocol && strncmp(x.protocol,"http",4)==0
1315 && x.name && sqlite3_strlike("%localhost%", x.name, 0)!=0
1316 ){
1317 db_unprotect(PROTECT_CONFIG);
1318 db_multi_exec("REPLACE INTO config(name,value,mtime)"
1319

Keyboard Shortcuts

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