Skip to content

Don't inject matchpathcon_filespec_add64() ifdef __x86_64__ (#463, Debian#1098481) #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libselinux/include/selinux/selinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ extern int matchpathcon_index(const char *path,
with the same inode (e.g. due to multiple hard links). If so, then
use the latter of the two specifications based on their order in the
file contexts configuration. Return the used specification index. */
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && __BITS_PER_LONG < 64
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && !defined(__INO_T_MATCHES_INO64_T)
#define matchpathcon_filespec_add matchpathcon_filespec_add64
#endif
extern int matchpathcon_filespec_add(ino_t ino, int specind, const char *file);
Expand Down
8 changes: 6 additions & 2 deletions libselinux/src/matchpathcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int matchpathcon_filespec_add(ino_t ino, int specind, const char *file)
return -1;
}

#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && __BITS_PER_LONG < 64
#if (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && !defined(__INO_T_MATCHES_INO64_T)
/* alias defined in the public header but we undefine it here */
#undef matchpathcon_filespec_add

Expand All @@ -280,9 +280,13 @@ int matchpathcon_filespec_add(unsigned long ino, int specind,
{
return matchpathcon_filespec_add64(ino, specind, file);
}
#elif (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) || defined(__INO_T_MATCHES_INO64_T)

static_assert(sizeof(uint64_t) == sizeof(ino_t), "inode size mismatch");

#else

static_assert(sizeof(unsigned long) == sizeof(ino_t), "inode size mismatch");
static_assert(sizeof(uint32_t) == sizeof(ino_t), "inode size mismatch");

#endif

Expand Down
4 changes: 2 additions & 2 deletions libsemanage/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-
SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
-Wno-unused-parameter -Wno-missing-prototypes

override CFLAGS += -I../include -D_GNU_SOURCE
override CFLAGS += -I../include -I../../libselinux/include -D_GNU_SOURCE
RANLIB ?= ranlib

SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
Expand Down Expand Up @@ -90,7 +90,7 @@ $(LIBA): $(OBJS)
$(RANLIB) $@

$(LIBSO): $(LOBJS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L../../libselinux/src -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
ln -sf $@ $(TARGET)

$(LIBPC): $(LIBPC).in ../VERSION
Expand Down
2 changes: 2 additions & 0 deletions mcstrans/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ PROG_OBJS= $(patsubst %.c,%.o,$(PROG_SRC))
PROG=mcstransd
INITSCRIPT=mcstrans
CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
override CFLAGS += -I../../libselinux/include
override LDFLAGS+= -L../../libselinux/src

all: $(PROG)

Expand Down
3 changes: 3 additions & 0 deletions mcstrans/utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
PREFIX ?= /usr
SBINDIR ?= $(PREFIX)/sbin

override CFLAGS += -I../../libselinux/include
override LDFLAGS+= -L../../libselinux/src

TARGETS=transcon untranscon

# If no specific libsepol.a is specified, fall back on LDFLAGS search path
Expand Down
2 changes: 1 addition & 1 deletion policycoreutils/load_policy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MANDIR ?= $(PREFIX)/share/man
LOCALEDIR ?= $(DESTDIR)$(PREFIX)/share/locale

CFLAGS ?= -Werror -Wall -W
override CFLAGS += $(LDFLAGS) -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override CFLAGS += $(LDFLAGS) -I../../libselinux/include -L../../libselinux/src -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override LDLIBS += -lsepol -lselinux

TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/newrole/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ VERSION = $(shell cat ../VERSION)

CFLAGS ?= -Werror -Wall -W
EXTRA_OBJS =
override CFLAGS += -DVERSION=\"$(VERSION)\" -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override CFLAGS += -I../../libselinux/include -DVERSION=\"$(VERSION)\" -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux
ifeq ($(PAMH), y)
override CFLAGS += -DUSE_PAM
Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/run_init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y)
AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y)

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override CFLAGS += -I../../libselinux/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux
ifeq ($(PAMH), y)
override CFLAGS += -DUSE_PAM
Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/secon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ MANDIR ?= $(PREFIX)/share/man
WARNS=-Werror -W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
VERSION = $(shell cat ../VERSION)
CFLAGS ?= $(WARNS) -O1
override CFLAGS += -DVERSION=\"$(VERSION)\"
override CFLAGS += -I../../libselinux/include -DVERSION=\"$(VERSION)\"
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux

all: secon
Expand Down
2 changes: 2 additions & 0 deletions policycoreutils/semodule/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SBINDIR ?= $(PREFIX)/sbin
MANDIR = $(PREFIX)/share/man

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I../../libselinux/include -I../../libsemanage/include
override LDFLAGS+= -L../../libselinux/src -L../../libsemanage/src
override LDLIBS += -lsepol -lselinux -lsemanage
SEMODULE_OBJS = semodule.o

Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/sestatus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ MANDIR = $(PREFIX)/share/man
ETCDIR ?= /etc

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -D_FILE_OFFSET_BITS=64
override CFLAGS += -I../../libselinux/include -D_FILE_OFFSET_BITS=64
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux

all: sestatus
Expand Down
2 changes: 2 additions & 0 deletions policycoreutils/setfiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ MANDIR = $(PREFIX)/share/man
AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y)

CFLAGS ?= -g -Werror -Wall -W
override CFLAGS += -I../../libselinux/include
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux -lsepol -lpthread

ifeq ($(AUDITH), y)
Expand Down
2 changes: 2 additions & 0 deletions policycoreutils/setsebool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ MANDIR = $(PREFIX)/share/man
BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I../../libselinux/include -I../../libsemanage/include
override LDFLAGS+= -L../../libselinux/src -L../../libsemanage/src
override LDLIBS += -lselinux -lsemanage
SETSEBOOL_OBJS = setsebool.o

Expand Down
3 changes: 2 additions & 1 deletion policycoreutils/unsetfiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ PREFIX ?= /usr
SBINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man

override CFLAGS += -D_GNU_SOURCE
override CFLAGS += -I../../libselinux/include -D_GNU_SOURCE
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux


Expand Down
2 changes: 2 additions & 0 deletions python/audit2allow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

CFLAGS ?= -Werror -Wall -W
override CFLAGS += -I../../libselinux/include
override LDFLAGS+= -L../../libselinux/src

# If no specific libsepol.a is specified, fall back on LDFLAGS search path
# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
Expand Down
4 changes: 2 additions & 2 deletions restorecond/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ GIO_CFLAGS = -DHAVE_DBUS $(shell $(PKG_CONFIG) --cflags gio-2.0)
GIO_LIBS = $(shell $(PKG_CONFIG) --libs gio-2.0)

CFLAGS ?= -g -Werror -Wall -W
override CFLAGS += $(GIO_CFLAGS)

override CFLAGS += -I../../libselinux/include $(GIO_CFLAGS)
override LDFLAGS+= -L../../libselinux/src
override LDLIBS += -lselinux $(GIO_LIBS)

all: restorecond
Expand Down