Fossil SCM

Merge small-fixes into trunk: fixes for the sync client and server, configuration import and export, artifact checks, and the robot check.

dmestas 2026-11-22 15:21 UTC trunk merge
Commit e38cf10d1267ab8411397a4bbb976e723ca401d670c2e851c922f94f23364b0f
+16 -4
--- src/configure.c
+++ src/configure.c
@@ -828,10 +828,11 @@
828828
**
829829
** See also: [[settings]], [[unset]]
830830
*/
831831
void configuration_cmd(void){
832832
int n;
833
+ int nErr = 0;
833834
const char *zMethod;
834835
db_find_and_open_repository(0, 0);
835836
db_open_config(0, 0);
836837
if( g.argc<3 ){
837838
usage("SUBCOMMAND ...");
@@ -845,11 +846,11 @@
845846
if( g.argc!=5 ){
846847
usage("export AREA FILENAME");
847848
}
848849
mask = configure_name_to_mask(g.argv[3], 1);
849850
if( zSince ){
850
- iStart = db_multi_exec(
851
+ iStart = db_int64(0,
851852
"SELECT coalesce(strftime('%%s',%Q),strftime('%%s','now',%Q))+0",
852853
zSince, zSince
853854
);
854855
}else{
855856
iStart = 0;
@@ -897,17 +898,17 @@
897898
user_select();
898899
url_enable_proxy("via proxy: ");
899900
g.zHttpAuth = get_httpauth();
900901
if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
901902
if( strncmp(zMethod, "push", n)==0 ){
902
- client_sync(0,0,(unsigned)mask,0,0);
903
+ nErr = client_sync(0,0,(unsigned)mask,0,0);
903904
}else if( strncmp(zMethod, "pull", n)==0 ){
904905
if( overwriteFlag ) db_unprotect(PROTECT_USER);
905
- client_sync(0,(unsigned)mask,0,0,0);
906
+ nErr = client_sync(0,(unsigned)mask,0,0,0);
906907
if( overwriteFlag ) db_protect_pop();
907908
}else{
908
- client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
909
+ nErr = client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
909910
}
910911
}else
911912
if( strncmp(zMethod, "reset", n)==0 ){
912913
int mask, i;
913914
char *zBackup;
@@ -944,10 +945,18 @@
944945
}
945946
}else if( fossil_strcmp(zName,"@reportfmt")==0 ){
946947
db_multi_exec("DELETE FROM reportfmt");
947948
assert( strchr(zRepositorySchemaDefaultReports,'%')==0 );
948949
db_multi_exec(zRepositorySchemaDefaultReports /*works-like:""*/);
950
+ }else if( fossil_strcmp(zName,"@alias")==0 ){
951
+ db_unprotect(PROTECT_CONFIG);
952
+ db_multi_exec("DELETE FROM config WHERE name GLOB 'walias:/*'");
953
+ db_protect_pop();
954
+ }else if( fossil_strcmp(zName,"@interwiki")==0 ){
955
+ db_unprotect(PROTECT_CONFIG);
956
+ db_multi_exec("DELETE FROM config WHERE name GLOB 'interwiki:*'");
957
+ db_protect_pop();
949958
}
950959
}
951960
db_end_transaction(0);
952961
fossil_print("Configuration reset to factory defaults.\n");
953962
fossil_print("To recover, use: %s %s import %s\n",
@@ -957,10 +966,11 @@
957966
{
958967
fossil_fatal("METHOD should be one of:"
959968
" export import merge pull push reset");
960969
}
961970
configure_rebuild();
971
+ if( nErr ) fossil_exit(1);
962972
}
963973
964974
965975
/*
966976
** COMMAND: test-var-list
@@ -1055,11 +1065,13 @@
10551065
}
10561066
db_finalize(&q);
10571067
if( zPattern && doUnset ){
10581068
prompt_user("Delete all of the above? (y/N)? ", &ans);
10591069
if( blob_str(&ans)[0]=='y' || blob_str(&ans)[0]=='Y' ){
1070
+ db_unprotect(PROTECT_CONFIG);
10601071
db_multi_exec("DELETE FROM config WHERE name GLOB %Q", zPattern);
1072
+ db_protect_pop();
10611073
}
10621074
blob_reset(&ans);
10631075
}
10641076
}
10651077
10661078
--- src/configure.c
+++ src/configure.c
@@ -828,10 +828,11 @@
828 **
829 ** See also: [[settings]], [[unset]]
830 */
831 void configuration_cmd(void){
832 int n;
 
833 const char *zMethod;
834 db_find_and_open_repository(0, 0);
835 db_open_config(0, 0);
836 if( g.argc<3 ){
837 usage("SUBCOMMAND ...");
@@ -845,11 +846,11 @@
845 if( g.argc!=5 ){
846 usage("export AREA FILENAME");
847 }
848 mask = configure_name_to_mask(g.argv[3], 1);
849 if( zSince ){
850 iStart = db_multi_exec(
851 "SELECT coalesce(strftime('%%s',%Q),strftime('%%s','now',%Q))+0",
852 zSince, zSince
853 );
854 }else{
855 iStart = 0;
@@ -897,17 +898,17 @@
897 user_select();
898 url_enable_proxy("via proxy: ");
899 g.zHttpAuth = get_httpauth();
900 if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
901 if( strncmp(zMethod, "push", n)==0 ){
902 client_sync(0,0,(unsigned)mask,0,0);
903 }else if( strncmp(zMethod, "pull", n)==0 ){
904 if( overwriteFlag ) db_unprotect(PROTECT_USER);
905 client_sync(0,(unsigned)mask,0,0,0);
906 if( overwriteFlag ) db_protect_pop();
907 }else{
908 client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
909 }
910 }else
911 if( strncmp(zMethod, "reset", n)==0 ){
912 int mask, i;
913 char *zBackup;
@@ -944,10 +945,18 @@
944 }
945 }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
946 db_multi_exec("DELETE FROM reportfmt");
947 assert( strchr(zRepositorySchemaDefaultReports,'%')==0 );
948 db_multi_exec(zRepositorySchemaDefaultReports /*works-like:""*/);
 
 
 
 
 
 
 
 
949 }
950 }
951 db_end_transaction(0);
952 fossil_print("Configuration reset to factory defaults.\n");
953 fossil_print("To recover, use: %s %s import %s\n",
@@ -957,10 +966,11 @@
957 {
958 fossil_fatal("METHOD should be one of:"
959 " export import merge pull push reset");
960 }
961 configure_rebuild();
 
962 }
963
964
965 /*
966 ** COMMAND: test-var-list
@@ -1055,11 +1065,13 @@
1055 }
1056 db_finalize(&q);
1057 if( zPattern && doUnset ){
1058 prompt_user("Delete all of the above? (y/N)? ", &ans);
1059 if( blob_str(&ans)[0]=='y' || blob_str(&ans)[0]=='Y' ){
 
1060 db_multi_exec("DELETE FROM config WHERE name GLOB %Q", zPattern);
 
1061 }
1062 blob_reset(&ans);
1063 }
1064 }
1065
1066
--- src/configure.c
+++ src/configure.c
@@ -828,10 +828,11 @@
828 **
829 ** See also: [[settings]], [[unset]]
830 */
831 void configuration_cmd(void){
832 int n;
833 int nErr = 0;
834 const char *zMethod;
835 db_find_and_open_repository(0, 0);
836 db_open_config(0, 0);
837 if( g.argc<3 ){
838 usage("SUBCOMMAND ...");
@@ -845,11 +846,11 @@
846 if( g.argc!=5 ){
847 usage("export AREA FILENAME");
848 }
849 mask = configure_name_to_mask(g.argv[3], 1);
850 if( zSince ){
851 iStart = db_int64(0,
852 "SELECT coalesce(strftime('%%s',%Q),strftime('%%s','now',%Q))+0",
853 zSince, zSince
854 );
855 }else{
856 iStart = 0;
@@ -897,17 +898,17 @@
898 user_select();
899 url_enable_proxy("via proxy: ");
900 g.zHttpAuth = get_httpauth();
901 if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
902 if( strncmp(zMethod, "push", n)==0 ){
903 nErr = client_sync(0,0,(unsigned)mask,0,0);
904 }else if( strncmp(zMethod, "pull", n)==0 ){
905 if( overwriteFlag ) db_unprotect(PROTECT_USER);
906 nErr = client_sync(0,(unsigned)mask,0,0,0);
907 if( overwriteFlag ) db_protect_pop();
908 }else{
909 nErr = client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
910 }
911 }else
912 if( strncmp(zMethod, "reset", n)==0 ){
913 int mask, i;
914 char *zBackup;
@@ -944,10 +945,18 @@
945 }
946 }else if( fossil_strcmp(zName,"@reportfmt")==0 ){
947 db_multi_exec("DELETE FROM reportfmt");
948 assert( strchr(zRepositorySchemaDefaultReports,'%')==0 );
949 db_multi_exec(zRepositorySchemaDefaultReports /*works-like:""*/);
950 }else if( fossil_strcmp(zName,"@alias")==0 ){
951 db_unprotect(PROTECT_CONFIG);
952 db_multi_exec("DELETE FROM config WHERE name GLOB 'walias:/*'");
953 db_protect_pop();
954 }else if( fossil_strcmp(zName,"@interwiki")==0 ){
955 db_unprotect(PROTECT_CONFIG);
956 db_multi_exec("DELETE FROM config WHERE name GLOB 'interwiki:*'");
957 db_protect_pop();
958 }
959 }
960 db_end_transaction(0);
961 fossil_print("Configuration reset to factory defaults.\n");
962 fossil_print("To recover, use: %s %s import %s\n",
@@ -957,10 +966,11 @@
966 {
967 fossil_fatal("METHOD should be one of:"
968 " export import merge pull push reset");
969 }
970 configure_rebuild();
971 if( nErr ) fossil_exit(1);
972 }
973
974
975 /*
976 ** COMMAND: test-var-list
@@ -1055,11 +1065,13 @@
1065 }
1066 db_finalize(&q);
1067 if( zPattern && doUnset ){
1068 prompt_user("Delete all of the above? (y/N)? ", &ans);
1069 if( blob_str(&ans)[0]=='y' || blob_str(&ans)[0]=='Y' ){
1070 db_unprotect(PROTECT_CONFIG);
1071 db_multi_exec("DELETE FROM config WHERE name GLOB %Q", zPattern);
1072 db_protect_pop();
1073 }
1074 blob_reset(&ans);
1075 }
1076 }
1077
1078
+4 -2
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
12091209
int manifest_is_well_formed(const char *zIn, int nIn){
12101210
int i;
12111211
int iRes;
12121212
Manifest *pManifest;
12131213
Blob copy, errmsg;
1214
+ if( nIn<1 || zIn[nIn-1]!='\n' ) return 0;
12141215
remove_pgp_signature(&zIn, &nIn);
12151216
12161217
/* Check to see that the file begins with a "card" */
12171218
if( nIn<3 ) return 0;
12181219
if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
@@ -1219,11 +1220,12 @@
12191220
12201221
/* Check to see that the first card is followed by one more card */
12211222
for(i=2; i<nIn && zIn[i]!='\n'; i++){}
12221223
if( i>=nIn-3 ) return 0;
12231224
i++;
1224
- if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] || zIn[i+1]!=' ' ) return 0;
1225
+ if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] ) return 0;
1226
+ if( zIn[i+1]!=' ' && zIn[i+1]!='\n' ) return 0;
12251227
12261228
/* The checks above will eliminate most random inputs. If these
12271229
** quick checks pass, then we could be dealing with a well-formed
12281230
** control artifact. Make a copy, and run it through the official
12291231
** artifact parser. This is the slow path, but it is rarely taken.
@@ -2633,11 +2635,11 @@
26332635
if( p->type==CFTYPE_ATTACHMENT ){
26342636
char *zComment = 0;
26352637
const char isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
26362638
char attachToType = 0;
26372639
db_multi_exec(
2638
- "INSERT INTO attachment(attachid, mtime, src, target,"
2640
+ "REPLACE INTO attachment(attachid, mtime, src, target,"
26392641
"filename, comment, user)"
26402642
"VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
26412643
rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
26422644
(p->zComment ? p->zComment : ""), p->zUser
26432645
);
26442646
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
1209 int manifest_is_well_formed(const char *zIn, int nIn){
1210 int i;
1211 int iRes;
1212 Manifest *pManifest;
1213 Blob copy, errmsg;
 
1214 remove_pgp_signature(&zIn, &nIn);
1215
1216 /* Check to see that the file begins with a "card" */
1217 if( nIn<3 ) return 0;
1218 if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
@@ -1219,11 +1220,12 @@
1219
1220 /* Check to see that the first card is followed by one more card */
1221 for(i=2; i<nIn && zIn[i]!='\n'; i++){}
1222 if( i>=nIn-3 ) return 0;
1223 i++;
1224 if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] || zIn[i+1]!=' ' ) return 0;
 
