]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: warn when capabilities are disabled or libcap is not found 4512/head
authorSotir Danailov <sndanailov@gmail.com>
Wed, 8 Jan 2025 23:07:17 +0000 (00:07 +0100)
committerSotir Danailov <sndanailov@gmail.com>
Thu, 9 Jan 2025 22:43:24 +0000 (23:43 +0100)
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 <sndanailov@gmail.com>
src/lxc/conf.c

index 6a14c60360094b86d57ed2f7341e33fd5c52c415..1410ebe54a4b78e50e12879ae02c67eac386d017 100644 (file)
@@ -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;