From 8d8fd27b57bf1ebc9cdbf129547961339dd45b8b Mon Sep 17 00:00:00 2001 From: Sotir Danailov Date: Thu, 9 Jan 2025 00:07:17 +0100 Subject: [PATCH] conf: warn when capabilities are disabled or libcap is not found The reason for this warning, is that the project will compile and when it does not work, it's not clear from the logs what the reason might be. Signed-off-by: Sotir Danailov --- src/lxc/conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 6a14c6036..1410ebe54 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2944,6 +2944,10 @@ int parse_cap(const char *cap_name, __u32 *cap) if (strequal(cap_name, "none")) return -2; +#if HAVE_LIBCAP == 0 + WARN("capabilities are disabled or libcap not found"); +#endif + for (size_t i = 0; i < end; i++) { if (!strequal(cap_name, caps_opt[i].name)) continue; -- 2.47.2