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
//! Windows (ADR-115): a write-restricted token does not restrict reads, so a
//! guard under `openmoat run` can read the state directory's lock, and could
//! not write the audit log. The lock is opened for writing instead (nothing
//! is written): the state directory's access list names the person's account
//! and `SYSTEM` only (ADR-083), so under the run's token that open fails with
//! `ERROR_ACCESS_DENIED`. What tells the run apart from a lock that is only
//! read-only is the token itself: this process's token is restricted, which
//! no variable and no hook setting can make it.
use ;
use io;
use Path;
/// `ERROR_ACCESS_DENIED`.
const ACCESS_DENIED: i32 = 5;
/// Whether this process's token is restricted.
/// Open the lock as the run's token would have to for the audit log: for
/// writing, without changing it.
pub
pub
/// A process in no sandbox, for the tests.
pub
/// The refusal a guard under `openmoat run` gets, for the tests.
pub