Skip to main content

open

Function open 

Source
pub fn open(path: &Path) -> Result<OwnedConnection>
Expand description

Open (or create) a database with the pragmas every hennery database uses.

The database is private to its user (mode 0600), whatever the umask: it holds what only the collector may read (pairing-code hashes, decision 5, among them). SQLite gives a new -wal and -shm the database file’s own mode, so the file is made private before it is opened. A -wal or -shm already there, from an install before this, is made private too.

None of the three is followed if it is a symlink: the mode is changed through the descriptor of the file itself, never through a path that could name some other file of this user’s.