Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return error detaching table, only use primary database #6373

Merged
merged 1 commit into from
Apr 8, 2020

Conversation

Breakwell
Copy link
Contributor

@Breakwell Breakwell commented Apr 7, 2020

Description

Osquery can fail to detach existing tables when an extension has gone away. This then causes issues re-registering the extension tables when the extension was added back. We can see here that the call to detach will always return success: https://github.com/osquery/osquery/blob/master/osquery/sql/sql.cpp#L162 instead this should return a status stating why it failed.

The reason the detach fails is because it doesn't necessarily use the primary database when calling it. The fix has already been applied to attach function: https://github.com/osquery/osquery/blob/master/osquery/sql/sqlite_util.cpp#L247

@Breakwell Breakwell force-pushed the deteching-tables-in-use-fails branch from 6c56fa3 to 1ccf467 Compare April 8, 2020 15:13
@Smjert Smjert added bug extensions Related to osquery extension SDK or to extensions themselves labels Apr 8, 2020
@theopolis theopolis merged commit 8937442 into osquery:master Apr 8, 2020
aikuchin pushed a commit to aikuchin/osquery that referenced this pull request Jul 11, 2023
… to master

* commit '8c13dd6bd206f2909a4baea5bcfbc91d5e3f502b': (159 commits)
  release: updating changelog for 4.3.0 release (osquery#6387)
  Build hvci_status table with CMake (osquery#6378)
  Change calls to debug log to verbose (osquery#6369)
  iokit: Fix race when accessing port_ (osquery#6380)
  Check extensions are registered with osquery core (osquery#6374)
  First steps to remove the Buck build system (osquery#6361)
  Return error detaching table, only use primary database (osquery#6373)
  Copy the parent environment when launching worker
  Change process table log errors to info and fix typo (osquery#6370)
  Ensure the extension uuid is never 0 (osquery#6377)
  Remove errors when converting empty numeric rows (osquery#6371)
  Do not force a specific path to install osquery on Windows (osquery#6379)
  Fix readFile API doing blocking I/O with a non-blocking handle (osquery#6368)
  magic: Check return from magic_file (osquery#6363)
  macos: Use -1 for missing ppid in process_events (osquery#6339)
  Update OpenSSL to version 1.1.1f and fix build (osquery#6359)
  Simplify how third party libraries formula work (osquery#6303)
  Add socket_events table for socket auditing in MacOS (osquery#6028)
  Extend the fields of curl_certificate table (osquery#6176)
  add status column to deb_packages table (osquery#6341)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug extensions Related to osquery extension SDK or to extensions themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants