1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Improvements to the src-verify.c utility program so that it continues to

muddle through a corrupt manifest file, making the most sense of it that it
can and reporting "manifest" has having changed at the end.

FossilOrigin-Name: 157b5d25e0c99eabfa3c32cb867fe7e3c05031c12354f734d2cd8a4062b9439c
This commit is contained in:
drh
2023-06-08 16:19:21 +00:00
parent 8efe749ab3
commit 2f764eb4f4
3 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,5 @@
C Fix\sthe\samagamation\sgenerator\sso\sthat\sit\sworks\sone\sa\sclean\ssource\stree.
D 2023-06-08T15:30:10.762
C Improvements\sto\sthe\ssrc-verify.c\sutility\sprogram\sso\sthat\sit\scontinues\sto\nmuddle\sthrough\sa\scorrupt\smanifest\sfile,\smaking\sthe\smost\ssense\sof\sit\sthat\sit\ncan\sand\sreporting\s"manifest"\shas\shaving\schanged\sat\sthe\send.
D 2023-06-08T16:19:21.284
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -2007,7 +2007,7 @@ F tool/sqldiff.c 2a693b4e7c1818c23f871f82f0c3fe67d80b67e3f087893089d33da29c1e387
F tool/sqlite3_analyzer.c.in f88615bf33098945e0a42f17733f472083d150b58bdaaa5555a7129d0a51621c
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
F tool/src-verify.c b7b26f1ae4acbf20d1fd8d013dc621d52cda310b1432a39c3b5f34fca42806a7
F tool/src-verify.c f0cef434a8d8629c4928a02a644fb85e33c8b875a7f2352ba68cc50965a7d213
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
@ -2040,8 +2040,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P e3eb5af9050aae1db6887d17a560a24e4ca58f232ad7ac7c283c861ea4944f0b
R 4bab1374d9b75a8ff9e4a8520d8c45f2
P f502610d03a1362eea936129abd03390835b7e47ba25e6799b2e7880de540640
R 99e2fb823a987daff7bdbda52d841cbf
U drh
Z faf1ce1a345e37a86669b32b075b5901
Z de727eb2047d1189fb6632ba63933d87
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
f502610d03a1362eea936129abd03390835b7e47ba25e6799b2e7880de540640
157b5d25e0c99eabfa3c32cb867fe7e3c05031c12354f734d2cd8a4062b9439c

View File

@ -801,6 +801,7 @@ int main(int argc, char **argv){
FILE *in;
int bDebug = 0;
int bNonHuman = 0;
int bSeenManifestErr = 0;
int nErr = 0;
SHA3Context ctx3;
const char *zDir = 0;
@ -874,7 +875,7 @@ int main(int argc, char **argv){
}
in = fopen(zFile, "rb");
if( in==0 ){
printf("missing manifest: \"%s\"\n", zFile);
fprintf(stderr, "missing manifest: \"%s\"\n", zFile);
return 1;
}
SHA3Init(&ctx3, 256);
@ -895,8 +896,8 @@ int main(int argc, char **argv){
zFile[sizeof(zFile)-1] = 0;
defossilize(&zFile[nDir]);
if( zLine[i]!=' ' ){
xErr(&nErr, zVers, "manifest");
return 1;
bSeenManifestErr = 1;
continue;
}
for(i++, j=0; zLine[i]>='0' && zLine[i]<='f'; i++, j++){
if( j<sizeof(zHash) ) zHash[j] = zLine[i];
@ -921,12 +922,13 @@ int main(int argc, char **argv){
xErr(&nErr, zVers, &zFile[nDir]);
}
}else{
xErr(&nErr, zVers, "manifest");
return 1;
bSeenManifestErr = 1;
xErr(&nErr, zVers, &zFile[nDir]);
}
}
fclose(in);
in = 0;
if( bSeenManifestErr ) xErr(&nErr, zVers, "manifest");
memcpy(&zFile[nDir], "manifest.uuid", 14);
if( access(zFile, R_OK)!=0
|| (in = fopen(zFile,"rb"))==0