Fossil SCM

In client_sync(), act on uvfile and uvigot cards only in a sync of unversioned content or in a clone. A server could otherwise replace an unversioned file in the client during an ordinary pull, and a uvigot card ended an ordinary pull with an SQL error.

dmestas 2026-11-15 12:04 UTC small-fixes-2
Commit c149b999e88e11401e9d579d33cf62c0b33dc5e3709650c8cf98937ef14ce0da
1 file changed +4 -1
+4 -1
--- src/xfer.c
+++ src/xfer.c
@@ -2582,11 +2582,13 @@
25822582
25832583
/* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
25842584
**
25852585
** Client accepts an unversioned file from the server.
25862586
*/
2587
- if( blob_eq(&xfer.aToken[0], "uvfile") ){
2587
+ if( blob_eq(&xfer.aToken[0], "uvfile")
2588
+ && (syncFlags & (SYNC_UNVERSIONED|SYNC_CLONE))!=0
2589
+ ){
25882590
xfer_accept_unversioned_file(&xfer, 1);
25892591
nArtifactRcvd++;
25902592
nUvFileRcvd++;
25912593
if( syncFlags & SYNC_VERBOSE ){
25922594
fossil_print("\rUnversioned-file received: %s\n",
@@ -2662,10 +2664,11 @@
26622664
** (indicating that the file has been deleted) and MTIME is newer,
26632665
** then do the deletion.
26642666
*/
26652667
if( xfer.nToken==5
26662668
&& blob_eq(&xfer.aToken[0], "uvigot")
2669
+ && (syncFlags & (SYNC_UNVERSIONED|SYNC_CLONE))!=0
26672670
&& blob_is_filename(&xfer.aToken[1])
26682671
&& blob_is_int64(&xfer.aToken[2], &mtime)
26692672
&& blob_is_int(&xfer.aToken[4], &size)
26702673
&& (blob_eq(&xfer.aToken[3],"-") || blob_is_hname(&xfer.aToken[3]))
26712674
){
26722675
--- src/xfer.c
+++ src/xfer.c
@@ -2582,11 +2582,13 @@
2582
2583 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
2584 **
2585 ** Client accepts an unversioned file from the server.
2586 */
2587 if( blob_eq(&xfer.aToken[0], "uvfile") ){
 
 
2588 xfer_accept_unversioned_file(&xfer, 1);
2589 nArtifactRcvd++;
2590 nUvFileRcvd++;
2591 if( syncFlags & SYNC_VERBOSE ){
2592 fossil_print("\rUnversioned-file received: %s\n",
@@ -2662,10 +2664,11 @@
2662 ** (indicating that the file has been deleted) and MTIME is newer,
2663 ** then do the deletion.
2664 */
2665 if( xfer.nToken==5
2666 && blob_eq(&xfer.aToken[0], "uvigot")
 
2667 && blob_is_filename(&xfer.aToken[1])
2668 && blob_is_int64(&xfer.aToken[2], &mtime)
2669 && blob_is_int(&xfer.aToken[4], &size)
2670 && (blob_eq(&xfer.aToken[3],"-") || blob_is_hname(&xfer.aToken[3]))
2671 ){
2672
--- src/xfer.c
+++ src/xfer.c
@@ -2582,11 +2582,13 @@
2582
2583 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
2584 **
2585 ** Client accepts an unversioned file from the server.
2586 */
2587 if( blob_eq(&xfer.aToken[0], "uvfile")
2588 && (syncFlags & (SYNC_UNVERSIONED|SYNC_CLONE))!=0
2589 ){
2590 xfer_accept_unversioned_file(&xfer, 1);
2591 nArtifactRcvd++;
2592 nUvFileRcvd++;
2593 if( syncFlags & SYNC_VERBOSE ){
2594 fossil_print("\rUnversioned-file received: %s\n",
@@ -2662,10 +2664,11 @@
2664 ** (indicating that the file has been deleted) and MTIME is newer,
2665 ** then do the deletion.
2666 */
2667 if( xfer.nToken==5
2668 && blob_eq(&xfer.aToken[0], "uvigot")
2669 && (syncFlags & (SYNC_UNVERSIONED|SYNC_CLONE))!=0
2670 && blob_is_filename(&xfer.aToken[1])
2671 && blob_is_int64(&xfer.aToken[2], &mtime)
2672 && blob_is_int(&xfer.aToken[4], &size)
2673 && (blob_eq(&xfer.aToken[3],"-") || blob_is_hname(&xfer.aToken[3]))
2674 ){
2675

Keyboard Shortcuts

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