lxc / lxc

LXC - Linux Containers
https://linuxcontainers.org/lxc
Other
4.53k stars 1.12k forks source link

lxc-attach prints warning: Invalid argument - Unsupported config key "lxc.seccomp" #4444

Open gideonda1 opened 1 month ago

gideonda1 commented 1 month ago

Summary:

Every time we run lxc-attach -n 0 on our system (0 is the name of the container), we get: ... Unsupported config key "lxc.seccomp".

Required information

Issue description

Every time we run "lxc-attach -n 0" on our system (0 is the name of the container), we get the warning message:

lxc-attach: 0: ../../src/lxc/confile.c: set_config_unsupported_key: 164 Invalid argument - Unsupported config key "lxc.seccomp".

Container '0' has a config file created from a template. That template doesn't have any 'seccomp' related options in it, and we don't compile it with seccomp support.

But it seems like it doesn't matter to the src/lxc/attach.c code, because it seems to check regardless of whether seccomp is supported/compiled in:

if (!fetch_seccomp(ctx->container, options))
    WARN("Failed to get seccomp policy");

This code is always called near the beginning of the function int lxc_attach(). Should this warning be masked if the user does not intend on using seccomp and/or doesn't have it compiled in?

gideonda1 commented 1 month ago

PS: I managed to suppress the warning message with an ifdef wrapper. I'm not sure if this is the correct way to do it.

#if HAVE_SECCOMP
if (!fetch_seccomp(ctx->container, options))
    WARN("Failed to get seccomp policy");
#endif