]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Merge pull request #3059 from brauner/2019-06-21/seccomp_notify
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 2 Jul 2019 02:04:20 +0000 (22:04 -0400)
committerGitHub <noreply@github.com>
Tue, 2 Jul 2019 02:04:20 +0000 (22:04 -0400)
lxccontainer: rework seccomp notify api function

src/lxc/lxccontainer.c
src/lxc/lxccontainer.h

index 98ea9798d88dbc1c7e0742d006ba102a2fc742d7..57a7adeced730cd4281a60ca2673a9a2940f53d8 100644 (file)
@@ -5248,23 +5248,15 @@ out:
        return ret;
 }
 
-static int do_lxcapi_seccomp_notify(struct lxc_container *c, unsigned int cmd, int fd)
+static int do_lxcapi_seccomp_notify_fd(struct lxc_container *c)
 {
        if (!c || !c->lxc_conf)
                return minus_one_set_errno(-EINVAL);
 
-       switch (cmd) {
-       case LXC_SECCOMP_NOTIFY_GET_FD:
-               if (fd)
-                       return minus_one_set_errno(EINVAL);
-
-               return lxc_seccomp_get_notify_fd(&c->lxc_conf->seccomp);
-       }
-
-       return minus_one_set_errno(EINVAL);
+       return lxc_seccomp_get_notify_fd(&c->lxc_conf->seccomp);
 }
 
-WRAP_API_2(int, lxcapi_seccomp_notify, unsigned int, int)
+WRAP_API(int, lxcapi_seccomp_notify_fd)
 
 struct lxc_container *lxc_container_new(const char *name, const char *configpath)
 {
@@ -5405,7 +5397,7 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
        c->console_log = lxcapi_console_log;
        c->mount = lxcapi_mount;
        c->umount = lxcapi_umount;
-       c->seccomp_notify = lxcapi_seccomp_notify;
+       c->seccomp_notify_fd = lxcapi_seccomp_notify_fd;
 
        return c;
 
index c367af81af50c3b6111ecabf891e4790586c7729..208667d408d7a10ef4247c7ee805eb1414c9733b 100644 (file)
@@ -60,11 +60,6 @@ struct lxc_mount {
        int version;
 };
 
-enum {
-       LXC_SECCOMP_NOTIFY_GET_FD = 0,
-       LXC_SECCOMP_NOTIFY_MAX,
-};
-
 /*!
  * An LXC container.
  *
@@ -873,7 +868,7 @@ struct lxc_container {
        int (*umount)(struct lxc_container *c, const char *target,
                      unsigned long mountflags, struct lxc_mount *mnt);
 
-       int (*seccomp_notify)(struct lxc_container *c, unsigned int cmd, int fd);
+       int (*seccomp_notify_fd)(struct lxc_container *c);
 };
 
 /*!