Skip to main content

unpack_database

Function unpack_database 

Source
pub fn unpack_database(
    archive: &Path,
    dir: &Path,
    options: &UnpackOptions,
) -> Result<RestoreResult, DatabaseError>
Expand description

Unpacks an archive made by pack_database into dir, replacing the database that is there (and the nested ones the archive carries), with the recoverable procedure of super::restore_database (stage, verify, swap, roll back).

The archive is judged before anything is written: size and entry-count limits, names (no .., absolute or drive paths, backslashes, control characters, device names, duplicates ignoring case), no symbolic links, no compressed or encrypted entries, declared sizes against the limits and against what each entry really holds. Entries the manifests do not list — the caller’s extras — are not extracted. Every database is staged and verified before any is swapped in, and one failure puts all of them back.