Commit 656994bb by Matt Helsley Committed by Daniel Lezcano

liblxc: Handle missing PR_CAPBSET_DROP definition

On distros with older headers liblxc fails to build because PR_CAPBSET_DROP is not defined by including /usr/include/sys/prctl.h. This adds an autoconf test and, if not present, defines it. When prctl() is called on systems that do not support PR_CAPBSET_DROP we should expect EINVAL. This case is already handled by the liblxc code so no further changes are needed. Signed-off-by: 's avatarMatt Helsley <matthltc@us.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 54b1eb68
......@@ -27,6 +27,9 @@ AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h], [], AC_MSG_ERROR([netlink
AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
[#include <sys/capability.h>])
# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
AC_CHECK_HEADERS([sys/signalfd.h])
AC_PROG_GCC_TRADITIONAL
......
......@@ -48,6 +48,10 @@
extern int signalfd (int fd, const sigset_t *mask, int flags);
#endif
#if !HAVE_DECL_PR_CAPBSET_DROP
#define PR_CAPBSET_DROP 24
#endif
#include "error.h"
#include "af_unix.h"
#include "mainloop.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment