• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* automatically generated by rust-bindgen */
2 
3 pub type __rlim64_t = u64;
4 pub type __u8 = u8;
5 pub type __u16 = u16;
6 pub type __u32 = u32;
7 
8 pub type __uid_t = ::std::os::raw::c_uint;
9 pub type __gid_t = ::std::os::raw::c_uint;
10 pub type __pid_t = ::std::os::raw::c_int;
11 pub type rlim_t = __rlim64_t;
12 pub type gid_t = __gid_t;
13 pub type uid_t = __uid_t;
14 pub type pid_t = __pid_t;
15 #[repr(C)]
16 pub struct sock_filter {
17     pub code: __u16,
18     pub jt: __u8,
19     pub jf: __u8,
20     pub k: __u32,
21 }
22 #[repr(C)]
23 #[derive(Debug, Copy, Clone)]
24 pub struct sock_fprog {
25     pub len: ::std::os::raw::c_ushort,
26     pub filter: *mut sock_filter,
27 }
28 pub const MINIJAIL_ERR_NO_ACCESS: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_NO_ACCESS;
29 pub const MINIJAIL_ERR_NO_COMMAND: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_NO_COMMAND;
30 pub const MINIJAIL_ERR_SIG_BASE: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_SIG_BASE;
31 pub const MINIJAIL_ERR_PRELOAD: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_PRELOAD;
32 pub const MINIJAIL_ERR_JAIL: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_JAIL;
33 pub const MINIJAIL_ERR_INIT: _bindgen_ty_1 = _bindgen_ty_1::MINIJAIL_ERR_INIT;
34 #[repr(u32)]
35 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
36 pub enum _bindgen_ty_1 {
37     MINIJAIL_ERR_NO_ACCESS = 126,
38     MINIJAIL_ERR_NO_COMMAND = 127,
39     MINIJAIL_ERR_SIG_BASE = 128,
40     MINIJAIL_ERR_PRELOAD = 252,
41     MINIJAIL_ERR_JAIL = 253,
42     MINIJAIL_ERR_INIT = 254,
43 }
44 #[repr(C)]
45 #[derive(Debug, Copy, Clone)]
46 pub struct minijail {
47     _unused: [u8; 0],
48 }
49 pub type minijail_hook_t = ::std::option::Option<
50     unsafe extern "C" fn(context: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
51 >;
52 #[repr(u32)]
53 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
54 pub enum minijail_hook_event_t {
55     MINIJAIL_HOOK_EVENT_PRE_DROP_CAPS = 0,
56     MINIJAIL_HOOK_EVENT_PRE_EXECVE = 1,
57     MINIJAIL_HOOK_EVENT_PRE_CHROOT = 2,
58     MINIJAIL_HOOK_EVENT_MAX = 3,
59 }
60 extern "C" {
minijail_new() -> *mut minijail61     pub fn minijail_new() -> *mut minijail;
62 }
63 extern "C" {
minijail_change_uid(j: *mut minijail, uid: uid_t)64     pub fn minijail_change_uid(j: *mut minijail, uid: uid_t);
65 }
66 extern "C" {
minijail_change_gid(j: *mut minijail, gid: gid_t)67     pub fn minijail_change_gid(j: *mut minijail, gid: gid_t);
68 }
69 extern "C" {
minijail_set_supplementary_gids(j: *mut minijail, size: usize, list: *const gid_t)70     pub fn minijail_set_supplementary_gids(j: *mut minijail, size: usize, list: *const gid_t);
71 }
72 extern "C" {
minijail_keep_supplementary_gids(j: *mut minijail)73     pub fn minijail_keep_supplementary_gids(j: *mut minijail);
74 }
75 extern "C" {
minijail_change_user( j: *mut minijail, user: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int76     pub fn minijail_change_user(
77         j: *mut minijail,
78         user: *const ::std::os::raw::c_char,
79     ) -> ::std::os::raw::c_int;
80 }
81 extern "C" {
minijail_change_group( j: *mut minijail, group: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int82     pub fn minijail_change_group(
83         j: *mut minijail,
84         group: *const ::std::os::raw::c_char,
85     ) -> ::std::os::raw::c_int;
86 }
87 extern "C" {
minijail_use_seccomp(j: *mut minijail)88     pub fn minijail_use_seccomp(j: *mut minijail);
89 }
90 extern "C" {
minijail_no_new_privs(j: *mut minijail)91     pub fn minijail_no_new_privs(j: *mut minijail);
92 }
93 extern "C" {
minijail_use_seccomp_filter(j: *mut minijail)94     pub fn minijail_use_seccomp_filter(j: *mut minijail);
95 }
96 extern "C" {
minijail_set_seccomp_filter_tsync(j: *mut minijail)97     pub fn minijail_set_seccomp_filter_tsync(j: *mut minijail);
98 }
99 extern "C" {
minijail_set_seccomp_filters(j: *mut minijail, filter: *const sock_fprog)100     pub fn minijail_set_seccomp_filters(j: *mut minijail, filter: *const sock_fprog);
101 }
102 extern "C" {
minijail_parse_seccomp_filters(j: *mut minijail, path: *const ::std::os::raw::c_char)103     pub fn minijail_parse_seccomp_filters(j: *mut minijail, path: *const ::std::os::raw::c_char);
104 }
105 extern "C" {
minijail_parse_seccomp_filters_from_fd(j: *mut minijail, fd: ::std::os::raw::c_int)106     pub fn minijail_parse_seccomp_filters_from_fd(j: *mut minijail, fd: ::std::os::raw::c_int);
107 }
108 extern "C" {
minijail_log_seccomp_filter_failures(j: *mut minijail)109     pub fn minijail_log_seccomp_filter_failures(j: *mut minijail);
110 }
111 extern "C" {
minijail_use_caps(j: *mut minijail, capmask: u64)112     pub fn minijail_use_caps(j: *mut minijail, capmask: u64);
113 }
114 extern "C" {
minijail_capbset_drop(j: *mut minijail, capmask: u64)115     pub fn minijail_capbset_drop(j: *mut minijail, capmask: u64);
116 }
117 extern "C" {
minijail_set_ambient_caps(j: *mut minijail)118     pub fn minijail_set_ambient_caps(j: *mut minijail);
119 }
120 extern "C" {
minijail_reset_signal_mask(j: *mut minijail)121     pub fn minijail_reset_signal_mask(j: *mut minijail);
122 }
123 extern "C" {
minijail_reset_signal_handlers(j: *mut minijail)124     pub fn minijail_reset_signal_handlers(j: *mut minijail);
125 }
126 extern "C" {
minijail_namespace_vfs(j: *mut minijail)127     pub fn minijail_namespace_vfs(j: *mut minijail);
128 }
129 extern "C" {
minijail_namespace_enter_vfs(j: *mut minijail, ns_path: *const ::std::os::raw::c_char)130     pub fn minijail_namespace_enter_vfs(j: *mut minijail, ns_path: *const ::std::os::raw::c_char);
131 }
132 extern "C" {
minijail_new_session_keyring(j: *mut minijail)133     pub fn minijail_new_session_keyring(j: *mut minijail);
134 }
135 extern "C" {
minijail_skip_setting_securebits(j: *mut minijail, securebits_skip_mask: u64)136     pub fn minijail_skip_setting_securebits(j: *mut minijail, securebits_skip_mask: u64);
137 }
138 extern "C" {
minijail_skip_remount_private(j: *mut minijail)139     pub fn minijail_skip_remount_private(j: *mut minijail);
140 }
141 extern "C" {
minijail_remount_mode(j: *mut minijail, mode: ::std::os::raw::c_ulong)142     pub fn minijail_remount_mode(j: *mut minijail, mode: ::std::os::raw::c_ulong);
143 }
144 extern "C" {
minijail_namespace_ipc(j: *mut minijail)145     pub fn minijail_namespace_ipc(j: *mut minijail);
146 }
147 extern "C" {
minijail_namespace_uts(j: *mut minijail)148     pub fn minijail_namespace_uts(j: *mut minijail);
149 }
150 extern "C" {
minijail_namespace_set_hostname( j: *mut minijail, name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int151     pub fn minijail_namespace_set_hostname(
152         j: *mut minijail,
153         name: *const ::std::os::raw::c_char,
154     ) -> ::std::os::raw::c_int;
155 }
156 extern "C" {
minijail_namespace_net(j: *mut minijail)157     pub fn minijail_namespace_net(j: *mut minijail);
158 }
159 extern "C" {
minijail_namespace_enter_net(j: *mut minijail, ns_path: *const ::std::os::raw::c_char)160     pub fn minijail_namespace_enter_net(j: *mut minijail, ns_path: *const ::std::os::raw::c_char);
161 }
162 extern "C" {
minijail_namespace_cgroups(j: *mut minijail)163     pub fn minijail_namespace_cgroups(j: *mut minijail);
164 }
165 extern "C" {
minijail_close_open_fds(j: *mut minijail)166     pub fn minijail_close_open_fds(j: *mut minijail);
167 }
168 extern "C" {
minijail_namespace_pids(j: *mut minijail)169     pub fn minijail_namespace_pids(j: *mut minijail);
170 }
171 extern "C" {
minijail_namespace_pids_rw_proc(j: *mut minijail)172     pub fn minijail_namespace_pids_rw_proc(j: *mut minijail);
173 }
174 extern "C" {
minijail_namespace_user(j: *mut minijail)175     pub fn minijail_namespace_user(j: *mut minijail);
176 }
177 extern "C" {
minijail_namespace_user_disable_setgroups(j: *mut minijail)178     pub fn minijail_namespace_user_disable_setgroups(j: *mut minijail);
179 }
180 extern "C" {
minijail_uidmap( j: *mut minijail, uidmap: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int181     pub fn minijail_uidmap(
182         j: *mut minijail,
183         uidmap: *const ::std::os::raw::c_char,
184     ) -> ::std::os::raw::c_int;
185 }
186 extern "C" {
minijail_gidmap( j: *mut minijail, gidmap: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int187     pub fn minijail_gidmap(
188         j: *mut minijail,
189         gidmap: *const ::std::os::raw::c_char,
190     ) -> ::std::os::raw::c_int;
191 }
192 extern "C" {
minijail_remount_proc_readonly(j: *mut minijail)193     pub fn minijail_remount_proc_readonly(j: *mut minijail);
194 }
195 extern "C" {
minijail_run_as_init(j: *mut minijail)196     pub fn minijail_run_as_init(j: *mut minijail);
197 }
198 extern "C" {
minijail_write_pid_file( j: *mut minijail, path: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int199     pub fn minijail_write_pid_file(
200         j: *mut minijail,
201         path: *const ::std::os::raw::c_char,
202     ) -> ::std::os::raw::c_int;
203 }
204 extern "C" {
minijail_inherit_usergroups(j: *mut minijail)205     pub fn minijail_inherit_usergroups(j: *mut minijail);
206 }
207 extern "C" {
minijail_use_alt_syscall( j: *mut minijail, table: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int208     pub fn minijail_use_alt_syscall(
209         j: *mut minijail,
210         table: *const ::std::os::raw::c_char,
211     ) -> ::std::os::raw::c_int;
212 }
213 extern "C" {
minijail_rlimit( j: *mut minijail, type_: ::std::os::raw::c_int, cur: rlim_t, max: rlim_t, ) -> ::std::os::raw::c_int214     pub fn minijail_rlimit(
215         j: *mut minijail,
216         type_: ::std::os::raw::c_int,
217         cur: rlim_t,
218         max: rlim_t,
219     ) -> ::std::os::raw::c_int;
220 }
221 extern "C" {
minijail_add_to_cgroup( j: *mut minijail, path: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int222     pub fn minijail_add_to_cgroup(
223         j: *mut minijail,
224         path: *const ::std::os::raw::c_char,
225     ) -> ::std::os::raw::c_int;
226 }
227 extern "C" {
minijail_forward_signals(j: *mut minijail) -> ::std::os::raw::c_int228     pub fn minijail_forward_signals(j: *mut minijail) -> ::std::os::raw::c_int;
229 }
230 extern "C" {
minijail_create_session(j: *mut minijail) -> ::std::os::raw::c_int231     pub fn minijail_create_session(j: *mut minijail) -> ::std::os::raw::c_int;
232 }
233 extern "C" {
minijail_enter_chroot( j: *mut minijail, dir: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int234     pub fn minijail_enter_chroot(
235         j: *mut minijail,
236         dir: *const ::std::os::raw::c_char,
237     ) -> ::std::os::raw::c_int;
238 }
239 extern "C" {
minijail_enter_pivot_root( j: *mut minijail, dir: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int240     pub fn minijail_enter_pivot_root(
241         j: *mut minijail,
242         dir: *const ::std::os::raw::c_char,
243     ) -> ::std::os::raw::c_int;
244 }
245 extern "C" {
minijail_get_original_path( j: *mut minijail, chroot_path: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char246     pub fn minijail_get_original_path(
247         j: *mut minijail,
248         chroot_path: *const ::std::os::raw::c_char,
249     ) -> *mut ::std::os::raw::c_char;
250 }
251 extern "C" {
minijail_mount_tmp(j: *mut minijail)252     pub fn minijail_mount_tmp(j: *mut minijail);
253 }
254 extern "C" {
minijail_mount_tmp_size(j: *mut minijail, size: usize)255     pub fn minijail_mount_tmp_size(j: *mut minijail, size: usize);
256 }
257 extern "C" {
minijail_mount_dev(j: *mut minijail)258     pub fn minijail_mount_dev(j: *mut minijail);
259 }
260 extern "C" {
minijail_mount_with_data( j: *mut minijail, src: *const ::std::os::raw::c_char, dest: *const ::std::os::raw::c_char, type_: *const ::std::os::raw::c_char, flags: ::std::os::raw::c_ulong, data: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int261     pub fn minijail_mount_with_data(
262         j: *mut minijail,
263         src: *const ::std::os::raw::c_char,
264         dest: *const ::std::os::raw::c_char,
265         type_: *const ::std::os::raw::c_char,
266         flags: ::std::os::raw::c_ulong,
267         data: *const ::std::os::raw::c_char,
268     ) -> ::std::os::raw::c_int;
269 }
270 extern "C" {
minijail_mount( j: *mut minijail, src: *const ::std::os::raw::c_char, dest: *const ::std::os::raw::c_char, type_: *const ::std::os::raw::c_char, flags: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int271     pub fn minijail_mount(
272         j: *mut minijail,
273         src: *const ::std::os::raw::c_char,
274         dest: *const ::std::os::raw::c_char,
275         type_: *const ::std::os::raw::c_char,
276         flags: ::std::os::raw::c_ulong,
277     ) -> ::std::os::raw::c_int;
278 }
279 extern "C" {
minijail_bind( j: *mut minijail, src: *const ::std::os::raw::c_char, dest: *const ::std::os::raw::c_char, writeable: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int280     pub fn minijail_bind(
281         j: *mut minijail,
282         src: *const ::std::os::raw::c_char,
283         dest: *const ::std::os::raw::c_char,
284         writeable: ::std::os::raw::c_int,
285     ) -> ::std::os::raw::c_int;
286 }
287 extern "C" {
minijail_add_hook( j: *mut minijail, hook: minijail_hook_t, payload: *mut ::std::os::raw::c_void, event: minijail_hook_event_t, ) -> ::std::os::raw::c_int288     pub fn minijail_add_hook(
289         j: *mut minijail,
290         hook: minijail_hook_t,
291         payload: *mut ::std::os::raw::c_void,
292         event: minijail_hook_event_t,
293     ) -> ::std::os::raw::c_int;
294 }
295 extern "C" {
minijail_preserve_fd( j: *mut minijail, parent_fd: ::std::os::raw::c_int, child_fd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int296     pub fn minijail_preserve_fd(
297         j: *mut minijail,
298         parent_fd: ::std::os::raw::c_int,
299         child_fd: ::std::os::raw::c_int,
300     ) -> ::std::os::raw::c_int;
301 }
302 extern "C" {
minijail_set_preload_path( j: *mut minijail, preload_path: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int303     pub fn minijail_set_preload_path(
304         j: *mut minijail,
305         preload_path: *const ::std::os::raw::c_char,
306     ) -> ::std::os::raw::c_int;
307 }
308 extern "C" {
minijail_enter(j: *const minijail)309     pub fn minijail_enter(j: *const minijail);
310 }
311 extern "C" {
minijail_run( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int312     pub fn minijail_run(
313         j: *mut minijail,
314         filename: *const ::std::os::raw::c_char,
315         argv: *const *mut ::std::os::raw::c_char,
316     ) -> ::std::os::raw::c_int;
317 }
318 extern "C" {
minijail_run_no_preload( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int319     pub fn minijail_run_no_preload(
320         j: *mut minijail,
321         filename: *const ::std::os::raw::c_char,
322         argv: *const *mut ::std::os::raw::c_char,
323     ) -> ::std::os::raw::c_int;
324 }
325 extern "C" {
minijail_run_pid( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, pchild_pid: *mut pid_t, ) -> ::std::os::raw::c_int326     pub fn minijail_run_pid(
327         j: *mut minijail,
328         filename: *const ::std::os::raw::c_char,
329         argv: *const *mut ::std::os::raw::c_char,
330         pchild_pid: *mut pid_t,
331     ) -> ::std::os::raw::c_int;
332 }
333 extern "C" {
minijail_run_pipe( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, pstdin_fd: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int334     pub fn minijail_run_pipe(
335         j: *mut minijail,
336         filename: *const ::std::os::raw::c_char,
337         argv: *const *mut ::std::os::raw::c_char,
338         pstdin_fd: *mut ::std::os::raw::c_int,
339     ) -> ::std::os::raw::c_int;
340 }
341 extern "C" {
minijail_run_pid_pipes( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, pchild_pid: *mut pid_t, pstdin_fd: *mut ::std::os::raw::c_int, pstdout_fd: *mut ::std::os::raw::c_int, pstderr_fd: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int342     pub fn minijail_run_pid_pipes(
343         j: *mut minijail,
344         filename: *const ::std::os::raw::c_char,
345         argv: *const *mut ::std::os::raw::c_char,
346         pchild_pid: *mut pid_t,
347         pstdin_fd: *mut ::std::os::raw::c_int,
348         pstdout_fd: *mut ::std::os::raw::c_int,
349         pstderr_fd: *mut ::std::os::raw::c_int,
350     ) -> ::std::os::raw::c_int;
351 }
352 extern "C" {
minijail_run_pid_pipes_no_preload( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, pchild_pid: *mut pid_t, pstdin_fd: *mut ::std::os::raw::c_int, pstdout_fd: *mut ::std::os::raw::c_int, pstderr_fd: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int353     pub fn minijail_run_pid_pipes_no_preload(
354         j: *mut minijail,
355         filename: *const ::std::os::raw::c_char,
356         argv: *const *mut ::std::os::raw::c_char,
357         pchild_pid: *mut pid_t,
358         pstdin_fd: *mut ::std::os::raw::c_int,
359         pstdout_fd: *mut ::std::os::raw::c_int,
360         pstderr_fd: *mut ::std::os::raw::c_int,
361     ) -> ::std::os::raw::c_int;
362 }
363 extern "C" {
minijail_run_env_pid_pipes_no_preload( j: *mut minijail, filename: *const ::std::os::raw::c_char, argv: *const *mut ::std::os::raw::c_char, envp: *const *mut ::std::os::raw::c_char, pchild_pid: *mut pid_t, pstdin_fd: *mut ::std::os::raw::c_int, pstdout_fd: *mut ::std::os::raw::c_int, pstderr_fd: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int364     pub fn minijail_run_env_pid_pipes_no_preload(
365         j: *mut minijail,
366         filename: *const ::std::os::raw::c_char,
367         argv: *const *mut ::std::os::raw::c_char,
368         envp: *const *mut ::std::os::raw::c_char,
369         pchild_pid: *mut pid_t,
370         pstdin_fd: *mut ::std::os::raw::c_int,
371         pstdout_fd: *mut ::std::os::raw::c_int,
372         pstderr_fd: *mut ::std::os::raw::c_int,
373     ) -> ::std::os::raw::c_int;
374 }
375 extern "C" {
minijail_fork(j: *mut minijail) -> pid_t376     pub fn minijail_fork(j: *mut minijail) -> pid_t;
377 }
378 extern "C" {
minijail_kill(j: *mut minijail) -> ::std::os::raw::c_int379     pub fn minijail_kill(j: *mut minijail) -> ::std::os::raw::c_int;
380 }
381 extern "C" {
minijail_wait(j: *mut minijail) -> ::std::os::raw::c_int382     pub fn minijail_wait(j: *mut minijail) -> ::std::os::raw::c_int;
383 }
384 extern "C" {
minijail_destroy(j: *mut minijail)385     pub fn minijail_destroy(j: *mut minijail);
386 }
387 extern "C" {
minijail_log_to_fd(fd: ::std::os::raw::c_int, min_priority: ::std::os::raw::c_int)388     pub fn minijail_log_to_fd(fd: ::std::os::raw::c_int, min_priority: ::std::os::raw::c_int);
389 }
390