Fossil SCM
When pushing config from the server during sync, silently elide any settings flagged as sensitive.
Commit
dc64bf78214eda17e1d8126f901294dd7269bfe68d5eb9467431244cd8378a58
Parent
d254fcaa9d3eb38…
1 file changed
+6
+6
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -255,10 +255,11 @@ | ||
| 255 | 255 | fossil_free(zCpy); |
| 256 | 256 | }else{ |
| 257 | 257 | pSet = db_find_setting(zName, 0); |
| 258 | 258 | } |
| 259 | 259 | if( pSet && pSet->sensitive ){ |
| 260 | + /* https://fossil-scm.org/forum/forumpost/6179500deadf6ec7 */ | |
| 260 | 261 | return 0; |
| 261 | 262 | } |
| 262 | 263 | for(i=0; i<count(aConfig); i++){ |
| 263 | 264 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 264 | 265 | int m = aConfig[i].groupMask; |
| @@ -696,10 +697,15 @@ | ||
| 696 | 697 | } |
| 697 | 698 | db_prepare(&q, "SELECT mtime, quote(name), quote(value) FROM config" |
| 698 | 699 | " WHERE name=:name AND mtime>=%lld", iStart); |
| 699 | 700 | for(ii=0; ii<count(aConfig); ii++){ |
| 700 | 701 | if( (aConfig[ii].groupMask & groupMask)!=0 && aConfig[ii].zName[0]!='@' ){ |
| 702 | + const Setting * pSet = db_find_setting(aConfig[ii].zName, 0); | |
| 703 | + if( pSet && pSet->sensitive ){ | |
| 704 | + /* https://fossil-scm.org/forum/forumpost/6179500deadf6ec7 */ | |
| 705 | + continue; | |
| 706 | + } | |
| 701 | 707 | db_bind_text(&q, ":name", aConfig[ii].zName); |
| 702 | 708 | while( db_step(&q)==SQLITE_ROW ){ |
| 703 | 709 | blob_appendf(&rec,"%s %s value %s", |
| 704 | 710 | db_column_text(&q, 0), |
| 705 | 711 | db_column_text(&q, 1), |
| 706 | 712 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -255,10 +255,11 @@ | |
| 255 | fossil_free(zCpy); |
| 256 | }else{ |
| 257 | pSet = db_find_setting(zName, 0); |
| 258 | } |
| 259 | if( pSet && pSet->sensitive ){ |
| 260 | return 0; |
| 261 | } |
| 262 | for(i=0; i<count(aConfig); i++){ |
| 263 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 264 | int m = aConfig[i].groupMask; |
| @@ -696,10 +697,15 @@ | |
| 696 | } |
| 697 | db_prepare(&q, "SELECT mtime, quote(name), quote(value) FROM config" |
| 698 | " WHERE name=:name AND mtime>=%lld", iStart); |
| 699 | for(ii=0; ii<count(aConfig); ii++){ |
| 700 | if( (aConfig[ii].groupMask & groupMask)!=0 && aConfig[ii].zName[0]!='@' ){ |
| 701 | db_bind_text(&q, ":name", aConfig[ii].zName); |
| 702 | while( db_step(&q)==SQLITE_ROW ){ |
| 703 | blob_appendf(&rec,"%s %s value %s", |
| 704 | db_column_text(&q, 0), |
| 705 | db_column_text(&q, 1), |
| 706 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -255,10 +255,11 @@ | |
| 255 | fossil_free(zCpy); |
| 256 | }else{ |
| 257 | pSet = db_find_setting(zName, 0); |
| 258 | } |
| 259 | if( pSet && pSet->sensitive ){ |
| 260 | /* https://fossil-scm.org/forum/forumpost/6179500deadf6ec7 */ |
| 261 | return 0; |
| 262 | } |
| 263 | for(i=0; i<count(aConfig); i++){ |
| 264 | if( strncmp(zName, aConfig[i].zName, n)==0 && aConfig[i].zName[n]==0 ){ |
| 265 | int m = aConfig[i].groupMask; |
| @@ -696,10 +697,15 @@ | |
| 697 | } |
| 698 | db_prepare(&q, "SELECT mtime, quote(name), quote(value) FROM config" |
| 699 | " WHERE name=:name AND mtime>=%lld", iStart); |
| 700 | for(ii=0; ii<count(aConfig); ii++){ |
| 701 | if( (aConfig[ii].groupMask & groupMask)!=0 && aConfig[ii].zName[0]!='@' ){ |
| 702 | const Setting * pSet = db_find_setting(aConfig[ii].zName, 0); |
| 703 | if( pSet && pSet->sensitive ){ |
| 704 | /* https://fossil-scm.org/forum/forumpost/6179500deadf6ec7 */ |
| 705 | continue; |
| 706 | } |
| 707 | db_bind_text(&q, ":name", aConfig[ii].zName); |
| 708 | while( db_step(&q)==SQLITE_ROW ){ |
| 709 | blob_appendf(&rec,"%s %s value %s", |
| 710 | db_column_text(&q, 0), |
| 711 | db_column_text(&q, 1), |
| 712 |