1225
1226 /* The checks above will eliminate most random inputs. If these
1227 ** quick checks pass, then we could be dealing with a well-formed
1228 ** control artifact. Make a copy, and run it through the official
1229 ** artifact parser. This is the slow path, but it is rarely taken.
@@ -2633,11 +2635,11 @@
2633 if( p->type==CFTYPE_ATTACHMENT ){
2634 char *zComment = 0;
2635 const char isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
2636 char attachToType = 0;
2637 db_multi_exec(
2638 "INSERT INTO attachment(attachid, mtime, src, target,"
2639 "filename, comment, user)"
2640 "VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
2641 rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
2642 (p->zComment ? p->zComment : ""), p->zUser
2643 );
2644
--- src/manifest.c
+++ src/manifest.c
@@ -1209,10 +1209,11 @@
1209 int manifest_is_well_formed(const char *zIn, int nIn){
1210 int i;
1211 int iRes;
1212 Manifest *pManifest;
1213 Blob copy, errmsg;
1214 if( nIn<1 || zIn[nIn-1]!='\n' ) return 0;
1215 remove_pgp_signature(&zIn, &nIn);
1216
1217 /* Check to see that the file begins with a "card" */
1218 if( nIn<3 ) return 0;
1219 if( zIn[0]<'A' || zIn[0]>'M' || zIn[1]!=' ' ) return 0;
@@ -1219,11 +1220,12 @@
1220
1221 /* Check to see that the first card is followed by one more card */
1222 for(i=2; i<nIn && zIn[i]!='\n'; i++){}
1223 if( i>=nIn-3 ) return 0;
1224 i++;
1225 if( !fossil_isupper(zIn[i]) || zIn[i]<zIn[0] ) return 0;
1226 if( zIn[i+1]!=' ' && zIn[i+1]!='\n' ) return 0;
1227
1228 /* The checks above will eliminate most random inputs. If these
1229 ** quick checks pass, then we could be dealing with a well-formed
1230 ** control artifact. Make a copy, and run it through the official
1231 ** artifact parser. This is the slow path, but it is rarely taken.
@@ -2633,11 +2635,11 @@
2635 if( p->type==CFTYPE_ATTACHMENT ){
2636 char *zComment = 0;
2637 const char isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
2638 char attachToType = 0;
2639 db_multi_exec(
2640 "REPLACE INTO attachment(attachid, mtime, src, target,"
2641 "filename, comment, user)"
2642 "VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
2643 rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
2644 (p->zComment ? p->zComment : ""), p->zUser
2645 );
2646
--- src/robot.c
+++ src/robot.c
@@ -139,10 +139,16 @@
139139
/* Only do this computation once, then cache the results for future
140140
** use */
141141
if( robot.resultCache ){
142142
return robot.resultCache==MIGHT_BE_ROBOT;
143143
}
144
+
145
+ /* A command run from the command line has no web client. */
146
+ if( !g.isHTTP ){
147
+ robot.resultCache = KNOWN_NOT_ROBOT;
148
+ return 0;
149
+ }
144150
145151
/* Condition 1: Is there a valid login?
146152
*/
147153
if( g.userUid==0 ){
148154
login_check_credentials();
149155
--- src/robot.c
+++ src/robot.c
@@ -139,10 +139,16 @@
139 /* Only do this computation once, then cache the results for future
140 ** use */
141 if( robot.resultCache ){
142 return robot.resultCache==MIGHT_BE_ROBOT;
143 }
 
 
 
 
 
 
144
145 /* Condition 1: Is there a valid login?
146 */
147 if( g.userUid==0 ){
148 login_check_credentials();
149
--- src/robot.c
+++ src/robot.c
@@ -139,10 +139,16 @@
139 /* Only do this computation once, then cache the results for future
140 ** use */
141 if( robot.resultCache ){
142 return robot.resultCache==MIGHT_BE_ROBOT;
143 }
144
145 /* A command run from the command line has no web client. */
146 if( !g.isHTTP ){
147 robot.resultCache = KNOWN_NOT_ROBOT;
148 return 0;
149 }
150
151 /* Condition 1: Is there a valid login?
152 */
153 if( g.userUid==0 ){
154 login_check_credentials();
155
+1
--- src/url.c
+++ src/url.c
@@ -235,10 +235,11 @@
235235
if( c==':' ){
236236
pUrlData->port = 0;
237237
i++;
238238
while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239239
pUrlData->port = pUrlData->port*10 + c - '0';
240
+ if( pUrlData->port>65535 ) fossil_fatal("port number too large in url");
240241
i++;
241242
}
242243
if( c!=0 && c!='/' && c!='?' && c!='#' ){
243244
fossil_fatal("url missing '/' after port number");
244245
}
245246
--- src/url.c
+++ src/url.c
@@ -235,10 +235,11 @@
235 if( c==':' ){
236 pUrlData->port = 0;
237 i++;
238 while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239 pUrlData->port = pUrlData->port*10 + c - '0';
 
240 i++;
241 }
242 if( c!=0 && c!='/' && c!='?' && c!='#' ){
243 fossil_fatal("url missing '/' after port number");
244 }
245
--- src/url.c
+++ src/url.c
@@ -235,10 +235,11 @@
235 if( c==':' ){
236 pUrlData->port = 0;
237 i++;
238 while( (c = zUrl[i])!=0 && fossil_isdigit(c) ){
239 pUrlData->port = pUrlData->port*10 + c - '0';
240 if( pUrlData->port>65535 ) fossil_fatal("port number too large in url");
241 i++;
242 }
243 if( c!=0 && c!='/' && c!='?' && c!='#' ){
244 fossil_fatal("url missing '/' after port number");
245 }
246
+12 -3
--- 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)"
@@ -2023,11 +2027,12 @@
20232027
" UNION ALL\n"
20242028
" SELECT mtime, substr(name,10), '{}' FROM config\n"
20252029
" WHERE name GLOB 'syncfrom:http*'\n"
20262030
" UNION ALL\n"
20272031
" SELECT mtime, substr(name,9), '{\"type\":\"git\"}' FROM config\n"
2028
- " WHERE name GLOB 'gitpush:*'\n"
2032
+ " WHERE name GLOB 'gitpush:http://*'\n"
2033
+ " OR name GLOB 'gitpush:https://*'\n"
20292034
")\n"
20302035
"SELECT url, json_insert(arg,'$.src',%Q), max(mtime)\n"
20312036
" FROM remote WHERE mtime>unixepoch('now','-1 month')\n"
20322037
" GROUP BY url;",
20332038
g.zBaseURL
@@ -3000,11 +3005,15 @@
30003005
char *zArg = blob_str(&xfer.aToken[3]);
30013006
i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0);
30023007
memset(&x, 0, sizeof(x));
30033008
defossilize(zUrl);
30043009
defossilize(zArg);
3005
- url_parse_local(zUrl, URL_OMIT_USER, &x);
3010
+ if( fossil_strnicmp(zUrl, "http://", 7)==0
3011
+ || fossil_strnicmp(zUrl, "https://", 8)==0
3012
+ ){
3013
+ url_parse_local(zUrl, URL_OMIT_USER, &x);
3014
+ }
30063015
if( x.protocol
30073016
&& strncmp(x.protocol,"http",4)==0
30083017
&& iTime>0
30093018
){
30103019
db_unprotect(PROTECT_CONFIG);
30113020
--- 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)"
@@ -2023,11 +2027,12 @@
2023 " UNION ALL\n"
2024 " SELECT mtime, substr(name,10), '{}' FROM config\n"
2025 " WHERE name GLOB 'syncfrom:http*'\n"
2026 " UNION ALL\n"
2027 " SELECT mtime, substr(name,9), '{\"type\":\"git\"}' FROM config\n"
2028 " WHERE name GLOB 'gitpush:*'\n"
 
2029 ")\n"
2030 "SELECT url, json_insert(arg,'$.src',%Q), max(mtime)\n"
2031 " FROM remote WHERE mtime>unixepoch('now','-1 month')\n"
2032 " GROUP BY url;",
2033 g.zBaseURL
@@ -3000,11 +3005,15 @@
3000 char *zArg = blob_str(&xfer.aToken[3]);
3001 i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0);
3002 memset(&x, 0, sizeof(x));
3003 defossilize(zUrl);
3004 defossilize(zArg);
3005 url_parse_local(zUrl, URL_OMIT_USER, &x);
 
 
 
 
3006 if( x.protocol
3007 && strncmp(x.protocol,"http",4)==0
3008 && iTime>0
3009 ){
3010 db_unprotect(PROTECT_CONFIG);
3011
--- 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)"
@@ -2023,11 +2027,12 @@
2027 " UNION ALL\n"
2028 " SELECT mtime, substr(name,10), '{}' FROM config\n"
2029 " WHERE name GLOB 'syncfrom:http*'\n"
2030 " UNION ALL\n"
2031 " SELECT mtime, substr(name,9), '{\"type\":\"git\"}' FROM config\n"
2032 " WHERE name GLOB 'gitpush:http://*'\n"
2033 " OR name GLOB 'gitpush:https://*'\n"
2034 ")\n"
2035 "SELECT url, json_insert(arg,'$.src',%Q), max(mtime)\n"
2036 " FROM remote WHERE mtime>unixepoch('now','-1 month')\n"
2037 " GROUP BY url;",
2038 g.zBaseURL
@@ -3000,11 +3005,15 @@
3005 char *zArg = blob_str(&xfer.aToken[3]);
3006 i64 iTime = strtoll(blob_str(&xfer.aToken[4]),0,0);
3007 memset(&x, 0, sizeof(x));
3008 defossilize(zUrl);
3009 defossilize(zArg);
3010 if( fossil_strnicmp(zUrl, "http://", 7)==0
3011 || fossil_strnicmp(zUrl, "https://", 8)==0
3012 ){
3013 url_parse_local(zUrl, URL_OMIT_USER, &x);
3014 }
3015 if( x.protocol
3016 && strncmp(x.protocol,"http",4)==0
3017 && iTime>0
3018 ){
3019 db_unprotect(PROTECT_CONFIG);
3020

Keyboard Shortcuts

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