]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: don't support v2 if seccomp_syscall_resolve_name_arch is not avilable
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 12 Feb 2014 23:20:22 +0000 (17:20 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 12 Feb 2014 23:31:52 +0000 (18:31 -0500)
Also don't use arm arch if not defined

This *should* fix build so precise, but I didn't fire one off.
I did test that builds with libseccomp2 still work as expected.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
src/lxc/seccomp.c

index 21e6046186fbe3d1a3ce7ecf70a50c0ee0adaf92..eb7b32fd76ae3ea50bf795a07de174d53ccde7ee 100644 (file)
@@ -274,6 +274,7 @@ AM_COND_IF([ENABLE_CAP],
 OLD_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $SECCOMP_CFLAGS"
 AC_CHECK_TYPES([scmp_filter_ctx], [], [], [[#include <seccomp.h>]])
+AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [], [[#include <seccomp.h>]])
 CFLAGS="$OLD_CFLAGS"
 
 # Configuration examples
index 4c01be73b536012c3ed8fe090117e44bbc459d0e..d75defecfd9310bafe4bcc96c28775a688c876f7 100644 (file)
@@ -57,6 +57,7 @@ static int parse_config_v1(FILE *f, struct lxc_conf *conf)
        return 0;
 }
 
+#if HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH
 static void remove_trailing_newlines(char *l)
 {
        char *p = l;
@@ -109,6 +110,7 @@ static uint32_t get_and_clear_v2_action(char *line, uint32_t def_action)
        default: return ret;
        }
 }
+#endif
 
 /*
  * v2 consists of
@@ -126,7 +128,7 @@ static uint32_t get_and_clear_v2_action(char *line, uint32_t def_action)
  */
 static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf)
 {
-#if HAVE_SCMP_FILTER_CTX
+#if HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH
        char *p;
        int ret;
        scmp_filter_ctx *ctx = NULL;
@@ -189,9 +191,11 @@ static int parse_config_v2(FILE *f, char *line, struct lxc_conf *conf)
                        else if (strcmp(line, "[X86_64]") == 0 ||
                                        strcmp(line, "[x86_64]") == 0)
                                arch = SCMP_ARCH_X86_64;
+#ifdef SCMP_ARCH_ARM
                        else if (strcmp(line, "[arm]") == 0 ||
                                        strcmp(line, "[ARM]") == 0)
                                arch = SCMP_ARCH_ARM;
+#endif
                        else
                                goto bad_arch;
                        if (ctx) {