carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package stopevidence
2
3import "errors"
4
5// ErrForeignHolder is a database descriptor that root's observation cannot
6// attribute to the admitted session's replicator.
7var ErrForeignHolder = errors.New("stopevidence: a descriptor other than the replicator's holds the database")
8
9// Descriptor is one open descriptor root observed holding a watched file:
10// the process, the task whose table showed it, the descriptor number and
11// the open file's device and inode. A zero identity is a match by name
12// whose file could not be reached.
13type Descriptor struct {
14 PID int `json:"pid"`
15 TID int `json:"tid"`
16 FD int `json:"fd"`
17 Device uint64 `json:"device"`
18 Inode uint64 `json:"inode"`
19}
20
21// DescriptorHint is the agent's record of one of its own replicator's
22// descriptors, taken from its own table when the replicator opened. It is a
23// narrowing hint only (claim Plan 11, R3): root exempts a descriptor only
24// when its own scan finds it in the agent's authenticated process, at this
25// number, on this file. A hint never adds a holder or names a process.
26type DescriptorHint struct {
27 FD int `json:"fd"`
28 Device uint64 `json:"device"`
29 Inode uint64 `json:"inode"`
30}
31
32// FileIdentity names a file by device and inode, as the launch journal
33// records it.
34type FileIdentity struct {
35 Device uint64 `json:"device"`
36 Inode uint64 `json:"inode"`
37}
38
39// Agent is the authenticated agent process root observed on its socket:
40// its pid and its start time (field 22 of /proc/<pid>/stat). Root takes
41// both from the peer credentials, never from a request.
42type Agent struct {
43 PID int
44 Start string
45}
46