-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlibcap-1.10-alt-userland.diff
60 lines (58 loc) · 1.42 KB
/
libcap-1.10-alt-userland.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff -uNp -r libcap-1.10.old/libcap/include/sys/capability.h libcap-1.10/libcap/include/sys/capability.h
--- libcap-1.10.old/libcap/include/sys/capability.h 1999-11-18 06:19:21 +0000
+++ libcap-1.10/libcap/include/sys/capability.h 2012-06-28 15:52:00 +0000
@@ -4,6 +4,7 @@
*
* Copyright (C) 1997 Aleph One
* Copyright (C) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org>
+ * Copyright (C) 2002-2003 Dmitry V. Levin <ldv at altlinux.org>
*
* defunct POSIX.1e Standard: 25.2 Capabilities <sys/capability.h>
*/
@@ -21,8 +22,48 @@ extern "C" {
*/
#include <sys/types.h>
+#include <stdint.h>
+#include <linux/types.h>
+
+/*
+ * Make sure we can be included from userland by preventing
+ * capability.h from including other kernel headers
+ */
+#ifndef __KERNEL__
+
+#undef _SYSCAP_OWN_LINUX_TYPES_H
+#undef _SYSCAP_OWN_LINUX_FS_H
+
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+#define _SYSCAP_OWN_LINUX_TYPES_H
+
+#include <stdint.h>
+typedef uint32_t __u32;
+
+#endif /* _LINUX_TYPES_H */
+
+#ifndef _LINUX_FS_H
+#define _LINUX_FS_H
+#define _SYSCAP_OWN_LINUX_FS_H
+#endif /* _LINUX_FS_H */
+
+#endif /* __KERNEL__ */
+
#include <linux/capability.h>
+#ifndef __KERNEL__
+
+#ifdef _SYSCAP_OWN_LINUX_TYPES_H
+#undef _LINUX_TYPES_H
+#endif /* _SYSCAP_OWN_LINUX_TYPES_H */
+
+#ifdef _SYSCAP_OWN_LINUX_FS_H
+#undef _LINUX_FS_H
+#endif /* _SYSCAP_OWN_LINUX_FS_H */
+
+#endif /* __KERNEL__ */
+
/*
* POSIX capability types
*/