mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Enable compile-time flag SQLITE_ENABLE_DBPAGE_VTAB to add support for .recover shell option.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+2
-1
@@ -26,7 +26,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
# SQLITE_OMIT_PROGRESS_CALLBACK: The progress handler callback counter must be checked in the inner loop of the bytecode engine. By omitting this interface, a single conditional is removed from the inner loop of the bytecode engine, helping SQL statements to run slightly faster.
|
||||
# SQLITE_DEFAULT_FOREIGN_KEYS=1: This macro determines whether enforcement of foreign key constraints is enabled or disabled by default for new database connections.
|
||||
# SQLITE_DQS=0: This setting disables the double-quoted string literal misfeature.
|
||||
set(SQLITE_DEFINES "-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_DEFAULT_FOREIGN_KEYS=1 -DSQLITE_DQS=0")
|
||||
# SQLITE_ENABLE_DBPAGE_VTAB: Enables the SQLITE_DBPAGE virtual table. Warning: writing to the SQLITE_DBPAGE virtual table can very easily cause unrecoverably database corruption.
|
||||
set(SQLITE_DEFINES "-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_DEFAULT_FOREIGN_KEYS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB")
|
||||
|
||||
# Code hardening and debugging improvements
|
||||
# -fstack-protector-strong: The program will be resistant to having its stack overflowed
|
||||
|
||||
@@ -193,6 +193,17 @@ void db_init(void)
|
||||
// explicitly check for failures to have happened
|
||||
sqlite3_config(SQLITE_CONFIG_LOG, SQLite3LogCallback, NULL);
|
||||
|
||||
// SQLITE_DBCONFIG_DEFENSIVE
|
||||
// Disbale language features that allow ordinary SQL to deliberately corrupt
|
||||
// the database file. The disabled features include but are not limited to
|
||||
// the following:
|
||||
//
|
||||
// - The PRAGMA writable_schema=ON statement.
|
||||
// - The PRAGMA journal_mode=OFF statement.
|
||||
// - Writes to the sqlite_dbpage virtual table.
|
||||
// - Direct writes to shadow tables.
|
||||
sqlite3_config(SQLITE_DBCONFIG_DEFENSIVE, true);
|
||||
|
||||
// Register Pi-hole provided SQLite3 extensions (see sqlite3-ext.c)
|
||||
sqlite3_auto_extension((void (*)(void))sqlite3_pihole_extensions_init);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user