1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! FerroCrypt Archive (FCA) โ native archive payload format.
//!
//! Full wire-format spec: `ferrocrypt-lib/FORMAT.md` ยง9.
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub use ArchiveLimits;
pub
pub use unarchive;
pub use archive;
pub use ;
pub use PERMISSION_BITS_MASK;
/// Cleanup policy for staged plaintext after a returned decryption error.
///
/// Decryption stages a file or directory at
/// `{output_dir}/{root_name}.incomplete`. After payload authentication and
/// archive validation complete, it promotes that entry to
/// `{output_dir}/{root_name}` using the platform's no-clobber commit route.
/// Root permission and identity checks follow promotion. A pre-existing final
/// or `.incomplete` entry is rejected, not reused or removed.
///
/// [`Self::DeleteOnError`] is the default; [`Self::RetainOnError`] preserves
/// partial output for inspection or recovery. A failed or unconfirmed cleanup
/// is reported in the returned error with the working path.
///
/// Once the output is confirmed as committed, later errors preserve it.
/// These include a replaced final name, a changed or unconfirmable destination
/// directory, a retained staging link, or a committed file with a link count
/// other than one. The error describes the complete output or replacement;
/// it must not be treated as evidence that nothing was written. Identity
/// comparisons are skipped where the filesystem provides no usable identity;
/// destination-directory confirmation also skips descriptor or memory exhaustion.
///
/// Extraction requires a retained handle to the staged root before streaming
/// content. Failure to obtain it can leave an empty entry if cleanup also
/// fails. Any remaining `.incomplete` entry blocks a retry.
///
/// A normal `Err` return applies this policy and reports, in the returned
/// error, a removal that failed or could not be confirmed. A panic unwind
/// applies it as well, best effort and without a report, because the panic
/// is what propagates. A panic in a build with `panic = "abort"` aborts the
/// process instead. An abort, any other process termination, and power loss
/// run no cleanup, so staged plaintext can remain under either policy; the
/// caller must inspect or remove that output explicitly.
///
/// This enum deliberately does not implement `Copy`: future policies may
/// carry owned configuration, such as a destination for retained output.