Prevent Magisk database race condition

The database should only be accessed by a single process, which is magiskd.
This means 'magisk --sqlite [SQL]' has to be updated to pass the SQL command to the daemon.
In addition, open the database connection with SQLITE_OPEN_FULLMUTEX to support multithread in magiskd.
This commit is contained in:
topjohnwu
2018-11-16 03:20:30 -05:00
parent ba70269398
commit ab5fedda0b
8 changed files with 130 additions and 150 deletions

View File

@ -20,7 +20,8 @@ enum {
BOOT_COMPLETE,
MAGISKHIDE,
HIDE_CONNECT,
HANDSHAKE
HANDSHAKE,
SQLITE_CMD,
};
// Return codes for daemon