Revision: 7987
http://sourceforge.net/p/astlinux/code/7987
Author: abelbeck
Date: 2016-11-25 22:14:13 +0000 (Fri, 25 Nov 2016)
Log Message:
-----------
libcap, add patch to build with < 3.0 kernels, since host-libcap is needed for libcap, this is required to support < 3.0 kernel build systems
Added Paths:
-----------
branches/1.0/package/libcap/libcap-0003-libcap-cap_file.c-fix-build-with-old-kernel-headers.patch
Added: branches/1.0/package/libcap/libcap-0003-libcap-cap_file.c-fix-build-with-old-kernel-headers.patch
===================================================================
--- branches/1.0/package/libcap/libcap-0003-libcap-cap_file.c-fix-build-with-old-kernel-headers.patch (rev 0)
+++ branches/1.0/package/libcap/libcap-0003-libcap-cap_file.c-fix-build-with-old-kernel-headers.patch 2016-11-25 22:14:13 UTC (rev 7987)
@@ -0,0 +1,51 @@
+From ace694e9574eb38e07cfe0db235434eb40003f47 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <tho...@fr...>
+Date: Mon, 14 Mar 2016 22:39:15 +0100
+Subject: [PATCH] libcap/cap_file.c: fix build with old kernel headers
+
+Signed-off-by: Thomas Petazzoni <tho...@fr...>
+---
+ libcap/cap_file.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/libcap/cap_file.c b/libcap/cap_file.c
+index 40756ea..e3d54dd 100644
+--- a/libcap/cap_file.c
++++ b/libcap/cap_file.c
+@@ -23,6 +23,33 @@ extern int fsetxattr(int, const char *, const void *, size_t, int);
+ extern int removexattr(const char *, const char *);
+ extern int fremovexattr(int, const char *);
+
++
++/*
++ * Old kernels (before 2.6.36) were defining XATTR_NAME_CAPS in
++ * <linux/capability.h>, but using XATTR_SECURITY_PREFIX and
++ * XATTR_CAPS_SUFFIX which were defined in the kernel-only part of
++ * <linux/xattr.h>.
++ *
++ * In kernel 2.6.36 (commit af4f136056c984b0aa67feed7d3170b958370b2f),
++ * the XATTR_NAME_CAPS definition was moved to the kernel-only part of
++ * <linux/xattr.h>. It's only in kernel 3.0 (commit
++ * 1dbe39424a43e56a6c9aed12661192af51dcdb9f) that <linux/xattr.h> was
++ * fixed to expose XATTR_NAME_CAPS and the related definitions to
++ * userspace.
++ *
++ * In order to cope with kernels < 3.0, we define here the appropriate
++ * values, which we assume haven't changed over history.
++ */
++#ifndef XATTR_CAPS_SUFFIX
++#define XATTR_CAPS_SUFFIX "capability"
++#endif
++#ifndef XATTR_SECURITY_PREFIX
++#define XATTR_SECURITY_PREFIX "security."
++#endif
++#ifndef XATTR_NAME_CAPS
++#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
++#endif
++
+ #include "libcap.h"
+
+ #ifdef VFS_CAP_U32
+--
+2.6.4
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|