Fossil SCM

In client_sync(), accept file and cfile cards only in a sync that pulls. A server could otherwise add artifacts to the client in answer to a push.

dmestas 2026-11-15 12:39 UTC small-fixes-2
Commit 7c052d3a719382a9a7c29d9c2c384606866d133d31e4c05faf13f718f78d5953
1 file changed +6 -2
+6 -2
--- src/xfer.c
+++ src/xfer.c
@@ -2563,21 +2563,25 @@
25632563
/* file HASH SIZE \n CONTENT
25642564
** file HASH DELTASRC SIZE \n CONTENT
25652565
**
25662566
** Client receives a file transmitted from the server.
25672567
*/
2568
- if( blob_eq(&xfer.aToken[0],"file") ){
2568
+ if( blob_eq(&xfer.aToken[0],"file")
2569
+ && (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0
2570
+ ){
25692571
xfer_accept_file(&xfer, (syncFlags & SYNC_CLONE)!=0, 0, 0);
25702572
nArtifactRcvd++;
25712573
}else
25722574
25732575
/* cfile HASH USIZE CSIZE \n CONTENT
25742576
** cfile HASH DELTASRC USIZE CSIZE \n CONTENT
25752577
**
25762578
** Client receives a compressed file transmitted from the server.
25772579
*/
2578
- if( blob_eq(&xfer.aToken[0],"cfile") ){
2580
+ if( blob_eq(&xfer.aToken[0],"cfile")
2581
+ && (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0
2582
+ ){
25792583
xfer_accept_compressed_file(&xfer, 0, 0);
25802584
nArtifactRcvd++;
25812585
}else
25822586
25832587
/* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
25842588
--- src/xfer.c
+++ src/xfer.c
@@ -2563,21 +2563,25 @@
2563 /* file HASH SIZE \n CONTENT
2564 ** file HASH DELTASRC SIZE \n CONTENT
2565 **
2566 ** Client receives a file transmitted from the server.
2567 */
2568 if( blob_eq(&xfer.aToken[0],"file") ){
 
 
2569 xfer_accept_file(&xfer, (syncFlags & SYNC_CLONE)!=0, 0, 0);
2570 nArtifactRcvd++;
2571 }else
2572
2573 /* cfile HASH USIZE CSIZE \n CONTENT
2574 ** cfile HASH DELTASRC USIZE CSIZE \n CONTENT
2575 **
2576 ** Client receives a compressed file transmitted from the server.
2577 */
2578 if( blob_eq(&xfer.aToken[0],"cfile") ){
 
 
2579 xfer_accept_compressed_file(&xfer, 0, 0);
2580 nArtifactRcvd++;
2581 }else
2582
2583 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
2584
--- src/xfer.c
+++ src/xfer.c
@@ -2563,21 +2563,25 @@
2563 /* file HASH SIZE \n CONTENT
2564 ** file HASH DELTASRC SIZE \n CONTENT
2565 **
2566 ** Client receives a file transmitted from the server.
2567 */
2568 if( blob_eq(&xfer.aToken[0],"file")
2569 && (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0
2570 ){
2571 xfer_accept_file(&xfer, (syncFlags & SYNC_CLONE)!=0, 0, 0);
2572 nArtifactRcvd++;
2573 }else
2574
2575 /* cfile HASH USIZE CSIZE \n CONTENT
2576 ** cfile HASH DELTASRC USIZE CSIZE \n CONTENT
2577 **
2578 ** Client receives a compressed file transmitted from the server.
2579 */
2580 if( blob_eq(&xfer.aToken[0],"cfile")
2581 && (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0
2582 ){
2583 xfer_accept_compressed_file(&xfer, 0, 0);
2584 nArtifactRcvd++;
2585 }else
2586
2587 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
2588

Keyboard Shortcuts

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