-
Notifications
You must be signed in to change notification settings - Fork 6
/
errors.go
130 lines (101 loc) · 4.59 KB
/
errors.go
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package jail
// errors in this file have been copied from https://github.com/freebsd/freebsd/blob/master/sys/sys/errno.h
const (
eperm = 1
enoent = 2
efault = 14
eexist = 17
einval = 22
eagain = 35
enametoolong = 63
)
// The jail() system call will fail with one of the below errors
const (
// ErrJailPermDenied [EPERM] This process is not allowed to create a jail,
// either because it is not the super-user, or because it would exceed the
// jail's children.max limit.
ErrJailPermDenied = eperm
// ErrJailFaultOutsideOfAllocatedSpace [EFAULT] jail points to an address
// outside the allocated address space of the process.
ErrJailFaultOutsideOfAllocatedSpace = efault
// ErrJailInvalidVersion [EINVAL] The version number of the argument is not
// correct.
ErrJailInvalidVersion = einval
// ErrjailNoFreeJIDFound [EAGAIN] No free JID could be found.
ErrjailNoFreeJIDFound = eagain
// ErrJailNoSuchFileDirectory [ENOENT] No such file or directory. A component of a specified pathname
// did not exist, or the pathname was an empty string.
ErrJailNoSuchFileDirectory = enoent
)
// The jail_set() system call will fail with one of the below errors
const (
// ErrJailSetPermDenied [EPERM] This process is not allowed to create a jail,
// either because it is not the super-user, or because it would exceed the
// jail's children.max limit.
ErrJailSetPermDenied = eperm
// ErrJailSetPermRestricted [EPERM] A jail parameter was set to a less restrictive
// value then the current environment.
ErrJailSetPermRestricted = eperm
// ErrJailSetFaultOutsideOfAllocatedSpace [EFAULT] Iov, or one of the addresses
// contained within it, points to an address outside the allocated address space
// of the process.
ErrJailSetFaultOutsideOfAllocatedSpace = efault
// ErrJailSetParamNotExist [ENOENT] The jail referred to by a jid or name parameter
// does not exist, and the JAIL_CREATE flag is not set.
ErrJailSetParamNotExist = enoent
// ErrJailSetNotAccessibleProcInDiffJail [ENOENT] The jail referred to by a jid
// is not accessible by the process, because the process is in a different jail.
ErrJailSetNotAccessibleProcInDiffJail = enoent
// ErrJailSetUpdateFlagNotSet [EEXIST] The jail referred to by a jid or name
// parameter exists, and the JAIL_UPDATE flag is not set.
ErrJailSetUpdateFlagNotSet = eexist
// Einval [EINVAL] A supplied parameter is the wrong size.
ErrJailSetParamWrongSize = einval
// ErrJailSetParamOutOfRange [EINVAL] A supplied parameter is out of range.
ErrJailSetParamOutOfRange = einval
// ErrJailSetStringNotNullTerminated [EINVAL] A supplied string parameter is
// not null-terminated.
ErrJailSetStringNotNullTerminated = einval
// ErrJailSetUnknownParam [EINVAL] A supplied parameter name does not match
// any known parameters.
ErrJailSetUnknownParam = einval
// ErrJailSetCreateOrUpdateNotSet [EINVAL] One of the JAIL_CREATE or JAIL_UPDATE
// flags is not set.
ErrJailSetCreateOrUpdateNotSet = einval
// ErrJailSetNameTooLong [ENAMETOOLONG] A supplied string parameter is longer
// than allowed.
ErrJailSetNameTooLong = enametoolong
// ErrJailSetNoIDsLeft [EAGAIN] There are no jail IDs left.
ErrJailSetNoIDsLeft = eagain
)
// The jail_get() system call will fail with one of the below errors
const (
// ErrJailGetFaultOutsideOfAllocatedSpace [EFAULT] Iov, or one of the addresses
// contained within it, points to an address outside the allocated address space
// of the process.
ErrJailGetFaultOutsideOfAllocatedSpace = efault
// ErrJailGetNotExist [ENOENT] The jail referred to by jid or name parameter
// does not exist.
ErrJailGetNotExist = enoent
// ErrJailGetNotAccessibleProcInDiffJail [ENOENT] The jail referred to by a
// jid is not accessible by the process, because the process is in a different
// jail.
ErrJailGetNotAccessibleProcInDiffJail = enoent
// [ENOENT] The lastjid parameter is greater than the highest current jail ID.
ErrJailGetParamHigherThanCurJID = enoent
// ErrJailGetParamWrongSize [EINVAL] A supplied parameter is the wrong size.
ErrJailGetParamWrongSize = einval
// ErrJailGetUnknownParam [EINVAL] A supplied parameter name does not match
// any known parameters.
ErrJailGetUnknownParam = einval
)
// The jail_attach() and jail_remove() system calls will fail with either of the
// below errors
var (
// ErrJailAttachUnprivilegedUser [EPERM] A user other than the super-user
// attempted to attach to or remove a jail.
ErrJailAttachUnprivilegedUser = eperm
// ErrjailAttachJIDNotExist [EINVAL] The jail specified by jid does not exist.
ErrjailAttachJIDNotExist = einval
)
const ErrMsgLen = 1024