Diff
Not logged in

Differences From:

File src/vfile.c part of check-in [2f15cd805e] - Improvements to some comments in vfile.c. by drh on 2009-12-16 02:02:54. [view]

To:

File src/vfile.c part of check-in [d861fe77fb] - If a file in the check-out is changed to something other than a file (like a directory) then raise an error when checking file signatures. Also fix a problem with the new multi-file "revert" command and add some comments to "update". by drh on 2009-12-17 18:47:14. [view]

@@ -144,8 +144,9 @@
 ** If VFILE.DELETED is null or if VFILE.RID is zero, then we can assume
 ** the file has changed without having the check the on-disk image.
 */
 void vfile_check_signature(int vid){
+  int nErr = 0;
   Stmt q;
   Blob fileCksum, origCksum;
   int checkMtime = db_get_boolean("mtime-changes", 0);
 
@@ -167,8 +168,13 @@
     rid = db_column_int(&q, 2);
     isDeleted = db_column_int(&q, 3);
     oldChnged = db_column_int(&q, 4);
     oldMtime = db_column_int64(&q, 6);
+    if( !file_isfile(zName) && file_size(zName)>=0 ){
+      fossil_warning("not a ordinary file: %s", zName);
+      nErr++;
+      continue;
+    }
     if( oldChnged>=2 ){
       chnged = oldChnged;
     }else if( isDeleted || rid==0 ){
       chnged = 1;
@@ -194,8 +200,9 @@
       db_multi_exec("UPDATE vfile SET chnged=%d WHERE id=%d", chnged, id);
     }
   }
   db_finalize(&q);
+  if( nErr ) fossil_fatal("abort due to prior errors");
   db_end_transaction(0);
 }
 
 /*