Skip to content

Commit

Permalink
Merge pull request #527 from giuseppe/seccomp-notify-ignore-enoent
Browse files Browse the repository at this point in the history
seccomp: ignore ENOENT
  • Loading branch information
rhatdan authored Nov 2, 2020
2 parents 55e2a36 + b9172d0 commit b94b9f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,10 @@ wait_for_process (pid_t pid, libcrun_context_t *context, int terminal_fd, int no
conf.bundle_path = context->bundle;
conf.oci_config_path = oci_config_path;

ret = set_blocking_fd (seccomp_notify_fd, 0, err);
if (UNLIKELY (ret < 0))
return ret;

ret = libcrun_load_seccomp_notify_plugins (&seccomp_notify_ctx, seccomp_notify_plugins, &conf, err);
if (UNLIKELY (ret < 0))
return ret;
Expand Down
6 changes: 5 additions & 1 deletion src/libcrun/seccomp_notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ libcrun_seccomp_notify_plugins (struct seccomp_notify_context_s *ctx, int seccom

ret = ioctl (seccomp_fd, SECCOMP_IOCTL_NOTIF_RECV, ctx->sreq);
if (UNLIKELY (ret < 0))
return crun_make_error (err, errno, "ioctl");
{
if (errno == ENOENT)
return 0;
return crun_make_error (err, errno, "ioctl");
}

for (i = 0; i < ctx->n_plugins; i++)
{
Expand Down

0 comments on commit b94b9f6

Please sign in to comment.