Skip to content

Commit ebd0a7c

Browse files
authored
Merge pull request #10 from DrDaveD/probe-xattr
Use different xattr path such as on opensuse tumbleweed
2 parents a544173 + 731daf2 commit ebd0a7c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH) -I$(VPATH)/../li
2626
ifdef PERSISTENT_CHOWN
2727
CPPFLAGS += -DPERSISTENT_CHOWN
2828
CPPFLAGS += $(shell pkg-config --cflags libprotobuf-c)
29+
HAS_ATTR_XATTR := $(shell if [ -f /usr/include/attr/xattr.h ]; then echo -DHAS_ATTR_XATTR; fi)
30+
CPPFLAGS += ${HAS_ATTR_XATTR}
2931
endif
3032
CFLAGS += -g -Wall -Wextra -O2
3133
CFLAGS += $(shell pkg-config --cflags talloc)

src/extension/fake_id0/fake_id0.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646

4747
#if defined(PERSISTENT_CHOWN)
4848
#include <unistd.h>
49+
#if defined(HAS_ATTR_XATTR)
4950
#include <attr/xattr.h>
51+
#else
52+
#include <sys/xattr.h>
53+
#endif
5054
#include "path/path.h"
5155
#include "rootlesscontainers/rootlesscontainers.pb-c.h"
5256
#define XATTR_USER_ROOTLESSCONTAINERS "user.rootlesscontainers"

0 commit comments

Comments
 (0)