MCPcopy Create free account
hub / github.com/containers/bubblewrap / seccomp_program_new

Function seccomp_program_new

bubblewrap.c:263–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261DEFINE_LINKED_LIST (SeccompProgram, seccomp_program)
262
263static SeccompProgram *
264seccomp_program_new (int *fd)
265{
266 SeccompProgram *self = _seccomp_program_append_new ();
267 cleanup_free char *data = NULL;
268 size_t len;
269
270 data = load_file_data (*fd, &len);
271
272 if (data == NULL)
273 die_with_error ("Can't read seccomp data");
274
275 close (*fd);
276 *fd = -1;
277
278 if (len % 8 != 0)
279 die ("Invalid seccomp data, must be multiple of 8");
280
281 self->program.len = len / 8;
282 self->program.filter = (struct sock_filter *) steal_pointer (&data);
283 return self;
284}
285
286static void
287seccomp_programs_apply (void)

Callers 2

parse_args_recurseFunction · 0.85
mainFunction · 0.85

Calls 4

load_file_dataFunction · 0.85
die_with_errorFunction · 0.85
dieFunction · 0.85
steal_pointerFunction · 0.85

Tested by

no test coverage detected