mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-08 02:18:53 +00:00
Fix SQLite access after ASIO usage (#2217)
Using the boost ASIO libraries before calling SQLite open causes the "file://" protocol to be rewritten with a prepended CWD.
This commit is contained in:
parent
e6fbde820e
commit
f740a1f020
@ -101,11 +101,12 @@ QueryData genQuicklookCache(QueryContext& context) {
|
||||
for (const auto& index : databases) {
|
||||
sqlite3* db = nullptr;
|
||||
auto rc = sqlite3_open_v2(
|
||||
("file://" + index).c_str(), &db,
|
||||
index.c_str(), &db,
|
||||
(SQLITE_OPEN_READONLY | SQLITE_OPEN_PRIVATECACHE | SQLITE_OPEN_NOMUTEX),
|
||||
nullptr);
|
||||
if (rc != SQLITE_OK || db == nullptr) {
|
||||
VLOG(1) << "Cannot open " << index << " read only";
|
||||
VLOG(1) << "Cannot open " << index << " read only: "
|
||||
<< rc << " " << getStringForSQLiteReturnCode(rc);
|
||||
if (db != nullptr) {
|
||||
free(db);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user