Fossil SCM
Clarify the difference between fossil_fatal() and fossil_panic(). The fossil_panic() interface puts a message on the error log when generating webpages. Otherwise the two routines are identical. Convert some fossil_fatal() calls into fossil_panic() where appropriate. The goal here is to limit messages on the error log to things that require attention from the system administrator, or represent bugs.
Commit
3f5ab71744cb6e2aa400352e6e8c7df8cf9ead7c90a12d4192f58c20e289f171
Parent
06d4751a4471c22…
26 files changed
+1
-1
+1
-1
+3
-3
+15
-15
+1
-1
+1
-1
+1
-1
+2
-2
+3
-3
+3
-3
+1
-1
+1
-1
+2
-2
+1
-1
+17
-17
+1
-1
+1
-1
+6
+1
-1
+1
-1
+1
-1
+1
-1
+11
-11
+1
-1
+1
-1
+8
-8
~
src/add.c
~
src/blob.c
~
src/bundle.c
~
src/db.c
~
src/dispatch.c
~
src/doc.c
~
src/event.c
~
src/file.c
~
src/http_ssl.c
~
src/http_transport.c
~
src/import.c
~
src/json.c
~
src/json_branch.c
~
src/json_status.c
~
src/main.c
~
src/manifest.c
~
src/popen.c
~
src/printf.c
~
src/purge.c
~
src/skins.c
~
src/sqlcmd.c
~
src/tar.c
~
src/util.c
~
src/verify.c
~
src/winfile.c
~
src/winhttp.c
+1
-1
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -875,11 +875,11 @@ | ||
| 875 | 875 | /* We should be done with options.. */ |
| 876 | 876 | verify_all_options(); |
| 877 | 877 | |
| 878 | 878 | vid = db_lget_int("checkout", 0); |
| 879 | 879 | if( vid==0 ){ |
| 880 | - fossil_fatal("no checkout rename files in"); | |
| 880 | + fossil_fatal("no checkout in which to rename files"); | |
| 881 | 881 | } |
| 882 | 882 | if( g.argc<4 ){ |
| 883 | 883 | usage("OLDNAME NEWNAME"); |
| 884 | 884 | } |
| 885 | 885 | zDest = g.argv[g.argc-1]; |
| 886 | 886 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -875,11 +875,11 @@ | |
| 875 | /* We should be done with options.. */ |
| 876 | verify_all_options(); |
| 877 | |
| 878 | vid = db_lget_int("checkout", 0); |
| 879 | if( vid==0 ){ |
| 880 | fossil_fatal("no checkout rename files in"); |
| 881 | } |
| 882 | if( g.argc<4 ){ |
| 883 | usage("OLDNAME NEWNAME"); |
| 884 | } |
| 885 | zDest = g.argv[g.argc-1]; |
| 886 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -875,11 +875,11 @@ | |
| 875 | /* We should be done with options.. */ |
| 876 | verify_all_options(); |
| 877 | |
| 878 | vid = db_lget_int("checkout", 0); |
| 879 | if( vid==0 ){ |
| 880 | fossil_fatal("no checkout in which to rename files"); |
| 881 | } |
| 882 | if( g.argc<4 ){ |
| 883 | usage("OLDNAME NEWNAME"); |
| 884 | } |
| 885 | zDest = g.argv[g.argc-1]; |
| 886 |
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -339,11 +339,11 @@ | ||
| 339 | 339 | ** text was ever added using blob_appendf() then throw an error. |
| 340 | 340 | */ |
| 341 | 341 | char *blob_sql_text(Blob *p){ |
| 342 | 342 | blob_is_init(p); |
| 343 | 343 | if( (p->blobFlags & BLOBFLAG_NotSQL) ){ |
| 344 | - fossil_fatal("Internal error: Use of blob_appendf() to construct SQL text"); | |
| 344 | + fossil_panic("use of blob_appendf() to construct SQL text"); | |
| 345 | 345 | } |
| 346 | 346 | return blob_str(p); |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | |
| 350 | 350 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -339,11 +339,11 @@ | |
| 339 | ** text was ever added using blob_appendf() then throw an error. |
| 340 | */ |
| 341 | char *blob_sql_text(Blob *p){ |
| 342 | blob_is_init(p); |
| 343 | if( (p->blobFlags & BLOBFLAG_NotSQL) ){ |
| 344 | fossil_fatal("Internal error: Use of blob_appendf() to construct SQL text"); |
| 345 | } |
| 346 | return blob_str(p); |
| 347 | } |
| 348 | |
| 349 | |
| 350 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -339,11 +339,11 @@ | |
| 339 | ** text was ever added using blob_appendf() then throw an error. |
| 340 | */ |
| 341 | char *blob_sql_text(Blob *p){ |
| 342 | blob_is_init(p); |
| 343 | if( (p->blobFlags & BLOBFLAG_NotSQL) ){ |
| 344 | fossil_panic("use of blob_appendf() to construct SQL text"); |
| 345 | } |
| 346 | return blob_str(p); |
| 347 | } |
| 348 | |
| 349 | |
| 350 |
+3
-3
| --- src/bundle.c | ||
| +++ src/bundle.c | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | if( !doInit && file_size(zFile, ExtFILE)<0 ){ |
| 61 | 61 | fossil_fatal("no such file: %s", zFile); |
| 62 | 62 | } |
| 63 | 63 | assert( g.db ); |
| 64 | 64 | zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName); |
| 65 | - if( zSql==0 ) fossil_fatal("out of memory"); | |
| 65 | + if( zSql==0 ) fossil_panic("out of memory"); | |
| 66 | 66 | rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg); |
| 67 | 67 | sqlite3_free(zSql); |
| 68 | 68 | if( rc!=SQLITE_OK || zErrMsg ){ |
| 69 | 69 | if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db); |
| 70 | 70 | fossil_fatal("not a valid bundle: %s", zFile); |
| @@ -73,18 +73,18 @@ | ||
| 73 | 73 | db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName); |
| 74 | 74 | }else{ |
| 75 | 75 | sqlite3_stmt *pStmt; |
| 76 | 76 | zSql = sqlite3_mprintf("SELECT bcname, bcvalue" |
| 77 | 77 | " FROM \"%w\".bconfig", zBName); |
| 78 | - if( zSql==0 ) fossil_fatal("out of memory"); | |
| 78 | + if( zSql==0 ) fossil_panic("out of memory"); | |
| 79 | 79 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 80 | 80 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 81 | 81 | sqlite3_free(zSql); |
| 82 | 82 | sqlite3_finalize(pStmt); |
| 83 | 83 | zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data" |
| 84 | 84 | " FROM \"%w\".bblob", zBName); |
| 85 | - if( zSql==0 ) fossil_fatal("out of memory"); | |
| 85 | + if( zSql==0 ) fossil_panic("out of memory"); | |
| 86 | 86 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 87 | 87 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 88 | 88 | sqlite3_free(zSql); |
| 89 | 89 | sqlite3_finalize(pStmt); |
| 90 | 90 | } |
| 91 | 91 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | if( !doInit && file_size(zFile, ExtFILE)<0 ){ |
| 61 | fossil_fatal("no such file: %s", zFile); |
| 62 | } |
| 63 | assert( g.db ); |
| 64 | zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName); |
| 65 | if( zSql==0 ) fossil_fatal("out of memory"); |
| 66 | rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg); |
| 67 | sqlite3_free(zSql); |
| 68 | if( rc!=SQLITE_OK || zErrMsg ){ |
| 69 | if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db); |
| 70 | fossil_fatal("not a valid bundle: %s", zFile); |
| @@ -73,18 +73,18 @@ | |
| 73 | db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName); |
| 74 | }else{ |
| 75 | sqlite3_stmt *pStmt; |
| 76 | zSql = sqlite3_mprintf("SELECT bcname, bcvalue" |
| 77 | " FROM \"%w\".bconfig", zBName); |
| 78 | if( zSql==0 ) fossil_fatal("out of memory"); |
| 79 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 80 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 81 | sqlite3_free(zSql); |
| 82 | sqlite3_finalize(pStmt); |
| 83 | zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data" |
| 84 | " FROM \"%w\".bblob", zBName); |
| 85 | if( zSql==0 ) fossil_fatal("out of memory"); |
| 86 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 87 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 88 | sqlite3_free(zSql); |
| 89 | sqlite3_finalize(pStmt); |
| 90 | } |
| 91 |
| --- src/bundle.c | |
| +++ src/bundle.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | if( !doInit && file_size(zFile, ExtFILE)<0 ){ |
| 61 | fossil_fatal("no such file: %s", zFile); |
| 62 | } |
| 63 | assert( g.db ); |
| 64 | zSql = sqlite3_mprintf("ATTACH %Q AS %Q", zFile, zBName); |
| 65 | if( zSql==0 ) fossil_panic("out of memory"); |
| 66 | rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg); |
| 67 | sqlite3_free(zSql); |
| 68 | if( rc!=SQLITE_OK || zErrMsg ){ |
| 69 | if( zErrMsg==0 ) zErrMsg = (char*)sqlite3_errmsg(g.db); |
| 70 | fossil_fatal("not a valid bundle: %s", zFile); |
| @@ -73,18 +73,18 @@ | |
| 73 | db_multi_exec(zBundleInit /*works-like:"%w%w"*/, zBName, zBName); |
| 74 | }else{ |
| 75 | sqlite3_stmt *pStmt; |
| 76 | zSql = sqlite3_mprintf("SELECT bcname, bcvalue" |
| 77 | " FROM \"%w\".bconfig", zBName); |
| 78 | if( zSql==0 ) fossil_panic("out of memory"); |
| 79 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 80 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 81 | sqlite3_free(zSql); |
| 82 | sqlite3_finalize(pStmt); |
| 83 | zSql = sqlite3_mprintf("SELECT blobid, uuid, sz, delta, notes, data" |
| 84 | " FROM \"%w\".bblob", zBName); |
| 85 | if( zSql==0 ) fossil_panic("out of memory"); |
| 86 | rc = sqlite3_prepare(g.db, zSql, -1, &pStmt, 0); |
| 87 | if( rc ) fossil_fatal("not a valid bundle: %s", zFile); |
| 88 | sqlite3_free(zSql); |
| 89 | sqlite3_finalize(pStmt); |
| 90 | } |
| 91 |
M
src/db.c
+15
-15
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -488,11 +488,11 @@ | ||
| 488 | 488 | ** Return the rowid of the most recent insert |
| 489 | 489 | */ |
| 490 | 490 | int db_last_insert_rowid(void){ |
| 491 | 491 | i64 x = sqlite3_last_insert_rowid(g.db); |
| 492 | 492 | if( x<0 || x>(i64)2147483647 ){ |
| 493 | - fossil_fatal("rowid out of range (0..2147483647)"); | |
| 493 | + fossil_panic("rowid out of range (0..2147483647)"); | |
| 494 | 494 | } |
| 495 | 495 | return (int)x; |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /* |
| @@ -1030,11 +1030,11 @@ | ||
| 1030 | 1030 | blobSize = blob_size(pKey); |
| 1031 | 1031 | if( blobSize==0 ) return; |
| 1032 | 1032 | fossil_get_page_size(&pageSize); |
| 1033 | 1033 | assert( pageSize>0 ); |
| 1034 | 1034 | if( blobSize>pageSize ){ |
| 1035 | - fossil_fatal("key blob too large: %u versus %u", blobSize, pageSize); | |
| 1035 | + fossil_panic("key blob too large: %u versus %u", blobSize, pageSize); | |
| 1036 | 1036 | } |
| 1037 | 1037 | p = fossil_secure_alloc_page(&n); |
| 1038 | 1038 | assert( p!=NULL ); |
| 1039 | 1039 | assert( n==pageSize ); |
| 1040 | 1040 | assert( n>=blobSize ); |
| @@ -1064,11 +1064,11 @@ | ||
| 1064 | 1064 | size_t blobSize = blob_size(pKey); |
| 1065 | 1065 | if( blobSize==0 ){ |
| 1066 | 1066 | db_unsave_encryption_key(); |
| 1067 | 1067 | }else{ |
| 1068 | 1068 | if( blobSize>savedKeySize ){ |
| 1069 | - fossil_fatal("key blob too large: %u versus %u", | |
| 1069 | + fossil_panic("key blob too large: %u versus %u", | |
| 1070 | 1070 | blobSize, savedKeySize); |
| 1071 | 1071 | } |
| 1072 | 1072 | fossil_secure_zero(zSavedKey, savedKeySize); |
| 1073 | 1073 | memcpy(zSavedKey, blob_str(pKey), blobSize); |
| 1074 | 1074 | } |
| @@ -1094,11 +1094,11 @@ | ||
| 1094 | 1094 | HANDLE hProcess = NULL; |
| 1095 | 1095 | |
| 1096 | 1096 | fossil_get_page_size(&pageSize); |
| 1097 | 1097 | assert( pageSize>0 ); |
| 1098 | 1098 | if( nSize>pageSize ){ |
| 1099 | - fossil_fatal("key too large: %u versus %u", nSize, pageSize); | |
| 1099 | + fossil_panic("key too large: %u versus %u", nSize, pageSize); | |
| 1100 | 1100 | } |
| 1101 | 1101 | p = fossil_secure_alloc_page(&n); |
| 1102 | 1102 | assert( p!=NULL ); |
| 1103 | 1103 | assert( n==pageSize ); |
| 1104 | 1104 | assert( n>=nSize ); |
| @@ -1110,20 +1110,20 @@ | ||
| 1110 | 1110 | if( nRead==nSize ){ |
| 1111 | 1111 | db_unsave_encryption_key(); |
| 1112 | 1112 | zSavedKey = p; |
| 1113 | 1113 | savedKeySize = n; |
| 1114 | 1114 | }else{ |
| 1115 | - fossil_fatal("bad size read, %u out of %u bytes at %p from pid %lu", | |
| 1115 | + fossil_panic("bad size read, %u out of %u bytes at %p from pid %lu", | |
| 1116 | 1116 | nRead, nSize, pAddress, processId); |
| 1117 | 1117 | } |
| 1118 | 1118 | }else{ |
| 1119 | 1119 | CloseHandle(hProcess); |
| 1120 | - fossil_fatal("failed read, %u bytes at %p from pid %lu: %lu", nSize, | |
| 1120 | + fossil_panic("failed read, %u bytes at %p from pid %lu: %lu", nSize, | |
| 1121 | 1121 | pAddress, processId, GetLastError()); |
| 1122 | 1122 | } |
| 1123 | 1123 | }else{ |
| 1124 | - fossil_fatal("failed to open pid %lu: %lu", processId, GetLastError()); | |
| 1124 | + fossil_panic("failed to open pid %lu: %lu", processId, GetLastError()); | |
| 1125 | 1125 | } |
| 1126 | 1126 | } |
| 1127 | 1127 | #endif /* defined(_WIN32) */ |
| 1128 | 1128 | #endif /* USE_SEE */ |
| 1129 | 1129 | |
| @@ -1265,11 +1265,11 @@ | ||
| 1265 | 1265 | ** After calling this routine, db_database_slot(zLabel) should |
| 1266 | 1266 | ** return 0. |
| 1267 | 1267 | */ |
| 1268 | 1268 | void db_set_main_schemaname(sqlite3 *db, const char *zLabel){ |
| 1269 | 1269 | if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){ |
| 1270 | - fossil_fatal("Fossil requires a version of SQLite that supports the " | |
| 1270 | + fossil_panic("Fossil requires a version of SQLite that supports the " | |
| 1271 | 1271 | "SQLITE_DBCONFIG_MAINDBNAME interface."); |
| 1272 | 1272 | } |
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | 1275 | /* |
| @@ -1366,27 +1366,27 @@ | ||
| 1366 | 1366 | } |
| 1367 | 1367 | } |
| 1368 | 1368 | } |
| 1369 | 1369 | if( zHome==0 ){ |
| 1370 | 1370 | if( isOptional ) return 0; |
| 1371 | - fossil_fatal("cannot locate home directory - please set the " | |
| 1371 | + fossil_panic("cannot locate home directory - please set the " | |
| 1372 | 1372 | "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH " |
| 1373 | 1373 | "environment variables"); |
| 1374 | 1374 | } |
| 1375 | 1375 | #else |
| 1376 | 1376 | if( zHome==0 ){ |
| 1377 | 1377 | zHome = fossil_getenv("HOME"); |
| 1378 | 1378 | } |
| 1379 | 1379 | if( zHome==0 ){ |
| 1380 | 1380 | if( isOptional ) return 0; |
| 1381 | - fossil_fatal("cannot locate home directory - please set the " | |
| 1381 | + fossil_panic("cannot locate home directory - please set the " | |
| 1382 | 1382 | "FOSSIL_HOME or HOME environment variables"); |
| 1383 | 1383 | } |
| 1384 | 1384 | #endif |
| 1385 | 1385 | if( file_isdir(zHome, ExtFILE)!=1 ){ |
| 1386 | 1386 | if( isOptional ) return 0; |
| 1387 | - fossil_fatal("invalid home directory: %s", zHome); | |
| 1387 | + fossil_panic("invalid home directory: %s", zHome); | |
| 1388 | 1388 | } |
| 1389 | 1389 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 1390 | 1390 | /* . filenames give some window systems problems and many apps problems */ |
| 1391 | 1391 | zDbName = mprintf("%//_fossil", zHome); |
| 1392 | 1392 | #else |
| @@ -1393,17 +1393,17 @@ | ||
| 1393 | 1393 | zDbName = mprintf("%s/.fossil", zHome); |
| 1394 | 1394 | #endif |
| 1395 | 1395 | if( file_size(zDbName, ExtFILE)<1024*3 ){ |
| 1396 | 1396 | if( file_access(zHome, W_OK) ){ |
| 1397 | 1397 | if( isOptional ) return 0; |
| 1398 | - fossil_fatal("home directory %s must be writeable", zHome); | |
| 1398 | + fossil_panic("home directory %s must be writeable", zHome); | |
| 1399 | 1399 | } |
| 1400 | 1400 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 1401 | 1401 | } |
| 1402 | 1402 | if( file_access(zDbName, W_OK) ){ |
| 1403 | 1403 | if( isOptional ) return 0; |
| 1404 | - fossil_fatal("configuration file %s must be writeable", zDbName); | |
| 1404 | + fossil_panic("configuration file %s must be writeable", zDbName); | |
| 1405 | 1405 | } |
| 1406 | 1406 | if( useAttach ){ |
| 1407 | 1407 | db_open_or_attach(zDbName, "configdb"); |
| 1408 | 1408 | g.dbConfig = 0; |
| 1409 | 1409 | }else{ |
| @@ -1680,13 +1680,13 @@ | ||
| 1680 | 1680 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1681 | 1681 | #ifdef FOSSIL_ENABLE_JSON |
| 1682 | 1682 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1683 | 1683 | #endif |
| 1684 | 1684 | if( nArgUsed==0 ){ |
| 1685 | - fossil_fatal("use --repository or -R to specify the repository database"); | |
| 1685 | + fossil_panic("use --repository or -R to specify the repository database"); | |
| 1686 | 1686 | }else{ |
| 1687 | - fossil_fatal("specify the repository name as a command-line argument"); | |
| 1687 | + fossil_panic("specify the repository name as a command-line argument"); | |
| 1688 | 1688 | } |
| 1689 | 1689 | } |
| 1690 | 1690 | } |
| 1691 | 1691 | |
| 1692 | 1692 | /* |
| 1693 | 1693 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -488,11 +488,11 @@ | |
| 488 | ** Return the rowid of the most recent insert |
| 489 | */ |
| 490 | int db_last_insert_rowid(void){ |
| 491 | i64 x = sqlite3_last_insert_rowid(g.db); |
| 492 | if( x<0 || x>(i64)2147483647 ){ |
| 493 | fossil_fatal("rowid out of range (0..2147483647)"); |
| 494 | } |
| 495 | return (int)x; |
| 496 | } |
| 497 | |
| 498 | /* |
| @@ -1030,11 +1030,11 @@ | |
| 1030 | blobSize = blob_size(pKey); |
| 1031 | if( blobSize==0 ) return; |
| 1032 | fossil_get_page_size(&pageSize); |
| 1033 | assert( pageSize>0 ); |
| 1034 | if( blobSize>pageSize ){ |
| 1035 | fossil_fatal("key blob too large: %u versus %u", blobSize, pageSize); |
| 1036 | } |
| 1037 | p = fossil_secure_alloc_page(&n); |
| 1038 | assert( p!=NULL ); |
| 1039 | assert( n==pageSize ); |
| 1040 | assert( n>=blobSize ); |
| @@ -1064,11 +1064,11 @@ | |
| 1064 | size_t blobSize = blob_size(pKey); |
| 1065 | if( blobSize==0 ){ |
| 1066 | db_unsave_encryption_key(); |
| 1067 | }else{ |
| 1068 | if( blobSize>savedKeySize ){ |
| 1069 | fossil_fatal("key blob too large: %u versus %u", |
| 1070 | blobSize, savedKeySize); |
| 1071 | } |
| 1072 | fossil_secure_zero(zSavedKey, savedKeySize); |
| 1073 | memcpy(zSavedKey, blob_str(pKey), blobSize); |
| 1074 | } |
| @@ -1094,11 +1094,11 @@ | |
| 1094 | HANDLE hProcess = NULL; |
| 1095 | |
| 1096 | fossil_get_page_size(&pageSize); |
| 1097 | assert( pageSize>0 ); |
| 1098 | if( nSize>pageSize ){ |
| 1099 | fossil_fatal("key too large: %u versus %u", nSize, pageSize); |
| 1100 | } |
| 1101 | p = fossil_secure_alloc_page(&n); |
| 1102 | assert( p!=NULL ); |
| 1103 | assert( n==pageSize ); |
| 1104 | assert( n>=nSize ); |
| @@ -1110,20 +1110,20 @@ | |
| 1110 | if( nRead==nSize ){ |
| 1111 | db_unsave_encryption_key(); |
| 1112 | zSavedKey = p; |
| 1113 | savedKeySize = n; |
| 1114 | }else{ |
| 1115 | fossil_fatal("bad size read, %u out of %u bytes at %p from pid %lu", |
| 1116 | nRead, nSize, pAddress, processId); |
| 1117 | } |
| 1118 | }else{ |
| 1119 | CloseHandle(hProcess); |
| 1120 | fossil_fatal("failed read, %u bytes at %p from pid %lu: %lu", nSize, |
| 1121 | pAddress, processId, GetLastError()); |
| 1122 | } |
| 1123 | }else{ |
| 1124 | fossil_fatal("failed to open pid %lu: %lu", processId, GetLastError()); |
| 1125 | } |
| 1126 | } |
| 1127 | #endif /* defined(_WIN32) */ |
| 1128 | #endif /* USE_SEE */ |
| 1129 | |
| @@ -1265,11 +1265,11 @@ | |
| 1265 | ** After calling this routine, db_database_slot(zLabel) should |
| 1266 | ** return 0. |
| 1267 | */ |
| 1268 | void db_set_main_schemaname(sqlite3 *db, const char *zLabel){ |
| 1269 | if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){ |
| 1270 | fossil_fatal("Fossil requires a version of SQLite that supports the " |
| 1271 | "SQLITE_DBCONFIG_MAINDBNAME interface."); |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | /* |
| @@ -1366,27 +1366,27 @@ | |
| 1366 | } |
| 1367 | } |
| 1368 | } |
| 1369 | if( zHome==0 ){ |
| 1370 | if( isOptional ) return 0; |
| 1371 | fossil_fatal("cannot locate home directory - please set the " |
| 1372 | "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH " |
| 1373 | "environment variables"); |
| 1374 | } |
| 1375 | #else |
| 1376 | if( zHome==0 ){ |
| 1377 | zHome = fossil_getenv("HOME"); |
| 1378 | } |
| 1379 | if( zHome==0 ){ |
| 1380 | if( isOptional ) return 0; |
| 1381 | fossil_fatal("cannot locate home directory - please set the " |
| 1382 | "FOSSIL_HOME or HOME environment variables"); |
| 1383 | } |
| 1384 | #endif |
| 1385 | if( file_isdir(zHome, ExtFILE)!=1 ){ |
| 1386 | if( isOptional ) return 0; |
| 1387 | fossil_fatal("invalid home directory: %s", zHome); |
| 1388 | } |
| 1389 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 1390 | /* . filenames give some window systems problems and many apps problems */ |
| 1391 | zDbName = mprintf("%//_fossil", zHome); |
| 1392 | #else |
| @@ -1393,17 +1393,17 @@ | |
| 1393 | zDbName = mprintf("%s/.fossil", zHome); |
| 1394 | #endif |
| 1395 | if( file_size(zDbName, ExtFILE)<1024*3 ){ |
| 1396 | if( file_access(zHome, W_OK) ){ |
| 1397 | if( isOptional ) return 0; |
| 1398 | fossil_fatal("home directory %s must be writeable", zHome); |
| 1399 | } |
| 1400 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 1401 | } |
| 1402 | if( file_access(zDbName, W_OK) ){ |
| 1403 | if( isOptional ) return 0; |
| 1404 | fossil_fatal("configuration file %s must be writeable", zDbName); |
| 1405 | } |
| 1406 | if( useAttach ){ |
| 1407 | db_open_or_attach(zDbName, "configdb"); |
| 1408 | g.dbConfig = 0; |
| 1409 | }else{ |
| @@ -1680,13 +1680,13 @@ | |
| 1680 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1681 | #ifdef FOSSIL_ENABLE_JSON |
| 1682 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1683 | #endif |
| 1684 | if( nArgUsed==0 ){ |
| 1685 | fossil_fatal("use --repository or -R to specify the repository database"); |
| 1686 | }else{ |
| 1687 | fossil_fatal("specify the repository name as a command-line argument"); |
| 1688 | } |
| 1689 | } |
| 1690 | } |
| 1691 | |
| 1692 | /* |
| 1693 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -488,11 +488,11 @@ | |
| 488 | ** Return the rowid of the most recent insert |
| 489 | */ |
| 490 | int db_last_insert_rowid(void){ |
| 491 | i64 x = sqlite3_last_insert_rowid(g.db); |
| 492 | if( x<0 || x>(i64)2147483647 ){ |
| 493 | fossil_panic("rowid out of range (0..2147483647)"); |
| 494 | } |
| 495 | return (int)x; |
| 496 | } |
| 497 | |
| 498 | /* |
| @@ -1030,11 +1030,11 @@ | |
| 1030 | blobSize = blob_size(pKey); |
| 1031 | if( blobSize==0 ) return; |
| 1032 | fossil_get_page_size(&pageSize); |
| 1033 | assert( pageSize>0 ); |
| 1034 | if( blobSize>pageSize ){ |
| 1035 | fossil_panic("key blob too large: %u versus %u", blobSize, pageSize); |
| 1036 | } |
| 1037 | p = fossil_secure_alloc_page(&n); |
| 1038 | assert( p!=NULL ); |
| 1039 | assert( n==pageSize ); |
| 1040 | assert( n>=blobSize ); |
| @@ -1064,11 +1064,11 @@ | |
| 1064 | size_t blobSize = blob_size(pKey); |
| 1065 | if( blobSize==0 ){ |
| 1066 | db_unsave_encryption_key(); |
| 1067 | }else{ |
| 1068 | if( blobSize>savedKeySize ){ |
| 1069 | fossil_panic("key blob too large: %u versus %u", |
| 1070 | blobSize, savedKeySize); |
| 1071 | } |
| 1072 | fossil_secure_zero(zSavedKey, savedKeySize); |
| 1073 | memcpy(zSavedKey, blob_str(pKey), blobSize); |
| 1074 | } |
| @@ -1094,11 +1094,11 @@ | |
| 1094 | HANDLE hProcess = NULL; |
| 1095 | |
| 1096 | fossil_get_page_size(&pageSize); |
| 1097 | assert( pageSize>0 ); |
| 1098 | if( nSize>pageSize ){ |
| 1099 | fossil_panic("key too large: %u versus %u", nSize, pageSize); |
| 1100 | } |
| 1101 | p = fossil_secure_alloc_page(&n); |
| 1102 | assert( p!=NULL ); |
| 1103 | assert( n==pageSize ); |
| 1104 | assert( n>=nSize ); |
| @@ -1110,20 +1110,20 @@ | |
| 1110 | if( nRead==nSize ){ |
| 1111 | db_unsave_encryption_key(); |
| 1112 | zSavedKey = p; |
| 1113 | savedKeySize = n; |
| 1114 | }else{ |
| 1115 | fossil_panic("bad size read, %u out of %u bytes at %p from pid %lu", |
| 1116 | nRead, nSize, pAddress, processId); |
| 1117 | } |
| 1118 | }else{ |
| 1119 | CloseHandle(hProcess); |
| 1120 | fossil_panic("failed read, %u bytes at %p from pid %lu: %lu", nSize, |
| 1121 | pAddress, processId, GetLastError()); |
| 1122 | } |
| 1123 | }else{ |
| 1124 | fossil_panic("failed to open pid %lu: %lu", processId, GetLastError()); |
| 1125 | } |
| 1126 | } |
| 1127 | #endif /* defined(_WIN32) */ |
| 1128 | #endif /* USE_SEE */ |
| 1129 | |
| @@ -1265,11 +1265,11 @@ | |
| 1265 | ** After calling this routine, db_database_slot(zLabel) should |
| 1266 | ** return 0. |
| 1267 | */ |
| 1268 | void db_set_main_schemaname(sqlite3 *db, const char *zLabel){ |
| 1269 | if( sqlite3_db_config(db, SQLITE_DBCONFIG_MAINDBNAME, zLabel) ){ |
| 1270 | fossil_panic("Fossil requires a version of SQLite that supports the " |
| 1271 | "SQLITE_DBCONFIG_MAINDBNAME interface."); |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | /* |
| @@ -1366,27 +1366,27 @@ | |
| 1366 | } |
| 1367 | } |
| 1368 | } |
| 1369 | if( zHome==0 ){ |
| 1370 | if( isOptional ) return 0; |
| 1371 | fossil_panic("cannot locate home directory - please set the " |
| 1372 | "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH " |
| 1373 | "environment variables"); |
| 1374 | } |
| 1375 | #else |
| 1376 | if( zHome==0 ){ |
| 1377 | zHome = fossil_getenv("HOME"); |
| 1378 | } |
| 1379 | if( zHome==0 ){ |
| 1380 | if( isOptional ) return 0; |
| 1381 | fossil_panic("cannot locate home directory - please set the " |
| 1382 | "FOSSIL_HOME or HOME environment variables"); |
| 1383 | } |
| 1384 | #endif |
| 1385 | if( file_isdir(zHome, ExtFILE)!=1 ){ |
| 1386 | if( isOptional ) return 0; |
| 1387 | fossil_panic("invalid home directory: %s", zHome); |
| 1388 | } |
| 1389 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 1390 | /* . filenames give some window systems problems and many apps problems */ |
| 1391 | zDbName = mprintf("%//_fossil", zHome); |
| 1392 | #else |
| @@ -1393,17 +1393,17 @@ | |
| 1393 | zDbName = mprintf("%s/.fossil", zHome); |
| 1394 | #endif |
| 1395 | if( file_size(zDbName, ExtFILE)<1024*3 ){ |
| 1396 | if( file_access(zHome, W_OK) ){ |
| 1397 | if( isOptional ) return 0; |
| 1398 | fossil_panic("home directory %s must be writeable", zHome); |
| 1399 | } |
| 1400 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 1401 | } |
| 1402 | if( file_access(zDbName, W_OK) ){ |
| 1403 | if( isOptional ) return 0; |
| 1404 | fossil_panic("configuration file %s must be writeable", zDbName); |
| 1405 | } |
| 1406 | if( useAttach ){ |
| 1407 | db_open_or_attach(zDbName, "configdb"); |
| 1408 | g.dbConfig = 0; |
| 1409 | }else{ |
| @@ -1680,13 +1680,13 @@ | |
| 1680 | if( (bFlags & OPEN_OK_NOT_FOUND)==0 ){ |
| 1681 | #ifdef FOSSIL_ENABLE_JSON |
| 1682 | g.json.resultCode = FSL_JSON_E_DB_NOT_FOUND; |
| 1683 | #endif |
| 1684 | if( nArgUsed==0 ){ |
| 1685 | fossil_panic("use --repository or -R to specify the repository database"); |
| 1686 | }else{ |
| 1687 | fossil_panic("specify the repository name as a command-line argument"); |
| 1688 | } |
| 1689 | } |
| 1690 | } |
| 1691 | |
| 1692 | /* |
| 1693 |
+1
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -167,11 +167,11 @@ | ||
| 167 | 167 | zQ = &z[i+1]; |
| 168 | 168 | }else{ |
| 169 | 169 | zQ = &z[i]; |
| 170 | 170 | } |
| 171 | 171 | if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){ |
| 172 | - fossil_fatal("\"%s\" aliased to \"%s\" but \"%s\" does not exist", | |
| 172 | + fossil_panic("\"%s\" aliased to \"%s\" but \"%s\" does not exist", | |
| 173 | 173 | zName, z, z); |
| 174 | 174 | } |
| 175 | 175 | z = zQ; |
| 176 | 176 | while( *z ){ |
| 177 | 177 | char *zName = z; |
| 178 | 178 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -167,11 +167,11 @@ | |
| 167 | zQ = &z[i+1]; |
| 168 | }else{ |
| 169 | zQ = &z[i]; |
| 170 | } |
| 171 | if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){ |
| 172 | fossil_fatal("\"%s\" aliased to \"%s\" but \"%s\" does not exist", |
| 173 | zName, z, z); |
| 174 | } |
| 175 | z = zQ; |
| 176 | while( *z ){ |
| 177 | char *zName = z; |
| 178 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -167,11 +167,11 @@ | |
| 167 | zQ = &z[i+1]; |
| 168 | }else{ |
| 169 | zQ = &z[i]; |
| 170 | } |
| 171 | if( dispatch_name_search(z, CMDFLAG_WEBPAGE, ppCmd) ){ |
| 172 | fossil_panic("\"%s\" aliased to \"%s\" but \"%s\" does not exist", |
| 173 | zName, z, z); |
| 174 | } |
| 175 | z = zQ; |
| 176 | while( *z ){ |
| 177 | char *zName = z; |
| 178 |
+1
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -298,11 +298,11 @@ | ||
| 298 | 298 | */ |
| 299 | 299 | static void mimetype_verify(void){ |
| 300 | 300 | int i; |
| 301 | 301 | for(i=1; i<count(aMime); i++){ |
| 302 | 302 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 303 | - fossil_fatal("mimetypes out of sequence: %s before %s", | |
| 303 | + fossil_panic("mimetypes out of sequence: %s before %s", | |
| 304 | 304 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -298,11 +298,11 @@ | |
| 298 | */ |
| 299 | static void mimetype_verify(void){ |
| 300 | int i; |
| 301 | for(i=1; i<count(aMime); i++){ |
| 302 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 303 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 304 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -298,11 +298,11 @@ | |
| 298 | */ |
| 299 | static void mimetype_verify(void){ |
| 300 | int i; |
| 301 | for(i=1; i<count(aMime); i++){ |
| 302 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 303 | fossil_panic("mimetypes out of sequence: %s before %s", |
| 304 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 |
+1
-1
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -587,9 +587,9 @@ | ||
| 587 | 587 | if (event_commit_common(rid, zId, blob_str(pContent), zETime, |
| 588 | 588 | zMimeType, zComment, zTags, zClr)==0 ){ |
| 589 | 589 | #ifdef FOSSIL_ENABLE_JSON |
| 590 | 590 | g.json.resultCode = FSL_JSON_E_ASSERT; |
| 591 | 591 | #endif |
| 592 | - fossil_fatal("Internal error: Fossil tried to make an " | |
| 592 | + fossil_panic("Internal error: Fossil tried to make an " | |
| 593 | 593 | "invalid artifact for the technote."); |
| 594 | 594 | } |
| 595 | 595 | } |
| 596 | 596 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -587,9 +587,9 @@ | |
| 587 | if (event_commit_common(rid, zId, blob_str(pContent), zETime, |
| 588 | zMimeType, zComment, zTags, zClr)==0 ){ |
| 589 | #ifdef FOSSIL_ENABLE_JSON |
| 590 | g.json.resultCode = FSL_JSON_E_ASSERT; |
| 591 | #endif |
| 592 | fossil_fatal("Internal error: Fossil tried to make an " |
| 593 | "invalid artifact for the technote."); |
| 594 | } |
| 595 | } |
| 596 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -587,9 +587,9 @@ | |
| 587 | if (event_commit_common(rid, zId, blob_str(pContent), zETime, |
| 588 | zMimeType, zComment, zTags, zClr)==0 ){ |
| 589 | #ifdef FOSSIL_ENABLE_JSON |
| 590 | g.json.resultCode = FSL_JSON_E_ASSERT; |
| 591 | #endif |
| 592 | fossil_panic("Internal error: Fossil tried to make an " |
| 593 | "invalid artifact for the technote."); |
| 594 | } |
| 595 | } |
| 596 |
+2
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -896,13 +896,13 @@ | ||
| 896 | 896 | #ifdef _WIN32 |
| 897 | 897 | win32_getcwd(zBuf, nBuf); |
| 898 | 898 | #else |
| 899 | 899 | if( getcwd(zBuf, nBuf-1)==0 ){ |
| 900 | 900 | if( errno==ERANGE ){ |
| 901 | - fossil_fatal("pwd too big: max %d", nBuf-1); | |
| 901 | + fossil_panic("pwd too big: max %d", nBuf-1); | |
| 902 | 902 | }else{ |
| 903 | - fossil_fatal("cannot find current working directory; %s", | |
| 903 | + fossil_panic("cannot find current working directory; %s", | |
| 904 | 904 | strerror(errno)); |
| 905 | 905 | } |
| 906 | 906 | } |
| 907 | 907 | #endif |
| 908 | 908 | } |
| 909 | 909 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -896,13 +896,13 @@ | |
| 896 | #ifdef _WIN32 |
| 897 | win32_getcwd(zBuf, nBuf); |
| 898 | #else |
| 899 | if( getcwd(zBuf, nBuf-1)==0 ){ |
| 900 | if( errno==ERANGE ){ |
| 901 | fossil_fatal("pwd too big: max %d", nBuf-1); |
| 902 | }else{ |
| 903 | fossil_fatal("cannot find current working directory; %s", |
| 904 | strerror(errno)); |
| 905 | } |
| 906 | } |
| 907 | #endif |
| 908 | } |
| 909 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -896,13 +896,13 @@ | |
| 896 | #ifdef _WIN32 |
| 897 | win32_getcwd(zBuf, nBuf); |
| 898 | #else |
| 899 | if( getcwd(zBuf, nBuf-1)==0 ){ |
| 900 | if( errno==ERANGE ){ |
| 901 | fossil_panic("pwd too big: max %d", nBuf-1); |
| 902 | }else{ |
| 903 | fossil_panic("cannot find current working directory; %s", |
| 904 | strerror(errno)); |
| 905 | } |
| 906 | } |
| 907 | #endif |
| 908 | } |
| 909 |
+3
-3
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -111,11 +111,11 @@ | ||
| 111 | 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| 112 | 112 | }else{ |
| 113 | 113 | /* User has specified a CA location, make sure it exists and use it */ |
| 114 | 114 | switch( file_isdir(zCaSetting, ExtFILE) ){ |
| 115 | 115 | case 0: { /* doesn't exist */ |
| 116 | - fossil_fatal("ssl-ca-location is set to '%s', " | |
| 116 | + fossil_panic("ssl-ca-location is set to '%s', " | |
| 117 | 117 | "but is not a file or directory", zCaSetting); |
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | case 1: { /* directory */ |
| 121 | 121 | zCaDirectory = zCaSetting; |
| @@ -125,11 +125,11 @@ | ||
| 125 | 125 | zCaFile = zCaSetting; |
| 126 | 126 | break; |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | - fossil_fatal("Failed to use CA root certificates from " | |
| 130 | + fossil_panic("Failed to use CA root certificates from " | |
| 131 | 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /* Load client SSL identity, preferring the filename specified on the |
| @@ -141,11 +141,11 @@ | ||
| 141 | 141 | } |
| 142 | 142 | if( identityFile!=0 && identityFile[0]!='\0' ){ |
| 143 | 143 | if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 144 | 144 | || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 145 | 145 | ){ |
| 146 | - fossil_fatal("Could not load SSL identity from %s", identityFile); | |
| 146 | + fossil_panic("Could not load SSL identity from %s", identityFile); | |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | /* Register a callback to tell the user what to do when the server asks |
| 150 | 150 | ** for a cert */ |
| 151 | 151 | SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback); |
| 152 | 152 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -111,11 +111,11 @@ | |
| 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| 112 | }else{ |
| 113 | /* User has specified a CA location, make sure it exists and use it */ |
| 114 | switch( file_isdir(zCaSetting, ExtFILE) ){ |
| 115 | case 0: { /* doesn't exist */ |
| 116 | fossil_fatal("ssl-ca-location is set to '%s', " |
| 117 | "but is not a file or directory", zCaSetting); |
| 118 | break; |
| 119 | } |
| 120 | case 1: { /* directory */ |
| 121 | zCaDirectory = zCaSetting; |
| @@ -125,11 +125,11 @@ | |
| 125 | zCaFile = zCaSetting; |
| 126 | break; |
| 127 | } |
| 128 | } |
| 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | fossil_fatal("Failed to use CA root certificates from " |
| 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /* Load client SSL identity, preferring the filename specified on the |
| @@ -141,11 +141,11 @@ | |
| 141 | } |
| 142 | if( identityFile!=0 && identityFile[0]!='\0' ){ |
| 143 | if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 144 | || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 145 | ){ |
| 146 | fossil_fatal("Could not load SSL identity from %s", identityFile); |
| 147 | } |
| 148 | } |
| 149 | /* Register a callback to tell the user what to do when the server asks |
| 150 | ** for a cert */ |
| 151 | SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback); |
| 152 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -111,11 +111,11 @@ | |
| 111 | X509_STORE_set_default_paths(SSL_CTX_get_cert_store(sslCtx)); |
| 112 | }else{ |
| 113 | /* User has specified a CA location, make sure it exists and use it */ |
| 114 | switch( file_isdir(zCaSetting, ExtFILE) ){ |
| 115 | case 0: { /* doesn't exist */ |
| 116 | fossil_panic("ssl-ca-location is set to '%s', " |
| 117 | "but is not a file or directory", zCaSetting); |
| 118 | break; |
| 119 | } |
| 120 | case 1: { /* directory */ |
| 121 | zCaDirectory = zCaSetting; |
| @@ -125,11 +125,11 @@ | |
| 125 | zCaFile = zCaSetting; |
| 126 | break; |
| 127 | } |
| 128 | } |
| 129 | if( SSL_CTX_load_verify_locations(sslCtx, zCaFile, zCaDirectory)==0 ){ |
| 130 | fossil_panic("Failed to use CA root certificates from " |
| 131 | "ssl-ca-location '%s'", zCaSetting); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | /* Load client SSL identity, preferring the filename specified on the |
| @@ -141,11 +141,11 @@ | |
| 141 | } |
| 142 | if( identityFile!=0 && identityFile[0]!='\0' ){ |
| 143 | if( SSL_CTX_use_certificate_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 144 | || SSL_CTX_use_PrivateKey_file(sslCtx,identityFile,SSL_FILETYPE_PEM)!=1 |
| 145 | ){ |
| 146 | fossil_panic("Could not load SSL identity from %s", identityFile); |
| 147 | } |
| 148 | } |
| 149 | /* Register a callback to tell the user what to do when the server asks |
| 150 | ** for a cert */ |
| 151 | SSL_CTX_set_client_cert_cb(sslCtx, ssl_client_cert_callback); |
| 152 |
+3
-3
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -127,19 +127,19 @@ | ||
| 127 | 127 | fossil_free(zHost); |
| 128 | 128 | }else{ |
| 129 | 129 | blob_append_escaped_arg(&zCmd, pUrlData->name); |
| 130 | 130 | } |
| 131 | 131 | if( !is_safe_fossil_command(pUrlData->fossil) ){ |
| 132 | - fossil_fatal("the ssh:// URL is asking to run an unsafe command [%s] on " | |
| 132 | + fossil_panic("the ssh:// URL is asking to run an unsafe command [%s] on " | |
| 133 | 133 | "the server.", pUrlData->fossil); |
| 134 | 134 | } |
| 135 | 135 | blob_append_escaped_arg(&zCmd, pUrlData->fossil); |
| 136 | 136 | blob_append(&zCmd, " test-http", 10); |
| 137 | 137 | if( pUrlData->path && pUrlData->path[0] ){ |
| 138 | 138 | blob_append_escaped_arg(&zCmd, pUrlData->path); |
| 139 | 139 | }else{ |
| 140 | - fossil_fatal("ssh:// URI does not specify a path to the repository"); | |
| 140 | + fossil_panic("ssh:// URI does not specify a path to the repository"); | |
| 141 | 141 | } |
| 142 | 142 | if( g.fSshTrace ){ |
| 143 | 143 | fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */ |
| 144 | 144 | } |
| 145 | 145 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | g.zRepositoryName, iRandId); |
| 182 | 182 | transport.zInFile = mprintf("%s-%llu-in.http", |
| 183 | 183 | g.zRepositoryName, iRandId); |
| 184 | 184 | transport.pFile = fossil_fopen(transport.zOutFile, "wb"); |
| 185 | 185 | if( transport.pFile==0 ){ |
| 186 | - fossil_fatal("cannot output temporary file: %s", transport.zOutFile); | |
| 186 | + fossil_panic("cannot output temporary file: %s", transport.zOutFile); | |
| 187 | 187 | } |
| 188 | 188 | transport.isOpen = 1; |
| 189 | 189 | }else{ |
| 190 | 190 | rc = socket_open(pUrlData); |
| 191 | 191 | if( rc==0 ) transport.isOpen = 1; |
| 192 | 192 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -127,19 +127,19 @@ | |
| 127 | fossil_free(zHost); |
| 128 | }else{ |
| 129 | blob_append_escaped_arg(&zCmd, pUrlData->name); |
| 130 | } |
| 131 | if( !is_safe_fossil_command(pUrlData->fossil) ){ |
| 132 | fossil_fatal("the ssh:// URL is asking to run an unsafe command [%s] on " |
| 133 | "the server.", pUrlData->fossil); |
| 134 | } |
| 135 | blob_append_escaped_arg(&zCmd, pUrlData->fossil); |
| 136 | blob_append(&zCmd, " test-http", 10); |
| 137 | if( pUrlData->path && pUrlData->path[0] ){ |
| 138 | blob_append_escaped_arg(&zCmd, pUrlData->path); |
| 139 | }else{ |
| 140 | fossil_fatal("ssh:// URI does not specify a path to the repository"); |
| 141 | } |
| 142 | if( g.fSshTrace ){ |
| 143 | fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */ |
| 144 | } |
| 145 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| @@ -181,11 +181,11 @@ | |
| 181 | g.zRepositoryName, iRandId); |
| 182 | transport.zInFile = mprintf("%s-%llu-in.http", |
| 183 | g.zRepositoryName, iRandId); |
| 184 | transport.pFile = fossil_fopen(transport.zOutFile, "wb"); |
| 185 | if( transport.pFile==0 ){ |
| 186 | fossil_fatal("cannot output temporary file: %s", transport.zOutFile); |
| 187 | } |
| 188 | transport.isOpen = 1; |
| 189 | }else{ |
| 190 | rc = socket_open(pUrlData); |
| 191 | if( rc==0 ) transport.isOpen = 1; |
| 192 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -127,19 +127,19 @@ | |
| 127 | fossil_free(zHost); |
| 128 | }else{ |
| 129 | blob_append_escaped_arg(&zCmd, pUrlData->name); |
| 130 | } |
| 131 | if( !is_safe_fossil_command(pUrlData->fossil) ){ |
| 132 | fossil_panic("the ssh:// URL is asking to run an unsafe command [%s] on " |
| 133 | "the server.", pUrlData->fossil); |
| 134 | } |
| 135 | blob_append_escaped_arg(&zCmd, pUrlData->fossil); |
| 136 | blob_append(&zCmd, " test-http", 10); |
| 137 | if( pUrlData->path && pUrlData->path[0] ){ |
| 138 | blob_append_escaped_arg(&zCmd, pUrlData->path); |
| 139 | }else{ |
| 140 | fossil_panic("ssh:// URI does not specify a path to the repository"); |
| 141 | } |
| 142 | if( g.fSshTrace ){ |
| 143 | fossil_print("%s\n", blob_str(&zCmd)); /* Show the whole SSH command */ |
| 144 | } |
| 145 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| @@ -181,11 +181,11 @@ | |
| 181 | g.zRepositoryName, iRandId); |
| 182 | transport.zInFile = mprintf("%s-%llu-in.http", |
| 183 | g.zRepositoryName, iRandId); |
| 184 | transport.pFile = fossil_fopen(transport.zOutFile, "wb"); |
| 185 | if( transport.pFile==0 ){ |
| 186 | fossil_panic("cannot output temporary file: %s", transport.zOutFile); |
| 187 | } |
| 188 | transport.isOpen = 1; |
| 189 | }else{ |
| 190 | rc = socket_open(pUrlData); |
| 191 | if( rc==0 ) transport.isOpen = 1; |
| 192 |
+1
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -606,11 +606,11 @@ | ||
| 606 | 606 | if( gg.nData ){ |
| 607 | 607 | int got; |
| 608 | 608 | gg.aData = fossil_malloc( gg.nData+1 ); |
| 609 | 609 | got = fread(gg.aData, 1, gg.nData, pIn); |
| 610 | 610 | if( got!=gg.nData ){ |
| 611 | - fossil_fatal("short read: got %d of %d bytes", got, gg.nData); | |
| 611 | + fossil_panic("short read: got %d of %d bytes", got, gg.nData); | |
| 612 | 612 | } |
| 613 | 613 | gg.aData[got] = '\0'; |
| 614 | 614 | if( gg.zComment==0 && |
| 615 | 615 | (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){ |
| 616 | 616 | /* Strip trailing newline, it's appended to the comment. */ |
| 617 | 617 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -606,11 +606,11 @@ | |
| 606 | if( gg.nData ){ |
| 607 | int got; |
| 608 | gg.aData = fossil_malloc( gg.nData+1 ); |
| 609 | got = fread(gg.aData, 1, gg.nData, pIn); |
| 610 | if( got!=gg.nData ){ |
| 611 | fossil_fatal("short read: got %d of %d bytes", got, gg.nData); |
| 612 | } |
| 613 | gg.aData[got] = '\0'; |
| 614 | if( gg.zComment==0 && |
| 615 | (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){ |
| 616 | /* Strip trailing newline, it's appended to the comment. */ |
| 617 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -606,11 +606,11 @@ | |
| 606 | if( gg.nData ){ |
| 607 | int got; |
| 608 | gg.aData = fossil_malloc( gg.nData+1 ); |
| 609 | got = fread(gg.aData, 1, gg.nData, pIn); |
| 610 | if( got!=gg.nData ){ |
| 611 | fossil_panic("short read: got %d of %d bytes", got, gg.nData); |
| 612 | } |
| 613 | gg.aData[got] = '\0'; |
| 614 | if( gg.zComment==0 && |
| 615 | (gg.xFinish==finish_commit || gg.xFinish==finish_tag) ){ |
| 616 | /* Strip trailing newline, it's appended to the comment. */ |
| 617 |
+1
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -996,11 +996,11 @@ | ||
| 996 | 996 | inFile = (0==strcmp("-",jfile)) |
| 997 | 997 | ? stdin |
| 998 | 998 | : fossil_fopen(jfile,"rb"); |
| 999 | 999 | if(!inFile){ |
| 1000 | 1000 | g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED; |
| 1001 | - fossil_fatal("Could not open JSON file [%s].",jfile) | |
| 1001 | + fossil_panic("Could not open JSON file [%s].",jfile) | |
| 1002 | 1002 | /* Does not return. */ |
| 1003 | 1003 | ; |
| 1004 | 1004 | } |
| 1005 | 1005 | cgi_parse_POST_JSON(inFile, 0); |
| 1006 | 1006 | if( stdin != inFile ){ |
| 1007 | 1007 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -996,11 +996,11 @@ | |
| 996 | inFile = (0==strcmp("-",jfile)) |
| 997 | ? stdin |
| 998 | : fossil_fopen(jfile,"rb"); |
| 999 | if(!inFile){ |
| 1000 | g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED; |
| 1001 | fossil_fatal("Could not open JSON file [%s].",jfile) |
| 1002 | /* Does not return. */ |
| 1003 | ; |
| 1004 | } |
| 1005 | cgi_parse_POST_JSON(inFile, 0); |
| 1006 | if( stdin != inFile ){ |
| 1007 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -996,11 +996,11 @@ | |
| 996 | inFile = (0==strcmp("-",jfile)) |
| 997 | ? stdin |
| 998 | : fossil_fopen(jfile,"rb"); |
| 999 | if(!inFile){ |
| 1000 | g.json.resultCode = FSL_JSON_E_FILE_OPEN_FAILED; |
| 1001 | fossil_panic("Could not open JSON file [%s].",jfile) |
| 1002 | /* Does not return. */ |
| 1003 | ; |
| 1004 | } |
| 1005 | cgi_parse_POST_JSON(inFile, 0); |
| 1006 | if( stdin != inFile ){ |
| 1007 |
+2
-2
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -288,15 +288,15 @@ | ||
| 288 | 288 | md5sum_blob(&branch, &mcksum); |
| 289 | 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | 290 | |
| 291 | 291 | brid = content_put(&branch); |
| 292 | 292 | if( brid==0 ){ |
| 293 | - fossil_fatal("Problem committing manifest: %s", g.zErrMsg); | |
| 293 | + fossil_panic("Problem committing manifest: %s", g.zErrMsg); | |
| 294 | 294 | } |
| 295 | 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | 296 | if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){ |
| 297 | - fossil_fatal("%s", g.zErrMsg); | |
| 297 | + fossil_panic("%s", g.zErrMsg); | |
| 298 | 298 | } |
| 299 | 299 | assert( blob_is_reset(&branch) ); |
| 300 | 300 | content_deltify(rootid, &brid, 1, 0); |
| 301 | 301 | if( zNewRid ){ |
| 302 | 302 | *zNewRid = brid; |
| 303 | 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -288,15 +288,15 @@ | |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| 292 | if( brid==0 ){ |
| 293 | fossil_fatal("Problem committing manifest: %s", g.zErrMsg); |
| 294 | } |
| 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){ |
| 297 | fossil_fatal("%s", g.zErrMsg); |
| 298 | } |
| 299 | assert( blob_is_reset(&branch) ); |
| 300 | content_deltify(rootid, &brid, 1, 0); |
| 301 | if( zNewRid ){ |
| 302 | *zNewRid = brid; |
| 303 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -288,15 +288,15 @@ | |
| 288 | md5sum_blob(&branch, &mcksum); |
| 289 | blob_appendf(&branch, "Z %b\n", &mcksum); |
| 290 | |
| 291 | brid = content_put(&branch); |
| 292 | if( brid==0 ){ |
| 293 | fossil_panic("Problem committing manifest: %s", g.zErrMsg); |
| 294 | } |
| 295 | db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", brid); |
| 296 | if( manifest_crosslink(brid, &branch, MC_PERMIT_HOOKS)==0 ){ |
| 297 | fossil_panic("%s", g.zErrMsg); |
| 298 | } |
| 299 | assert( blob_is_reset(&branch) ); |
| 300 | content_deltify(rootid, &brid, 1, 0); |
| 301 | if( zNewRid ){ |
| 302 | *zNewRid = brid; |
| 303 |
+1
-1
| --- src/json_status.c | ||
| +++ src/json_status.c | ||
| @@ -168,11 +168,11 @@ | ||
| 168 | 168 | blob_append(report, zPrefix, nPrefix); |
| 169 | 169 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 170 | 170 | } |
| 171 | 171 | db_finalize(&q); |
| 172 | 172 | if( nErr ){ |
| 173 | - fossil_fatal("aborting due to prior errors"); | |
| 173 | + fossil_panic("aborting due to prior errors"); | |
| 174 | 174 | } |
| 175 | 175 | #endif |
| 176 | 176 | return cson_object_value( oPay ); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 |
| --- src/json_status.c | |
| +++ src/json_status.c | |
| @@ -168,11 +168,11 @@ | |
| 168 | blob_append(report, zPrefix, nPrefix); |
| 169 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 170 | } |
| 171 | db_finalize(&q); |
| 172 | if( nErr ){ |
| 173 | fossil_fatal("aborting due to prior errors"); |
| 174 | } |
| 175 | #endif |
| 176 | return cson_object_value( oPay ); |
| 177 | } |
| 178 | |
| 179 |
| --- src/json_status.c | |
| +++ src/json_status.c | |
| @@ -168,11 +168,11 @@ | |
| 168 | blob_append(report, zPrefix, nPrefix); |
| 169 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 170 | } |
| 171 | db_finalize(&q); |
| 172 | if( nErr ){ |
| 173 | fossil_panic("aborting due to prior errors"); |
| 174 | } |
| 175 | #endif |
| 176 | return cson_object_value( oPay ); |
| 177 | } |
| 178 | |
| 179 |
+17
-17
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -597,11 +597,11 @@ | ||
| 597 | 597 | const CmdOrPage *pCmd = 0; |
| 598 | 598 | int rc; |
| 599 | 599 | |
| 600 | 600 | fossil_limit_memory(1); |
| 601 | 601 | if( sqlite3_libversion_number()<3014000 ){ |
| 602 | - fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0", | |
| 602 | + fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0", | |
| 603 | 603 | sqlite3_libversion()); |
| 604 | 604 | } |
| 605 | 605 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 606 | 606 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 607 | 607 | memset(&g, 0, sizeof(g)); |
| @@ -635,11 +635,11 @@ | ||
| 635 | 635 | if( g.zVfsName ){ |
| 636 | 636 | sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName); |
| 637 | 637 | if( pVfs ){ |
| 638 | 638 | sqlite3_vfs_register(pVfs, 1); |
| 639 | 639 | }else{ |
| 640 | - fossil_fatal("no such VFS: \"%s\"", g.zVfsName); | |
| 640 | + fossil_panic("no such VFS: \"%s\"", g.zVfsName); | |
| 641 | 641 | } |
| 642 | 642 | } |
| 643 | 643 | if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){ |
| 644 | 644 | zCmdName = "cgi"; |
| 645 | 645 | g.isHTTP = 1; |
| @@ -686,11 +686,11 @@ | ||
| 686 | 686 | g.zErrlog = find_option("errorlog", 0, 1); |
| 687 | 687 | fossil_init_flags_from_options(); |
| 688 | 688 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| 689 | 689 | if( find_option("localtime",0,0) ) g.fTimeFormat = 2; |
| 690 | 690 | if( zChdir && file_chdir(zChdir, 0) ){ |
| 691 | - fossil_fatal("unable to change directories to %s", zChdir); | |
| 691 | + fossil_panic("unable to change directories to %s", zChdir); | |
| 692 | 692 | } |
| 693 | 693 | if( find_option("help",0,0)!=0 ){ |
| 694 | 694 | /* If --help is found anywhere on the command line, translate the command |
| 695 | 695 | * to "fossil help cmdname" where "cmdname" is the first argument that |
| 696 | 696 | * does not begin with a "-" character. If all arguments start with "-", |
| @@ -735,11 +735,11 @@ | ||
| 735 | 735 | }while( nTry++ < 2 ); |
| 736 | 736 | if( fd<2 ){ |
| 737 | 737 | g.cgiOutput = 1; |
| 738 | 738 | g.httpOut = stdout; |
| 739 | 739 | g.fullHttpReply = !g.isHTTP; |
| 740 | - fossil_fatal("file descriptor 2 is not open. (fd=%d, errno=%d)", | |
| 740 | + fossil_panic("file descriptor 2 is not open. (fd=%d, errno=%d)", | |
| 741 | 741 | fd, x); |
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | #endif |
| 745 | 745 | rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd); |
| @@ -751,11 +751,11 @@ | ||
| 751 | 751 | rc = TH_OK; |
| 752 | 752 | } |
| 753 | 753 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 754 | 754 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 755 | 755 | #endif |
| 756 | - fossil_fatal("%s: unknown command: %s\n" | |
| 756 | + fossil_panic("%s: unknown command: %s\n" | |
| 757 | 757 | "%s: use \"help\" for more information", |
| 758 | 758 | g.argv[0], zCmdName, g.argv[0]); |
| 759 | 759 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 760 | 760 | } |
| 761 | 761 | if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| @@ -816,11 +816,11 @@ | ||
| 816 | 816 | |
| 817 | 817 | /* |
| 818 | 818 | ** Print a usage comment and quit |
| 819 | 819 | */ |
| 820 | 820 | void usage(const char *zFormat){ |
| 821 | - fossil_fatal("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat); | |
| 821 | + fossil_panic("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat); | |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | 824 | /* |
| 825 | 825 | ** Remove n elements from g.argv beginning with the i-th element. |
| 826 | 826 | */ |
| @@ -934,11 +934,11 @@ | ||
| 934 | 934 | */ |
| 935 | 935 | void verify_all_options(void){ |
| 936 | 936 | int i; |
| 937 | 937 | for(i=1; i<g.argc; i++){ |
| 938 | 938 | if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){ |
| 939 | - fossil_fatal( | |
| 939 | + fossil_panic( | |
| 940 | 940 | "unrecognized command-line option, or missing argument: %s", |
| 941 | 941 | g.argv[i]); |
| 942 | 942 | } |
| 943 | 943 | } |
| 944 | 944 | } |
| @@ -1153,11 +1153,11 @@ | ||
| 1153 | 1153 | g.zHttpsURL = mprintf("https://%s", &g.zTop[7]); |
| 1154 | 1154 | }else if( strncmp(g.zTop, "https://", 8)==0 ){ |
| 1155 | 1155 | /* it is already HTTPS, use it. */ |
| 1156 | 1156 | g.zHttpsURL = mprintf("%s", g.zTop); |
| 1157 | 1157 | }else{ |
| 1158 | - fossil_fatal("argument to --baseurl should be 'http://host/path'" | |
| 1158 | + fossil_panic("argument to --baseurl should be 'http://host/path'" | |
| 1159 | 1159 | " or 'https://host/path'"); |
| 1160 | 1160 | } |
| 1161 | 1161 | for(i=n=0; (c = g.zTop[i])!=0; i++){ |
| 1162 | 1162 | if( c=='/' ){ |
| 1163 | 1163 | n++; |
| @@ -1166,11 +1166,11 @@ | ||
| 1166 | 1166 | break; |
| 1167 | 1167 | } |
| 1168 | 1168 | } |
| 1169 | 1169 | } |
| 1170 | 1170 | if( g.zTop==g.zBaseURL ){ |
| 1171 | - fossil_fatal("argument to --baseurl should be 'http://host/path'" | |
| 1171 | + fossil_panic("argument to --baseurl should be 'http://host/path'" | |
| 1172 | 1172 | " or 'https://host/path'"); |
| 1173 | 1173 | } |
| 1174 | 1174 | if( g.zTop[1]==0 ) g.zTop++; |
| 1175 | 1175 | }else{ |
| 1176 | 1176 | zHost = PD("HTTP_HOST",""); |
| @@ -1237,34 +1237,34 @@ | ||
| 1237 | 1237 | file_canonical_name(zRepo, &dir, 0); |
| 1238 | 1238 | zDir = blob_str(&dir); |
| 1239 | 1239 | if( !noJail ){ |
| 1240 | 1240 | if( file_isdir(zDir, ExtFILE)==1 ){ |
| 1241 | 1241 | if( file_chdir(zDir, 1) ){ |
| 1242 | - fossil_fatal("unable to chroot into %s", zDir); | |
| 1242 | + fossil_panic("unable to chroot into %s", zDir); | |
| 1243 | 1243 | } |
| 1244 | 1244 | g.fJail = 1; |
| 1245 | 1245 | zRepo = "/"; |
| 1246 | 1246 | }else{ |
| 1247 | 1247 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1248 | - if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo); | |
| 1248 | + if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo); | |
| 1249 | 1249 | if( i>0 ){ |
| 1250 | 1250 | zDir[i] = 0; |
| 1251 | 1251 | if( file_chdir(zDir, 1) ){ |
| 1252 | - fossil_fatal("unable to chroot into %s", zDir); | |
| 1252 | + fossil_panic("unable to chroot into %s", zDir); | |
| 1253 | 1253 | } |
| 1254 | 1254 | zDir[i] = '/'; |
| 1255 | 1255 | } |
| 1256 | 1256 | zRepo = &zDir[i]; |
| 1257 | 1257 | } |
| 1258 | 1258 | } |
| 1259 | 1259 | if( stat(zRepo, &sStat)!=0 ){ |
| 1260 | - fossil_fatal("cannot stat() repository: %s", zRepo); | |
| 1260 | + fossil_panic("cannot stat() repository: %s", zRepo); | |
| 1261 | 1261 | } |
| 1262 | 1262 | i = setgid(sStat.st_gid); |
| 1263 | 1263 | i = i || setuid(sStat.st_uid); |
| 1264 | 1264 | if(i){ |
| 1265 | - fossil_fatal("setgid/uid() failed with errno %d", errno); | |
| 1265 | + fossil_panic("setgid/uid() failed with errno %d", errno); | |
| 1266 | 1266 | } |
| 1267 | 1267 | if( g.db==0 && file_isfile(zRepo, ExtFILE) ){ |
| 1268 | 1268 | db_open_repository(zRepo); |
| 1269 | 1269 | } |
| 1270 | 1270 | } |
| @@ -2227,11 +2227,11 @@ | ||
| 2227 | 2227 | ){ |
| 2228 | 2228 | unsigned int nSize = 0; |
| 2229 | 2229 | if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){ |
| 2230 | 2230 | *pnSize = (SIZE_T)nSize; |
| 2231 | 2231 | }else{ |
| 2232 | - fossil_fatal("failed to parse pid key"); | |
| 2232 | + fossil_panic("failed to parse pid key"); | |
| 2233 | 2233 | } |
| 2234 | 2234 | } |
| 2235 | 2235 | #endif |
| 2236 | 2236 | |
| 2237 | 2237 | /* |
| @@ -2348,11 +2348,11 @@ | ||
| 2348 | 2348 | |
| 2349 | 2349 | /* We should be done with options.. */ |
| 2350 | 2350 | verify_all_options(); |
| 2351 | 2351 | |
| 2352 | 2352 | if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ |
| 2353 | - fossil_fatal("no repository specified"); | |
| 2353 | + fossil_panic("no repository specified"); | |
| 2354 | 2354 | } |
| 2355 | 2355 | g.cgiOutput = 1; |
| 2356 | 2356 | g.fullHttpReply = 1; |
| 2357 | 2357 | if( g.argc>=5 ){ |
| 2358 | 2358 | g.httpIn = fossil_fopen(g.argv[2], "rb"); |
| @@ -2675,11 +2675,11 @@ | ||
| 2675 | 2675 | } |
| 2676 | 2676 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2677 | 2677 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2678 | 2678 | db_close(1); |
| 2679 | 2679 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2680 | - fossil_fatal("unable to listen on TCP socket %d", iPort); | |
| 2680 | + fossil_panic("unable to listen on TCP socket %d", iPort); | |
| 2681 | 2681 | } |
| 2682 | 2682 | if( zMaxLatency ){ |
| 2683 | 2683 | signal(SIGALRM, sigalrm_handler); |
| 2684 | 2684 | alarm(atoi(zMaxLatency)); |
| 2685 | 2685 | } |
| 2686 | 2686 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -597,11 +597,11 @@ | |
| 597 | const CmdOrPage *pCmd = 0; |
| 598 | int rc; |
| 599 | |
| 600 | fossil_limit_memory(1); |
| 601 | if( sqlite3_libversion_number()<3014000 ){ |
| 602 | fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0", |
| 603 | sqlite3_libversion()); |
| 604 | } |
| 605 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 606 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 607 | memset(&g, 0, sizeof(g)); |
| @@ -635,11 +635,11 @@ | |
| 635 | if( g.zVfsName ){ |
| 636 | sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName); |
| 637 | if( pVfs ){ |
| 638 | sqlite3_vfs_register(pVfs, 1); |
| 639 | }else{ |
| 640 | fossil_fatal("no such VFS: \"%s\"", g.zVfsName); |
| 641 | } |
| 642 | } |
| 643 | if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){ |
| 644 | zCmdName = "cgi"; |
| 645 | g.isHTTP = 1; |
| @@ -686,11 +686,11 @@ | |
| 686 | g.zErrlog = find_option("errorlog", 0, 1); |
| 687 | fossil_init_flags_from_options(); |
| 688 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| 689 | if( find_option("localtime",0,0) ) g.fTimeFormat = 2; |
| 690 | if( zChdir && file_chdir(zChdir, 0) ){ |
| 691 | fossil_fatal("unable to change directories to %s", zChdir); |
| 692 | } |
| 693 | if( find_option("help",0,0)!=0 ){ |
| 694 | /* If --help is found anywhere on the command line, translate the command |
| 695 | * to "fossil help cmdname" where "cmdname" is the first argument that |
| 696 | * does not begin with a "-" character. If all arguments start with "-", |
| @@ -735,11 +735,11 @@ | |
| 735 | }while( nTry++ < 2 ); |
| 736 | if( fd<2 ){ |
| 737 | g.cgiOutput = 1; |
| 738 | g.httpOut = stdout; |
| 739 | g.fullHttpReply = !g.isHTTP; |
| 740 | fossil_fatal("file descriptor 2 is not open. (fd=%d, errno=%d)", |
| 741 | fd, x); |
| 742 | } |
| 743 | } |
| 744 | #endif |
| 745 | rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd); |
| @@ -751,11 +751,11 @@ | |
| 751 | rc = TH_OK; |
| 752 | } |
| 753 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 754 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 755 | #endif |
| 756 | fossil_fatal("%s: unknown command: %s\n" |
| 757 | "%s: use \"help\" for more information", |
| 758 | g.argv[0], zCmdName, g.argv[0]); |
| 759 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 760 | } |
| 761 | if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| @@ -816,11 +816,11 @@ | |
| 816 | |
| 817 | /* |
| 818 | ** Print a usage comment and quit |
| 819 | */ |
| 820 | void usage(const char *zFormat){ |
| 821 | fossil_fatal("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat); |
| 822 | } |
| 823 | |
| 824 | /* |
| 825 | ** Remove n elements from g.argv beginning with the i-th element. |
| 826 | */ |
| @@ -934,11 +934,11 @@ | |
| 934 | */ |
| 935 | void verify_all_options(void){ |
| 936 | int i; |
| 937 | for(i=1; i<g.argc; i++){ |
| 938 | if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){ |
| 939 | fossil_fatal( |
| 940 | "unrecognized command-line option, or missing argument: %s", |
| 941 | g.argv[i]); |
| 942 | } |
| 943 | } |
| 944 | } |
| @@ -1153,11 +1153,11 @@ | |
| 1153 | g.zHttpsURL = mprintf("https://%s", &g.zTop[7]); |
| 1154 | }else if( strncmp(g.zTop, "https://", 8)==0 ){ |
| 1155 | /* it is already HTTPS, use it. */ |
| 1156 | g.zHttpsURL = mprintf("%s", g.zTop); |
| 1157 | }else{ |
| 1158 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1159 | " or 'https://host/path'"); |
| 1160 | } |
| 1161 | for(i=n=0; (c = g.zTop[i])!=0; i++){ |
| 1162 | if( c=='/' ){ |
| 1163 | n++; |
| @@ -1166,11 +1166,11 @@ | |
| 1166 | break; |
| 1167 | } |
| 1168 | } |
| 1169 | } |
| 1170 | if( g.zTop==g.zBaseURL ){ |
| 1171 | fossil_fatal("argument to --baseurl should be 'http://host/path'" |
| 1172 | " or 'https://host/path'"); |
| 1173 | } |
| 1174 | if( g.zTop[1]==0 ) g.zTop++; |
| 1175 | }else{ |
| 1176 | zHost = PD("HTTP_HOST",""); |
| @@ -1237,34 +1237,34 @@ | |
| 1237 | file_canonical_name(zRepo, &dir, 0); |
| 1238 | zDir = blob_str(&dir); |
| 1239 | if( !noJail ){ |
| 1240 | if( file_isdir(zDir, ExtFILE)==1 ){ |
| 1241 | if( file_chdir(zDir, 1) ){ |
| 1242 | fossil_fatal("unable to chroot into %s", zDir); |
| 1243 | } |
| 1244 | g.fJail = 1; |
| 1245 | zRepo = "/"; |
| 1246 | }else{ |
| 1247 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1248 | if( zDir[i]!='/' ) fossil_fatal("bad repository name: %s", zRepo); |
| 1249 | if( i>0 ){ |
| 1250 | zDir[i] = 0; |
| 1251 | if( file_chdir(zDir, 1) ){ |
| 1252 | fossil_fatal("unable to chroot into %s", zDir); |
| 1253 | } |
| 1254 | zDir[i] = '/'; |
| 1255 | } |
| 1256 | zRepo = &zDir[i]; |
| 1257 | } |
| 1258 | } |
| 1259 | if( stat(zRepo, &sStat)!=0 ){ |
| 1260 | fossil_fatal("cannot stat() repository: %s", zRepo); |
| 1261 | } |
| 1262 | i = setgid(sStat.st_gid); |
| 1263 | i = i || setuid(sStat.st_uid); |
| 1264 | if(i){ |
| 1265 | fossil_fatal("setgid/uid() failed with errno %d", errno); |
| 1266 | } |
| 1267 | if( g.db==0 && file_isfile(zRepo, ExtFILE) ){ |
| 1268 | db_open_repository(zRepo); |
| 1269 | } |
| 1270 | } |
| @@ -2227,11 +2227,11 @@ | |
| 2227 | ){ |
| 2228 | unsigned int nSize = 0; |
| 2229 | if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){ |
| 2230 | *pnSize = (SIZE_T)nSize; |
| 2231 | }else{ |
| 2232 | fossil_fatal("failed to parse pid key"); |
| 2233 | } |
| 2234 | } |
| 2235 | #endif |
| 2236 | |
| 2237 | /* |
| @@ -2348,11 +2348,11 @@ | |
| 2348 | |
| 2349 | /* We should be done with options.. */ |
| 2350 | verify_all_options(); |
| 2351 | |
| 2352 | if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ |
| 2353 | fossil_fatal("no repository specified"); |
| 2354 | } |
| 2355 | g.cgiOutput = 1; |
| 2356 | g.fullHttpReply = 1; |
| 2357 | if( g.argc>=5 ){ |
| 2358 | g.httpIn = fossil_fopen(g.argv[2], "rb"); |
| @@ -2675,11 +2675,11 @@ | |
| 2675 | } |
| 2676 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2677 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2678 | db_close(1); |
| 2679 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2680 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2681 | } |
| 2682 | if( zMaxLatency ){ |
| 2683 | signal(SIGALRM, sigalrm_handler); |
| 2684 | alarm(atoi(zMaxLatency)); |
| 2685 | } |
| 2686 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -597,11 +597,11 @@ | |
| 597 | const CmdOrPage *pCmd = 0; |
| 598 | int rc; |
| 599 | |
| 600 | fossil_limit_memory(1); |
| 601 | if( sqlite3_libversion_number()<3014000 ){ |
| 602 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.14.0", |
| 603 | sqlite3_libversion()); |
| 604 | } |
| 605 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 606 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 607 | memset(&g, 0, sizeof(g)); |
| @@ -635,11 +635,11 @@ | |
| 635 | if( g.zVfsName ){ |
| 636 | sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName); |
| 637 | if( pVfs ){ |
| 638 | sqlite3_vfs_register(pVfs, 1); |
| 639 | }else{ |
| 640 | fossil_panic("no such VFS: \"%s\"", g.zVfsName); |
| 641 | } |
| 642 | } |
| 643 | if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){ |
| 644 | zCmdName = "cgi"; |
| 645 | g.isHTTP = 1; |
| @@ -686,11 +686,11 @@ | |
| 686 | g.zErrlog = find_option("errorlog", 0, 1); |
| 687 | fossil_init_flags_from_options(); |
| 688 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| 689 | if( find_option("localtime",0,0) ) g.fTimeFormat = 2; |
| 690 | if( zChdir && file_chdir(zChdir, 0) ){ |
| 691 | fossil_panic("unable to change directories to %s", zChdir); |
| 692 | } |
| 693 | if( find_option("help",0,0)!=0 ){ |
| 694 | /* If --help is found anywhere on the command line, translate the command |
| 695 | * to "fossil help cmdname" where "cmdname" is the first argument that |
| 696 | * does not begin with a "-" character. If all arguments start with "-", |
| @@ -735,11 +735,11 @@ | |
| 735 | }while( nTry++ < 2 ); |
| 736 | if( fd<2 ){ |
| 737 | g.cgiOutput = 1; |
| 738 | g.httpOut = stdout; |
| 739 | g.fullHttpReply = !g.isHTTP; |
| 740 | fossil_panic("file descriptor 2 is not open. (fd=%d, errno=%d)", |
| 741 | fd, x); |
| 742 | } |
| 743 | } |
| 744 | #endif |
| 745 | rc = dispatch_name_search(zCmdName, CMDFLAG_COMMAND|CMDFLAG_PREFIX, &pCmd); |
| @@ -751,11 +751,11 @@ | |
| 751 | rc = TH_OK; |
| 752 | } |
| 753 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 754 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 755 | #endif |
| 756 | fossil_panic("%s: unknown command: %s\n" |
| 757 | "%s: use \"help\" for more information", |
| 758 | g.argv[0], zCmdName, g.argv[0]); |
| 759 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 760 | } |
| 761 | if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| @@ -816,11 +816,11 @@ | |
| 816 | |
| 817 | /* |
| 818 | ** Print a usage comment and quit |
| 819 | */ |
| 820 | void usage(const char *zFormat){ |
| 821 | fossil_panic("Usage: %s %s %s", g.argv[0], g.argv[1], zFormat); |
| 822 | } |
| 823 | |
| 824 | /* |
| 825 | ** Remove n elements from g.argv beginning with the i-th element. |
| 826 | */ |
| @@ -934,11 +934,11 @@ | |
| 934 | */ |
| 935 | void verify_all_options(void){ |
| 936 | int i; |
| 937 | for(i=1; i<g.argc; i++){ |
| 938 | if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){ |
| 939 | fossil_panic( |
| 940 | "unrecognized command-line option, or missing argument: %s", |
| 941 | g.argv[i]); |
| 942 | } |
| 943 | } |
| 944 | } |
| @@ -1153,11 +1153,11 @@ | |
| 1153 | g.zHttpsURL = mprintf("https://%s", &g.zTop[7]); |
| 1154 | }else if( strncmp(g.zTop, "https://", 8)==0 ){ |
| 1155 | /* it is already HTTPS, use it. */ |
| 1156 | g.zHttpsURL = mprintf("%s", g.zTop); |
| 1157 | }else{ |
| 1158 | fossil_panic("argument to --baseurl should be 'http://host/path'" |
| 1159 | " or 'https://host/path'"); |
| 1160 | } |
| 1161 | for(i=n=0; (c = g.zTop[i])!=0; i++){ |
| 1162 | if( c=='/' ){ |
| 1163 | n++; |
| @@ -1166,11 +1166,11 @@ | |
| 1166 | break; |
| 1167 | } |
| 1168 | } |
| 1169 | } |
| 1170 | if( g.zTop==g.zBaseURL ){ |
| 1171 | fossil_panic("argument to --baseurl should be 'http://host/path'" |
| 1172 | " or 'https://host/path'"); |
| 1173 | } |
| 1174 | if( g.zTop[1]==0 ) g.zTop++; |
| 1175 | }else{ |
| 1176 | zHost = PD("HTTP_HOST",""); |
| @@ -1237,34 +1237,34 @@ | |
| 1237 | file_canonical_name(zRepo, &dir, 0); |
| 1238 | zDir = blob_str(&dir); |
| 1239 | if( !noJail ){ |
| 1240 | if( file_isdir(zDir, ExtFILE)==1 ){ |
| 1241 | if( file_chdir(zDir, 1) ){ |
| 1242 | fossil_panic("unable to chroot into %s", zDir); |
| 1243 | } |
| 1244 | g.fJail = 1; |
| 1245 | zRepo = "/"; |
| 1246 | }else{ |
| 1247 | for(i=strlen(zDir)-1; i>0 && zDir[i]!='/'; i--){} |
| 1248 | if( zDir[i]!='/' ) fossil_panic("bad repository name: %s", zRepo); |
| 1249 | if( i>0 ){ |
| 1250 | zDir[i] = 0; |
| 1251 | if( file_chdir(zDir, 1) ){ |
| 1252 | fossil_panic("unable to chroot into %s", zDir); |
| 1253 | } |
| 1254 | zDir[i] = '/'; |
| 1255 | } |
| 1256 | zRepo = &zDir[i]; |
| 1257 | } |
| 1258 | } |
| 1259 | if( stat(zRepo, &sStat)!=0 ){ |
| 1260 | fossil_panic("cannot stat() repository: %s", zRepo); |
| 1261 | } |
| 1262 | i = setgid(sStat.st_gid); |
| 1263 | i = i || setuid(sStat.st_uid); |
| 1264 | if(i){ |
| 1265 | fossil_panic("setgid/uid() failed with errno %d", errno); |
| 1266 | } |
| 1267 | if( g.db==0 && file_isfile(zRepo, ExtFILE) ){ |
| 1268 | db_open_repository(zRepo); |
| 1269 | } |
| 1270 | } |
| @@ -2227,11 +2227,11 @@ | |
| 2227 | ){ |
| 2228 | unsigned int nSize = 0; |
| 2229 | if( sscanf(zPidKey, "%lu:%p:%u", pProcessId, ppAddress, &nSize)==3 ){ |
| 2230 | *pnSize = (SIZE_T)nSize; |
| 2231 | }else{ |
| 2232 | fossil_panic("failed to parse pid key"); |
| 2233 | } |
| 2234 | } |
| 2235 | #endif |
| 2236 | |
| 2237 | /* |
| @@ -2348,11 +2348,11 @@ | |
| 2348 | |
| 2349 | /* We should be done with options.. */ |
| 2350 | verify_all_options(); |
| 2351 | |
| 2352 | if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ |
| 2353 | fossil_panic("no repository specified"); |
| 2354 | } |
| 2355 | g.cgiOutput = 1; |
| 2356 | g.fullHttpReply = 1; |
| 2357 | if( g.argc>=5 ){ |
| 2358 | g.httpIn = fossil_fopen(g.argv[2], "rb"); |
| @@ -2675,11 +2675,11 @@ | |
| 2675 | } |
| 2676 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2677 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2678 | db_close(1); |
| 2679 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2680 | fossil_panic("unable to listen on TCP socket %d", iPort); |
| 2681 | } |
| 2682 | if( zMaxLatency ){ |
| 2683 | signal(SIGALRM, sigalrm_handler); |
| 2684 | alarm(atoi(zMaxLatency)); |
| 2685 | } |
| 2686 |
+1
-1
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1059,11 +1059,11 @@ | ||
| 1059 | 1059 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1060 | 1060 | p->rid, rid |
| 1061 | 1061 | ); |
| 1062 | 1062 | return 1; |
| 1063 | 1063 | } |
| 1064 | - fossil_fatal("cannot access baseline manifest %S", p->zBaseline); | |
| 1064 | + fossil_panic("cannot access baseline manifest %S", p->zBaseline); | |
| 1065 | 1065 | } |
| 1066 | 1066 | } |
| 1067 | 1067 | return 0; |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1060 | p->rid, rid |
| 1061 | ); |
| 1062 | return 1; |
| 1063 | } |
| 1064 | fossil_fatal("cannot access baseline manifest %S", p->zBaseline); |
| 1065 | } |
| 1066 | } |
| 1067 | return 0; |
| 1068 | } |
| 1069 | |
| 1070 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1060 | p->rid, rid |
| 1061 | ); |
| 1062 | return 1; |
| 1063 | } |
| 1064 | fossil_panic("cannot access baseline manifest %S", p->zBaseline); |
| 1065 | } |
| 1066 | } |
| 1067 | return 0; |
| 1068 | } |
| 1069 | |
| 1070 |
+1
-1
| --- src/popen.c | ||
| +++ src/popen.c | ||
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | #include <fcntl.h> |
| 26 | 26 | /* |
| 27 | 27 | ** Print a fatal error and quit. |
| 28 | 28 | */ |
| 29 | 29 | static void win32_fatal_error(const char *zMsg){ |
| 30 | - fossil_fatal("%s", zMsg); | |
| 30 | + fossil_panic("%s", zMsg); | |
| 31 | 31 | } |
| 32 | 32 | #else |
| 33 | 33 | #include <signal.h> |
| 34 | 34 | #include <sys/wait.h> |
| 35 | 35 | #endif |
| 36 | 36 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | #include <fcntl.h> |
| 26 | /* |
| 27 | ** Print a fatal error and quit. |
| 28 | */ |
| 29 | static void win32_fatal_error(const char *zMsg){ |
| 30 | fossil_fatal("%s", zMsg); |
| 31 | } |
| 32 | #else |
| 33 | #include <signal.h> |
| 34 | #include <sys/wait.h> |
| 35 | #endif |
| 36 |
| --- src/popen.c | |
| +++ src/popen.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | #include <fcntl.h> |
| 26 | /* |
| 27 | ** Print a fatal error and quit. |
| 28 | */ |
| 29 | static void win32_fatal_error(const char *zMsg){ |
| 30 | fossil_panic("%s", zMsg); |
| 31 | } |
| 32 | #else |
| 33 | #include <signal.h> |
| 34 | #include <sys/wait.h> |
| 35 | #endif |
| 36 |
+6
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -1059,10 +1059,16 @@ | ||
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | /* |
| 1062 | 1062 | ** Print an error message, rollback all databases, and quit. These |
| 1063 | 1063 | ** routines never return. |
| 1064 | +** | |
| 1065 | +** The only different between fossil_fatal() and fossil_panic() is that | |
| 1066 | +** fossil_panic() makes an entry in the error log whereas fossil_fatal() | |
| 1067 | +** does not. If there is not error log, then both routines work the | |
| 1068 | +** same. Hence, the routines are interchangable for commands and only | |
| 1069 | +** make a difference with processing web pages. | |
| 1064 | 1070 | ** |
| 1065 | 1071 | ** Use fossil_fatal() for malformed inputs that should be reported back |
| 1066 | 1072 | ** to the user, but which do not represent a configuration problem or bug. |
| 1067 | 1073 | ** |
| 1068 | 1074 | ** Use fossil_panic() for any kind of error that should be brought to the |
| 1069 | 1075 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -1059,10 +1059,16 @@ | |
| 1059 | } |
| 1060 | |
| 1061 | /* |
| 1062 | ** Print an error message, rollback all databases, and quit. These |
| 1063 | ** routines never return. |
| 1064 | ** |
| 1065 | ** Use fossil_fatal() for malformed inputs that should be reported back |
| 1066 | ** to the user, but which do not represent a configuration problem or bug. |
| 1067 | ** |
| 1068 | ** Use fossil_panic() for any kind of error that should be brought to the |
| 1069 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -1059,10 +1059,16 @@ | |
| 1059 | } |
| 1060 | |
| 1061 | /* |
| 1062 | ** Print an error message, rollback all databases, and quit. These |
| 1063 | ** routines never return. |
| 1064 | ** |
| 1065 | ** The only different between fossil_fatal() and fossil_panic() is that |
| 1066 | ** fossil_panic() makes an entry in the error log whereas fossil_fatal() |
| 1067 | ** does not. If there is not error log, then both routines work the |
| 1068 | ** same. Hence, the routines are interchangable for commands and only |
| 1069 | ** make a difference with processing web pages. |
| 1070 | ** |
| 1071 | ** Use fossil_fatal() for malformed inputs that should be reported back |
| 1072 | ** to the user, but which do not represent a configuration problem or bug. |
| 1073 | ** |
| 1074 | ** Use fossil_panic() for any kind of error that should be brought to the |
| 1075 |
+1
-1
| --- src/purge.c | ||
| +++ src/purge.c | ||
| @@ -122,11 +122,11 @@ | ||
| 122 | 122 | |
| 123 | 123 | /* Make sure we are not removing a manifest that is the baseline of some |
| 124 | 124 | ** manifest that is being left behind. This step is not strictly necessary. |
| 125 | 125 | ** is is just a safety check. */ |
| 126 | 126 | if( purge_baseline_out_from_under_delta(zTab) ){ |
| 127 | - fossil_fatal("attempt to purge a baseline manifest without also purging " | |
| 127 | + fossil_panic("attempt to purge a baseline manifest without also purging " | |
| 128 | 128 | "all of its deltas"); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /* Make sure that no delta that is left behind requires a purged artifact |
| 132 | 132 | ** as its basis. If such artifacts exist, go ahead and undelta them now. |
| 133 | 133 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -122,11 +122,11 @@ | |
| 122 | |
| 123 | /* Make sure we are not removing a manifest that is the baseline of some |
| 124 | ** manifest that is being left behind. This step is not strictly necessary. |
| 125 | ** is is just a safety check. */ |
| 126 | if( purge_baseline_out_from_under_delta(zTab) ){ |
| 127 | fossil_fatal("attempt to purge a baseline manifest without also purging " |
| 128 | "all of its deltas"); |
| 129 | } |
| 130 | |
| 131 | /* Make sure that no delta that is left behind requires a purged artifact |
| 132 | ** as its basis. If such artifacts exist, go ahead and undelta them now. |
| 133 |
| --- src/purge.c | |
| +++ src/purge.c | |
| @@ -122,11 +122,11 @@ | |
| 122 | |
| 123 | /* Make sure we are not removing a manifest that is the baseline of some |
| 124 | ** manifest that is being left behind. This step is not strictly necessary. |
| 125 | ** is is just a safety check. */ |
| 126 | if( purge_baseline_out_from_under_delta(zTab) ){ |
| 127 | fossil_panic("attempt to purge a baseline manifest without also purging " |
| 128 | "all of its deltas"); |
| 129 | } |
| 130 | |
| 131 | /* Make sure that no delta that is left behind requires a purged artifact |
| 132 | ** as its basis. If such artifacts exist, go ahead and undelta them now. |
| 133 |
+1
-1
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -254,11 +254,11 @@ | ||
| 254 | 254 | */ |
| 255 | 255 | const char *skin_detail(const char *zName){ |
| 256 | 256 | struct SkinDetail *pDetail; |
| 257 | 257 | skin_detail_initialize(); |
| 258 | 258 | pDetail = skin_detail_find(zName); |
| 259 | - if( pDetail==0 ) fossil_fatal("no such skin detail: %s", zName); | |
| 259 | + if( pDetail==0 ) fossil_panic("no such skin detail: %s", zName); | |
| 260 | 260 | return pDetail->zValue; |
| 261 | 261 | } |
| 262 | 262 | int skin_detail_boolean(const char *zName){ |
| 263 | 263 | return !is_false(skin_detail(zName)); |
| 264 | 264 | } |
| 265 | 265 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -254,11 +254,11 @@ | |
| 254 | */ |
| 255 | const char *skin_detail(const char *zName){ |
| 256 | struct SkinDetail *pDetail; |
| 257 | skin_detail_initialize(); |
| 258 | pDetail = skin_detail_find(zName); |
| 259 | if( pDetail==0 ) fossil_fatal("no such skin detail: %s", zName); |
| 260 | return pDetail->zValue; |
| 261 | } |
| 262 | int skin_detail_boolean(const char *zName){ |
| 263 | return !is_false(skin_detail(zName)); |
| 264 | } |
| 265 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -254,11 +254,11 @@ | |
| 254 | */ |
| 255 | const char *skin_detail(const char *zName){ |
| 256 | struct SkinDetail *pDetail; |
| 257 | skin_detail_initialize(); |
| 258 | pDetail = skin_detail_find(zName); |
| 259 | if( pDetail==0 ) fossil_panic("no such skin detail: %s", zName); |
| 260 | return pDetail->zValue; |
| 261 | } |
| 262 | int skin_detail_boolean(const char *zName){ |
| 263 | return !is_false(skin_detail(zName)); |
| 264 | } |
| 265 |
+1
-1
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -215,11 +215,11 @@ | ||
| 215 | 215 | *pnKey = (int)strlen(zKey); |
| 216 | 216 | }else{ |
| 217 | 217 | *pnKey = -1; |
| 218 | 218 | } |
| 219 | 219 | }else{ |
| 220 | - fossil_fatal("failed to allocate %u bytes for key", nByte); | |
| 220 | + fossil_panic("failed to allocate %u bytes for key", nByte); | |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | #endif |
| 224 | 224 | |
| 225 | 225 | /* |
| 226 | 226 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | *pnKey = (int)strlen(zKey); |
| 216 | }else{ |
| 217 | *pnKey = -1; |
| 218 | } |
| 219 | }else{ |
| 220 | fossil_fatal("failed to allocate %u bytes for key", nByte); |
| 221 | } |
| 222 | } |
| 223 | #endif |
| 224 | |
| 225 | /* |
| 226 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | *pnKey = (int)strlen(zKey); |
| 216 | }else{ |
| 217 | *pnKey = -1; |
| 218 | } |
| 219 | }else{ |
| 220 | fossil_panic("failed to allocate %u bytes for key", nByte); |
| 221 | } |
| 222 | } |
| 223 | #endif |
| 224 | |
| 225 | /* |
| 226 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -252,11 +252,11 @@ | ||
| 252 | 252 | } |
| 253 | 253 | /* build the string */ |
| 254 | 254 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 255 | 255 | /* this _must_ be right */ |
| 256 | 256 | if(blob_size(&tball.pax) != blen){ |
| 257 | - fossil_fatal("internal error: PAX tar header has bad length"); | |
| 257 | + fossil_panic("internal error: PAX tar header has bad length"); | |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
| 262 | 262 | /* |
| 263 | 263 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -252,11 +252,11 @@ | |
| 252 | } |
| 253 | /* build the string */ |
| 254 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 255 | /* this _must_ be right */ |
| 256 | if(blob_size(&tball.pax) != blen){ |
| 257 | fossil_fatal("internal error: PAX tar header has bad length"); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | |
| 262 | /* |
| 263 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -252,11 +252,11 @@ | |
| 252 | } |
| 253 | /* build the string */ |
| 254 | blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue); |
| 255 | /* this _must_ be right */ |
| 256 | if(blob_size(&tball.pax) != blen){ |
| 257 | fossil_panic("internal error: PAX tar header has bad length"); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | |
| 262 | /* |
| 263 |
+11
-11
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -98,22 +98,22 @@ | ||
| 98 | 98 | assert( pageSize>0 ); |
| 99 | 99 | assert( pageSize%2==0 ); |
| 100 | 100 | #if defined(_WIN32) |
| 101 | 101 | p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); |
| 102 | 102 | if( p==NULL ){ |
| 103 | - fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError()); | |
| 103 | + fossil_panic("VirtualAlloc failed: %lu\n", GetLastError()); | |
| 104 | 104 | } |
| 105 | 105 | if( !VirtualLock(p, pageSize) ){ |
| 106 | - fossil_fatal("VirtualLock failed: %lu\n", GetLastError()); | |
| 106 | + fossil_panic("VirtualLock failed: %lu\n", GetLastError()); | |
| 107 | 107 | } |
| 108 | 108 | #elif defined(USE_MMAN_H) |
| 109 | 109 | p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); |
| 110 | 110 | if( p==MAP_FAILED ){ |
| 111 | - fossil_fatal("mmap failed: %d\n", errno); | |
| 111 | + fossil_panic("mmap failed: %d\n", errno); | |
| 112 | 112 | } |
| 113 | 113 | if( mlock(p, pageSize) ){ |
| 114 | - fossil_fatal("mlock failed: %d\n", errno); | |
| 114 | + fossil_panic("mlock failed: %d\n", errno); | |
| 115 | 115 | } |
| 116 | 116 | #else |
| 117 | 117 | p = fossil_malloc(pageSize); |
| 118 | 118 | #endif |
| 119 | 119 | fossil_secure_zero(p, pageSize); |
| @@ -124,21 +124,21 @@ | ||
| 124 | 124 | if( !p ) return; |
| 125 | 125 | assert( n>0 ); |
| 126 | 126 | fossil_secure_zero(p, n); |
| 127 | 127 | #if defined(_WIN32) |
| 128 | 128 | if( !VirtualUnlock(p, n) ){ |
| 129 | - fossil_fatal("VirtualUnlock failed: %lu\n", GetLastError()); | |
| 129 | + fossil_panic("VirtualUnlock failed: %lu\n", GetLastError()); | |
| 130 | 130 | } |
| 131 | 131 | if( !VirtualFree(p, 0, MEM_RELEASE) ){ |
| 132 | - fossil_fatal("VirtualFree failed: %lu\n", GetLastError()); | |
| 132 | + fossil_panic("VirtualFree failed: %lu\n", GetLastError()); | |
| 133 | 133 | } |
| 134 | 134 | #elif defined(USE_MMAN_H) |
| 135 | 135 | if( munlock(p, n) ){ |
| 136 | - fossil_fatal("munlock failed: %d\n", errno); | |
| 136 | + fossil_panic("munlock failed: %d\n", errno); | |
| 137 | 137 | } |
| 138 | 138 | if( munmap(p, n) ){ |
| 139 | - fossil_fatal("munmap failed: %d\n", errno); | |
| 139 | + fossil_panic("munmap failed: %d\n", errno); | |
| 140 | 140 | } |
| 141 | 141 | #else |
| 142 | 142 | fossil_free(p); |
| 143 | 143 | #endif |
| 144 | 144 | } |
| @@ -322,11 +322,11 @@ | ||
| 322 | 322 | */ |
| 323 | 323 | sqlite3_uint64 fossil_timer_fetch(int timerId){ |
| 324 | 324 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 325 | 325 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 326 | 326 | if( !start->id ){ |
| 327 | - fossil_fatal("Invalid call to fetch a non-allocated " | |
| 327 | + fossil_panic("Invalid call to fetch a non-allocated " | |
| 328 | 328 | "timer (#%d)", timerId); |
| 329 | 329 | /*NOTREACHED*/ |
| 330 | 330 | }else{ |
| 331 | 331 | sqlite3_uint64 eu = 0, es = 0; |
| 332 | 332 | fossil_cpu_times( &eu, &es ); |
| @@ -342,11 +342,11 @@ | ||
| 342 | 342 | */ |
| 343 | 343 | sqlite3_uint64 fossil_timer_reset(int timerId){ |
| 344 | 344 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 345 | 345 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 346 | 346 | if( !start->id ){ |
| 347 | - fossil_fatal("Invalid call to reset a non-allocated " | |
| 347 | + fossil_panic("Invalid call to reset a non-allocated " | |
| 348 | 348 | "timer (#%d)", timerId); |
| 349 | 349 | /*NOTREACHED*/ |
| 350 | 350 | }else{ |
| 351 | 351 | sqlite3_uint64 const rc = fossil_timer_fetch(timerId); |
| 352 | 352 | fossil_cpu_times( &start->u, &start->s ); |
| @@ -520,10 +520,10 @@ | ||
| 520 | 520 | ** On all other platforms, this routine does not exist, but instead |
| 521 | 521 | ** a macro defined in config.h is used to provide a no-op. |
| 522 | 522 | */ |
| 523 | 523 | void fossil_pledge(const char *promises){ |
| 524 | 524 | if( pledge(promises, 0) ){ |
| 525 | - fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d", | |
| 525 | + fossil_panic("pledge(\"%s\",NULL) fails with errno=%d", | |
| 526 | 526 | promises, (int)errno); |
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | #endif /* defined(HAVE_PLEDGE) */ |
| 530 | 530 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -98,22 +98,22 @@ | |
| 98 | assert( pageSize>0 ); |
| 99 | assert( pageSize%2==0 ); |
| 100 | #if defined(_WIN32) |
| 101 | p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); |
| 102 | if( p==NULL ){ |
| 103 | fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError()); |
| 104 | } |
| 105 | if( !VirtualLock(p, pageSize) ){ |
| 106 | fossil_fatal("VirtualLock failed: %lu\n", GetLastError()); |
| 107 | } |
| 108 | #elif defined(USE_MMAN_H) |
| 109 | p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); |
| 110 | if( p==MAP_FAILED ){ |
| 111 | fossil_fatal("mmap failed: %d\n", errno); |
| 112 | } |
| 113 | if( mlock(p, pageSize) ){ |
| 114 | fossil_fatal("mlock failed: %d\n", errno); |
| 115 | } |
| 116 | #else |
| 117 | p = fossil_malloc(pageSize); |
| 118 | #endif |
| 119 | fossil_secure_zero(p, pageSize); |
| @@ -124,21 +124,21 @@ | |
| 124 | if( !p ) return; |
| 125 | assert( n>0 ); |
| 126 | fossil_secure_zero(p, n); |
| 127 | #if defined(_WIN32) |
| 128 | if( !VirtualUnlock(p, n) ){ |
| 129 | fossil_fatal("VirtualUnlock failed: %lu\n", GetLastError()); |
| 130 | } |
| 131 | if( !VirtualFree(p, 0, MEM_RELEASE) ){ |
| 132 | fossil_fatal("VirtualFree failed: %lu\n", GetLastError()); |
| 133 | } |
| 134 | #elif defined(USE_MMAN_H) |
| 135 | if( munlock(p, n) ){ |
| 136 | fossil_fatal("munlock failed: %d\n", errno); |
| 137 | } |
| 138 | if( munmap(p, n) ){ |
| 139 | fossil_fatal("munmap failed: %d\n", errno); |
| 140 | } |
| 141 | #else |
| 142 | fossil_free(p); |
| 143 | #endif |
| 144 | } |
| @@ -322,11 +322,11 @@ | |
| 322 | */ |
| 323 | sqlite3_uint64 fossil_timer_fetch(int timerId){ |
| 324 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 325 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 326 | if( !start->id ){ |
| 327 | fossil_fatal("Invalid call to fetch a non-allocated " |
| 328 | "timer (#%d)", timerId); |
| 329 | /*NOTREACHED*/ |
| 330 | }else{ |
| 331 | sqlite3_uint64 eu = 0, es = 0; |
| 332 | fossil_cpu_times( &eu, &es ); |
| @@ -342,11 +342,11 @@ | |
| 342 | */ |
| 343 | sqlite3_uint64 fossil_timer_reset(int timerId){ |
| 344 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 345 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 346 | if( !start->id ){ |
| 347 | fossil_fatal("Invalid call to reset a non-allocated " |
| 348 | "timer (#%d)", timerId); |
| 349 | /*NOTREACHED*/ |
| 350 | }else{ |
| 351 | sqlite3_uint64 const rc = fossil_timer_fetch(timerId); |
| 352 | fossil_cpu_times( &start->u, &start->s ); |
| @@ -520,10 +520,10 @@ | |
| 520 | ** On all other platforms, this routine does not exist, but instead |
| 521 | ** a macro defined in config.h is used to provide a no-op. |
| 522 | */ |
| 523 | void fossil_pledge(const char *promises){ |
| 524 | if( pledge(promises, 0) ){ |
| 525 | fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d", |
| 526 | promises, (int)errno); |
| 527 | } |
| 528 | } |
| 529 | #endif /* defined(HAVE_PLEDGE) */ |
| 530 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -98,22 +98,22 @@ | |
| 98 | assert( pageSize>0 ); |
| 99 | assert( pageSize%2==0 ); |
| 100 | #if defined(_WIN32) |
| 101 | p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); |
| 102 | if( p==NULL ){ |
| 103 | fossil_panic("VirtualAlloc failed: %lu\n", GetLastError()); |
| 104 | } |
| 105 | if( !VirtualLock(p, pageSize) ){ |
| 106 | fossil_panic("VirtualLock failed: %lu\n", GetLastError()); |
| 107 | } |
| 108 | #elif defined(USE_MMAN_H) |
| 109 | p = mmap(0, pageSize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); |
| 110 | if( p==MAP_FAILED ){ |
| 111 | fossil_panic("mmap failed: %d\n", errno); |
| 112 | } |
| 113 | if( mlock(p, pageSize) ){ |
| 114 | fossil_panic("mlock failed: %d\n", errno); |
| 115 | } |
| 116 | #else |
| 117 | p = fossil_malloc(pageSize); |
| 118 | #endif |
| 119 | fossil_secure_zero(p, pageSize); |
| @@ -124,21 +124,21 @@ | |
| 124 | if( !p ) return; |
| 125 | assert( n>0 ); |
| 126 | fossil_secure_zero(p, n); |
| 127 | #if defined(_WIN32) |
| 128 | if( !VirtualUnlock(p, n) ){ |
| 129 | fossil_panic("VirtualUnlock failed: %lu\n", GetLastError()); |
| 130 | } |
| 131 | if( !VirtualFree(p, 0, MEM_RELEASE) ){ |
| 132 | fossil_panic("VirtualFree failed: %lu\n", GetLastError()); |
| 133 | } |
| 134 | #elif defined(USE_MMAN_H) |
| 135 | if( munlock(p, n) ){ |
| 136 | fossil_panic("munlock failed: %d\n", errno); |
| 137 | } |
| 138 | if( munmap(p, n) ){ |
| 139 | fossil_panic("munmap failed: %d\n", errno); |
| 140 | } |
| 141 | #else |
| 142 | fossil_free(p); |
| 143 | #endif |
| 144 | } |
| @@ -322,11 +322,11 @@ | |
| 322 | */ |
| 323 | sqlite3_uint64 fossil_timer_fetch(int timerId){ |
| 324 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 325 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 326 | if( !start->id ){ |
| 327 | fossil_panic("Invalid call to fetch a non-allocated " |
| 328 | "timer (#%d)", timerId); |
| 329 | /*NOTREACHED*/ |
| 330 | }else{ |
| 331 | sqlite3_uint64 eu = 0, es = 0; |
| 332 | fossil_cpu_times( &eu, &es ); |
| @@ -342,11 +342,11 @@ | |
| 342 | */ |
| 343 | sqlite3_uint64 fossil_timer_reset(int timerId){ |
| 344 | if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){ |
| 345 | struct FossilTimer * start = &fossilTimerList[timerId-1]; |
| 346 | if( !start->id ){ |
| 347 | fossil_panic("Invalid call to reset a non-allocated " |
| 348 | "timer (#%d)", timerId); |
| 349 | /*NOTREACHED*/ |
| 350 | }else{ |
| 351 | sqlite3_uint64 const rc = fossil_timer_fetch(timerId); |
| 352 | fossil_cpu_times( &start->u, &start->s ); |
| @@ -520,10 +520,10 @@ | |
| 520 | ** On all other platforms, this routine does not exist, but instead |
| 521 | ** a macro defined in config.h is used to provide a no-op. |
| 522 | */ |
| 523 | void fossil_pledge(const char *promises){ |
| 524 | if( pledge(promises, 0) ){ |
| 525 | fossil_panic("pledge(\"%s\",NULL) fails with errno=%d", |
| 526 | promises, (int)errno); |
| 527 | } |
| 528 | } |
| 529 | #endif /* defined(HAVE_PLEDGE) */ |
| 530 |
+1
-1
| --- src/verify.c | ||
| +++ src/verify.c | ||
| @@ -45,11 +45,11 @@ | ||
| 45 | 45 | if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 46 | 46 | fossil_fatal("not a valid rid: %d", rid); |
| 47 | 47 | } |
| 48 | 48 | if( content_get(rid, &content) ){ |
| 49 | 49 | if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 50 | - fossil_fatal("hash of rid %d does not match its uuid (%b)", | |
| 50 | + fossil_panic("hash of rid %d does not match its uuid (%b)", | |
| 51 | 51 | rid, &uuid); |
| 52 | 52 | } |
| 53 | 53 | blob_reset(&content); |
| 54 | 54 | } |
| 55 | 55 | blob_reset(&uuid); |
| 56 | 56 |
| --- src/verify.c | |
| +++ src/verify.c | |
| @@ -45,11 +45,11 @@ | |
| 45 | if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 46 | fossil_fatal("not a valid rid: %d", rid); |
| 47 | } |
| 48 | if( content_get(rid, &content) ){ |
| 49 | if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 50 | fossil_fatal("hash of rid %d does not match its uuid (%b)", |
| 51 | rid, &uuid); |
| 52 | } |
| 53 | blob_reset(&content); |
| 54 | } |
| 55 | blob_reset(&uuid); |
| 56 |
| --- src/verify.c | |
| +++ src/verify.c | |
| @@ -45,11 +45,11 @@ | |
| 45 | if( !hname_validate(blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 46 | fossil_fatal("not a valid rid: %d", rid); |
| 47 | } |
| 48 | if( content_get(rid, &content) ){ |
| 49 | if( !hname_verify_hash(&content, blob_buffer(&uuid), blob_size(&uuid)) ){ |
| 50 | fossil_panic("hash of rid %d does not match its uuid (%b)", |
| 51 | rid, &uuid); |
| 52 | } |
| 53 | blob_reset(&content); |
| 54 | } |
| 55 | blob_reset(&uuid); |
| 56 |
+1
-1
| --- src/winfile.c | ||
| +++ src/winfile.c | ||
| @@ -282,11 +282,11 @@ | ||
| 282 | 282 | void win32_getcwd(char *zBuf, int nBuf){ |
| 283 | 283 | int i; |
| 284 | 284 | char *zUtf8; |
| 285 | 285 | wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf ); |
| 286 | 286 | if( GetCurrentDirectoryW(nBuf, zWide)==0 ){ |
| 287 | - fossil_fatal("cannot find current working directory."); | |
| 287 | + fossil_panic("cannot find current working directory."); | |
| 288 | 288 | } |
| 289 | 289 | zUtf8 = fossil_path_to_utf8(zWide); |
| 290 | 290 | fossil_free(zWide); |
| 291 | 291 | for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/'; |
| 292 | 292 | strncpy(zBuf, zUtf8, nBuf); |
| 293 | 293 |
| --- src/winfile.c | |
| +++ src/winfile.c | |
| @@ -282,11 +282,11 @@ | |
| 282 | void win32_getcwd(char *zBuf, int nBuf){ |
| 283 | int i; |
| 284 | char *zUtf8; |
| 285 | wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf ); |
| 286 | if( GetCurrentDirectoryW(nBuf, zWide)==0 ){ |
| 287 | fossil_fatal("cannot find current working directory."); |
| 288 | } |
| 289 | zUtf8 = fossil_path_to_utf8(zWide); |
| 290 | fossil_free(zWide); |
| 291 | for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/'; |
| 292 | strncpy(zBuf, zUtf8, nBuf); |
| 293 |
| --- src/winfile.c | |
| +++ src/winfile.c | |
| @@ -282,11 +282,11 @@ | |
| 282 | void win32_getcwd(char *zBuf, int nBuf){ |
| 283 | int i; |
| 284 | char *zUtf8; |
| 285 | wchar_t *zWide = fossil_malloc( sizeof(wchar_t)*nBuf ); |
| 286 | if( GetCurrentDirectoryW(nBuf, zWide)==0 ){ |
| 287 | fossil_panic("cannot find current working directory."); |
| 288 | } |
| 289 | zUtf8 = fossil_path_to_utf8(zWide); |
| 290 | fossil_free(zWide); |
| 291 | for(i=0; zUtf8[i]; i++) if( zUtf8[i]=='\\' ) zUtf8[i] = '/'; |
| 292 | strncpy(zBuf, zUtf8, nBuf); |
| 293 |
+8
-8
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -284,11 +284,11 @@ | ||
| 284 | 284 | static NORETURN void winhttp_fatal( |
| 285 | 285 | const char *zOp, |
| 286 | 286 | const char *zService, |
| 287 | 287 | const char *zErr |
| 288 | 288 | ){ |
| 289 | - fossil_fatal("unable to %s service '%s': %s", zOp, zService, zErr); | |
| 289 | + fossil_panic("unable to %s service '%s': %s", zOp, zService, zErr); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /* |
| 293 | 293 | ** Make sure the server stops as soon as possible after the stopper file |
| 294 | 294 | ** is found. If there is no stopper file name, do nothing. |
| @@ -560,11 +560,11 @@ | ||
| 560 | 560 | blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(), |
| 561 | 561 | zSavedKey, savedKeySize); |
| 562 | 562 | } |
| 563 | 563 | #endif |
| 564 | 564 | if( WSAStartup(MAKEWORD(2,0), &wd) ){ |
| 565 | - fossil_fatal("unable to initialize winsock"); | |
| 565 | + fossil_panic("unable to initialize winsock"); | |
| 566 | 566 | } |
| 567 | 567 | DualSocket_init(&ds); |
| 568 | 568 | while( iPort<=mxPort ){ |
| 569 | 569 | if( zIpAddr ){ |
| 570 | 570 | if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){ |
| @@ -582,18 +582,18 @@ | ||
| 582 | 582 | } |
| 583 | 583 | break; |
| 584 | 584 | } |
| 585 | 585 | if( iPort>mxPort ){ |
| 586 | 586 | if( mnPort==mxPort ){ |
| 587 | - fossil_fatal("unable to open listening socket on port %d", mnPort); | |
| 587 | + fossil_panic("unable to open listening socket on port %d", mnPort); | |
| 588 | 588 | }else{ |
| 589 | - fossil_fatal("unable to open listening socket on any" | |
| 589 | + fossil_panic("unable to open listening socket on any" | |
| 590 | 590 | " port in the range %d..%d", mnPort, mxPort); |
| 591 | 591 | } |
| 592 | 592 | } |
| 593 | 593 | if( !GetTempPathW(MAX_PATH, zTmpPath) ){ |
| 594 | - fossil_fatal("unable to get path to the temporary directory."); | |
| 594 | + fossil_panic("unable to get path to the temporary directory."); | |
| 595 | 595 | } |
| 596 | 596 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 597 | 597 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| 598 | 598 | fossil_print("Temporary files: %s*\n", zTempPrefix); |
| 599 | 599 | fossil_print("Listening for %s requests on TCP port %d\n", |
| @@ -640,11 +640,11 @@ | ||
| 640 | 640 | if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){ |
| 641 | 641 | WSACleanup(); |
| 642 | 642 | return; |
| 643 | 643 | }else{ |
| 644 | 644 | WSACleanup(); |
| 645 | - fossil_fatal("error from accept()"); | |
| 645 | + fossil_panic("error from accept()"); | |
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | if( client.s4!=INVALID_SOCKET ){ |
| 649 | 649 | pRequest = fossil_malloc(sizeof(HttpRequest)); |
| 650 | 650 | pRequest->id = ++idCnt; |
| @@ -740,11 +740,11 @@ | ||
| 740 | 740 | ); |
| 741 | 741 | } |
| 742 | 742 | if( nMsg ){ |
| 743 | 743 | zMsg = fossil_unicode_to_utf8(tmp); |
| 744 | 744 | }else{ |
| 745 | - fossil_fatal("unable to get system error message."); | |
| 745 | + fossil_panic("unable to get system error message."); | |
| 746 | 746 | } |
| 747 | 747 | if( tmp ){ |
| 748 | 748 | LocalFree((HLOCAL) tmp); |
| 749 | 749 | } |
| 750 | 750 | return zMsg; |
| @@ -885,11 +885,11 @@ | ||
| 885 | 885 | /* Try to start the control dispatcher thread for the service. */ |
| 886 | 886 | if( !StartServiceCtrlDispatcherW(ServiceTable) ){ |
| 887 | 887 | if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){ |
| 888 | 888 | return 1; |
| 889 | 889 | }else{ |
| 890 | - fossil_fatal("error from StartServiceCtrlDispatcher()"); | |
| 890 | + fossil_panic("error from StartServiceCtrlDispatcher()"); | |
| 891 | 891 | } |
| 892 | 892 | } |
| 893 | 893 | return 0; |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -284,11 +284,11 @@ | |
| 284 | static NORETURN void winhttp_fatal( |
| 285 | const char *zOp, |
| 286 | const char *zService, |
| 287 | const char *zErr |
| 288 | ){ |
| 289 | fossil_fatal("unable to %s service '%s': %s", zOp, zService, zErr); |
| 290 | } |
| 291 | |
| 292 | /* |
| 293 | ** Make sure the server stops as soon as possible after the stopper file |
| 294 | ** is found. If there is no stopper file name, do nothing. |
| @@ -560,11 +560,11 @@ | |
| 560 | blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(), |
| 561 | zSavedKey, savedKeySize); |
| 562 | } |
| 563 | #endif |
| 564 | if( WSAStartup(MAKEWORD(2,0), &wd) ){ |
| 565 | fossil_fatal("unable to initialize winsock"); |
| 566 | } |
| 567 | DualSocket_init(&ds); |
| 568 | while( iPort<=mxPort ){ |
| 569 | if( zIpAddr ){ |
| 570 | if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){ |
| @@ -582,18 +582,18 @@ | |
| 582 | } |
| 583 | break; |
| 584 | } |
| 585 | if( iPort>mxPort ){ |
| 586 | if( mnPort==mxPort ){ |
| 587 | fossil_fatal("unable to open listening socket on port %d", mnPort); |
| 588 | }else{ |
| 589 | fossil_fatal("unable to open listening socket on any" |
| 590 | " port in the range %d..%d", mnPort, mxPort); |
| 591 | } |
| 592 | } |
| 593 | if( !GetTempPathW(MAX_PATH, zTmpPath) ){ |
| 594 | fossil_fatal("unable to get path to the temporary directory."); |
| 595 | } |
| 596 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 597 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| 598 | fossil_print("Temporary files: %s*\n", zTempPrefix); |
| 599 | fossil_print("Listening for %s requests on TCP port %d\n", |
| @@ -640,11 +640,11 @@ | |
| 640 | if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){ |
| 641 | WSACleanup(); |
| 642 | return; |
| 643 | }else{ |
| 644 | WSACleanup(); |
| 645 | fossil_fatal("error from accept()"); |
| 646 | } |
| 647 | } |
| 648 | if( client.s4!=INVALID_SOCKET ){ |
| 649 | pRequest = fossil_malloc(sizeof(HttpRequest)); |
| 650 | pRequest->id = ++idCnt; |
| @@ -740,11 +740,11 @@ | |
| 740 | ); |
| 741 | } |
| 742 | if( nMsg ){ |
| 743 | zMsg = fossil_unicode_to_utf8(tmp); |
| 744 | }else{ |
| 745 | fossil_fatal("unable to get system error message."); |
| 746 | } |
| 747 | if( tmp ){ |
| 748 | LocalFree((HLOCAL) tmp); |
| 749 | } |
| 750 | return zMsg; |
| @@ -885,11 +885,11 @@ | |
| 885 | /* Try to start the control dispatcher thread for the service. */ |
| 886 | if( !StartServiceCtrlDispatcherW(ServiceTable) ){ |
| 887 | if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){ |
| 888 | return 1; |
| 889 | }else{ |
| 890 | fossil_fatal("error from StartServiceCtrlDispatcher()"); |
| 891 | } |
| 892 | } |
| 893 | return 0; |
| 894 | } |
| 895 | |
| 896 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -284,11 +284,11 @@ | |
| 284 | static NORETURN void winhttp_fatal( |
| 285 | const char *zOp, |
| 286 | const char *zService, |
| 287 | const char *zErr |
| 288 | ){ |
| 289 | fossil_panic("unable to %s service '%s': %s", zOp, zService, zErr); |
| 290 | } |
| 291 | |
| 292 | /* |
| 293 | ** Make sure the server stops as soon as possible after the stopper file |
| 294 | ** is found. If there is no stopper file name, do nothing. |
| @@ -560,11 +560,11 @@ | |
| 560 | blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(), |
| 561 | zSavedKey, savedKeySize); |
| 562 | } |
| 563 | #endif |
| 564 | if( WSAStartup(MAKEWORD(2,0), &wd) ){ |
| 565 | fossil_panic("unable to initialize winsock"); |
| 566 | } |
| 567 | DualSocket_init(&ds); |
| 568 | while( iPort<=mxPort ){ |
| 569 | if( zIpAddr ){ |
| 570 | if( DualSocket_listen(&ds, zIpAddr, iPort)==0 ){ |
| @@ -582,18 +582,18 @@ | |
| 582 | } |
| 583 | break; |
| 584 | } |
| 585 | if( iPort>mxPort ){ |
| 586 | if( mnPort==mxPort ){ |
| 587 | fossil_panic("unable to open listening socket on port %d", mnPort); |
| 588 | }else{ |
| 589 | fossil_panic("unable to open listening socket on any" |
| 590 | " port in the range %d..%d", mnPort, mxPort); |
| 591 | } |
| 592 | } |
| 593 | if( !GetTempPathW(MAX_PATH, zTmpPath) ){ |
| 594 | fossil_panic("unable to get path to the temporary directory."); |
| 595 | } |
| 596 | zTempPrefix = mprintf("%sfossil_server_P%d", |
| 597 | fossil_unicode_to_utf8(zTmpPath), iPort); |
| 598 | fossil_print("Temporary files: %s*\n", zTempPrefix); |
| 599 | fossil_print("Listening for %s requests on TCP port %d\n", |
| @@ -640,11 +640,11 @@ | |
| 640 | if( (wsaError==WSAEINTR) || (wsaError==WSAENOTSOCK) ){ |
| 641 | WSACleanup(); |
| 642 | return; |
| 643 | }else{ |
| 644 | WSACleanup(); |
| 645 | fossil_panic("error from accept()"); |
| 646 | } |
| 647 | } |
| 648 | if( client.s4!=INVALID_SOCKET ){ |
| 649 | pRequest = fossil_malloc(sizeof(HttpRequest)); |
| 650 | pRequest->id = ++idCnt; |
| @@ -740,11 +740,11 @@ | |
| 740 | ); |
| 741 | } |
| 742 | if( nMsg ){ |
| 743 | zMsg = fossil_unicode_to_utf8(tmp); |
| 744 | }else{ |
| 745 | fossil_panic("unable to get system error message."); |
| 746 | } |
| 747 | if( tmp ){ |
| 748 | LocalFree((HLOCAL) tmp); |
| 749 | } |
| 750 | return zMsg; |
| @@ -885,11 +885,11 @@ | |
| 885 | /* Try to start the control dispatcher thread for the service. */ |
| 886 | if( !StartServiceCtrlDispatcherW(ServiceTable) ){ |
| 887 | if( GetLastError()==ERROR_FAILED_SERVICE_CONTROLLER_CONNECT ){ |
| 888 | return 1; |
| 889 | }else{ |
| 890 | fossil_panic("error from StartServiceCtrlDispatcher()"); |
| 891 | } |
| 892 | } |
| 893 | return 0; |
| 894 | } |
| 895 | |
| 896 |