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

Limit the number of attached databases to zero and enable defensive mode #234

Closed
wants to merge 1 commit into from

Conversation

sofiaritz
Copy link
Contributor

Related to #41.
This PR limits the number maximum attached databases to zero (none) and enables defensive mode to prevent deliberate corruption of the database.

Refs:
https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
https://www.sqlite.org/lang_attach.html
https://www.sqlite.org/c3ref/c_limit_attached.html#sqlitelimitattached
https://www.sqlite.org/c3ref/limit.html

marcua added a commit that referenced this pull request Dec 9, 2023
@marcua
Copy link
Owner

marcua commented Dec 17, 2023

This is perfect! Since I'm refactoring this code, I've copied it verbatim into #235, so I'll close this one and the code will appear once the refactor is done. Thank you for protecting ayb users! :)

@marcua marcua closed this Dec 17, 2023
@sofiaritz
Copy link
Contributor Author

I forgot to close this myself :p
Really excited for the full DB isolation! :)

@sofiaritz sofiaritz deleted the isolation-part-1 branch December 17, 2023 21:39
marcua added a commit that referenced this pull request Dec 28, 2023
* A version that won't build

* Uncomment

* Newline

* Newline

* Compiles

* No need for only temp

* Compiles AND runs

* Move toward nsjail

* Make room for nsjail, but still as a noop

* Bring in #234

* Works end-to-end (need to implement 'touch' for new DBs)

* Create DB file in create_database

* Move isolated runner into original crate as second binary, dynamically determine path to it

* Remove hosted_db_runner

* Move nsjail builder to scripts dir

* fmt

* tokio typo

* New AybError variants

* Code review part 1

* Update docs, remove binary, add nsjail build step

* Testing docs and fmt

* Fix build command

* nsjail requirements

* More nsjail requirements

* Docs cleanup

* Clippy and code review

* Warn if not fully isolated

* Clean up for clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants