Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | Ensure the XATTR_NAME_CAPS is defined when it is used |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | |
| 5 | VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build |
| 6 | libcap-native in old release, like CentOS release 6.7 (Final), with the blow |
| 7 | error: |
| 8 | cap_file.c: In function ‘cap_get_fd’: |
| 9 | cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function) |
| 10 | cap_file.c:199: error: (Each undeclared identifier is reported only once |
| 11 | |
| 12 | Signed-off-by: Roy Li <rongqing.li@windriver.com> |
| 13 | --- |
| 14 | libcap/cap_file.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/libcap/cap_file.c b/libcap/cap_file.c |
| 18 | index 40756ea..e27ca80 100644 |
| 19 | --- a/libcap/cap_file.c |
| 20 | +++ b/libcap/cap_file.c |
| 21 | @@ -25,7 +25,7 @@ extern int fremovexattr(int, const char *); |
| 22 | |
| 23 | #include "libcap.h" |
| 24 | |
| 25 | -#ifdef VFS_CAP_U32 |
| 26 | +#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS) |
| 27 | |
| 28 | #if VFS_CAP_U32 != __CAP_BLKS |
| 29 | # error VFS representation of capabilities is not the same size as kernel |
| 30 | -- |
| 31 | 2.8.1 |
| 32 | |