[Fix #3831] Do not lock kAttachMutex within shell callbacks (#3837)

This commit is contained in:
Teddy Reed 2017-10-16 13:46:14 -07:00 committed by Nick Anderson
parent cd88cecc9a
commit 676430b019
2 changed files with 2 additions and 3 deletions

View File

@ -791,8 +791,6 @@ static int shell_exec(
while (zSql[0] && (SQLITE_OK == rc)) {
/* A lock for attaching virtual tables, but also the SQL object states. */
osquery::RecursiveLock lock(osquery::kAttachMutex);
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
if (SQLITE_OK != rc) {
if (pzErrMsg) {

View File

@ -123,7 +123,8 @@ int startShell(osquery::Initializer& runner, int argc, char* argv[]) {
osquery::FLAGS_disable_events = true;
osquery::FLAGS_disable_caching = true;
// The shell may have loaded table extensions, if not, disable the manager.
if (!osquery::Watcher::get().hasManagedExtensions()) {
if (!osquery::Watcher::get().hasManagedExtensions() &&
Flag::isDefault("disable_extensions")) {
osquery::FLAGS_disable_extensions = true;
}
}