ret = lxc_seccomp_send_notifier_fd(&conf->seccomp, ap->ipc_socket);
if (ret < 0)
goto on_error;
+ lxc_seccomp_close_notifier_fd(&conf->seccomp);
}
if (!lxc_switch_uid_gid(ctx->target_ns_uid, ctx->target_ns_gid))
__hidden extern int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd);
__hidden extern int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
struct lxc_seccomp *seccomp);
+static inline void lxc_seccomp_close_notifier_fd(struct lxc_seccomp *seccomp)
+{
+#if HAVE_DECL_SECCOMP_NOTIFY_FD
+ if (seccomp->notifier.wants_supervision)
+ close_prot_errno_disarm(seccomp->notifier.notify_fd);
+#endif
+}
+
static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp)
{
#if HAVE_DECL_SECCOMP_NOTIFY_FD
return -EBADF;
}
+static inline void lxc_seccomp_close_notifier_fd(struct lxc_seccomp *seccomp)
+{
+}
+
#endif /* HAVE_SECCOMP */
#endif /* __LXC_LXCSECCOMP_H */
int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
struct lxc_seccomp *seccomp)
{
-
#if HAVE_DECL_SECCOMP_NOTIFY_FD
if (seccomp->notifier.wants_supervision) {
int ret;