Skip to content

Commit

Permalink
policycoreutils: make audit and pam support configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Zaman <[email protected]>
  • Loading branch information
perfinion authored and stephensmalley committed Apr 25, 2017
1 parent 2431fca commit b290a37
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions policycoreutils/newrole/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
ETCDIR ?= $(DESTDIR)/etc
LOCALEDIR = /usr/share/locale
PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
PAMH ?= $(shell test -f /usr/include/security/pam_appl.h && echo y)
AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y)
# Enable capabilities to permit newrole to generate audit records.
# This will make newrole a setuid root program.
# The capabilities used are: CAP_AUDIT_WRITE.
Expand All @@ -24,15 +24,15 @@ CFLAGS ?= -Werror -Wall -W
EXTRA_OBJS =
override CFLAGS += -DVERSION=\"$(VERSION)\" -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
LDLIBS += -lselinux
ifeq ($(PAMH), /usr/include/security/pam_appl.h)
ifeq ($(PAMH), y)
override CFLAGS += -DUSE_PAM
EXTRA_OBJS += hashtab.o
LDLIBS += -lpam -lpam_misc
else
override CFLAGS += -D_XOPEN_SOURCE=500
LDLIBS += -lcrypt
endif
ifeq ($(AUDITH), /usr/include/libaudit.h)
ifeq ($(AUDITH), y)
override CFLAGS += -DUSE_AUDIT
LDLIBS += -laudit
endif
Expand Down Expand Up @@ -66,7 +66,7 @@ install: all
test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
install -m $(MODE) newrole $(BINDIR)
install -m 644 newrole.1 $(MANDIR)/man1/
ifeq ($(PAMH), /usr/include/security/pam_appl.h)
ifeq ($(PAMH), y)
test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d
ifeq ($(LSPP_PRIV),y)
install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole
Expand Down
10 changes: 5 additions & 5 deletions policycoreutils/run_init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ SBINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man
ETCDIR ?= $(DESTDIR)/etc
LOCALEDIR ?= /usr/share/locale
PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
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\""
LDLIBS += -lselinux
ifeq ($(PAMH), /usr/include/security/pam_appl.h)
ifeq ($(PAMH), y)
override CFLAGS += -DUSE_PAM
LDLIBS += -lpam -lpam_misc
else
override CFLAGS += -D_XOPEN_SOURCE=500
LDLIBS += -lcrypt
endif
ifeq ($(AUDITH), /usr/include/libaudit.h)
ifeq ($(AUDITH), y)
override CFLAGS += -DUSE_AUDIT
LDLIBS += -laudit
endif
Expand All @@ -38,7 +38,7 @@ install: all
install -m 755 open_init_pty $(SBINDIR)
install -m 644 run_init.8 $(MANDIR)/man8/
install -m 644 open_init_pty.8 $(MANDIR)/man8/
ifeq ($(PAMH), /usr/include/security/pam_appl.h)
ifeq ($(PAMH), y)
install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
endif

Expand Down
4 changes: 2 additions & 2 deletions policycoreutils/setfiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ PREFIX ?= $(DESTDIR)/usr
SBINDIR ?= $(DESTDIR)/sbin
MANDIR = $(PREFIX)/share/man
LIBDIR ?= $(PREFIX)/lib
AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
AUDITH ?= $(shell test -f /usr/include/libaudit.h && echo y)

ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }')

CFLAGS ?= -g -Werror -Wall -W
LDLIBS = -lselinux -lsepol

ifeq ($(AUDITH), /usr/include/libaudit.h)
ifeq ($(AUDITH), y)
override CFLAGS += -DUSE_AUDIT
LDLIBS += -laudit
endif
Expand Down

0 comments on commit b290a37

Please sign in to comment.