Skip to content

Commit

Permalink
Change how sysconfdir is used to be more inline with how systems expe…
Browse files Browse the repository at this point in the history
…ct (#272)
  • Loading branch information
mbish authored Jan 30, 2024
1 parent 87c6454 commit 1c0a8d6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ licensedir = $(datadir)/LICENSES
dist_license_DATA = $(LICENSES)

# XXX - get around our default non-prefix-preserving paths for distcheck
DISTCHECK_CONFIGURE_FLAGS = --sysconfdir='$${prefix}/etc/duo'
DISTCHECK_CONFIGURE_FLAGS = --sysconfdir='$${prefix}/etc'
if PAM
DISTCHECK_CONFIGURE_FLAGS += --with-pam='$${prefix}/lib/security'
endif
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ AB_INIT
# Init header
AC_CONFIG_HEADER(config.h)

# Default sysconfdir to /etc/duo
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc/duo
# Default sysconfdir to /etc
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
AC_DEFINE_DIR([DUO_CONF_DIR], [sysconfdir], [Configuration directory])

# Determine platform
Expand Down
14 changes: 7 additions & 7 deletions login_duo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ install-exec-hook:
chmod 4755 $(DESTDIR)$(sbindir)/login_duo

install-data-local:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)
-@if [ ! -f $(DESTDIR)$(sysconfdir)/login_duo.conf ]; then \
cp login_duo.conf $(DESTDIR)$(sysconfdir)/login_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/login_duo.conf"; \
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/duo
-@if [ ! -f $(DESTDIR)$(sysconfdir)/duo/login_duo.conf ]; then \
cp login_duo.conf $(DESTDIR)$(sysconfdir)/duo/login_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/duo/login_duo.conf"; \
echo "Please edit it to add your Duo integration and secret keys"; \
else \
echo "Found existing ${DESTDIR}$(sysconfdir)/login_duo.conf - updating permissions"; \
echo "Found existing ${DESTDIR}$(sysconfdir)/duo/login_duo.conf - updating permissions"; \
fi
-chown $(DUO_PRIVSEP_USER) $(DESTDIR)$(sysconfdir)/login_duo.conf
-chmod 600 $(DESTDIR)$(sysconfdir)/login_duo.conf
-chown $(DUO_PRIVSEP_USER) $(DESTDIR)$(sysconfdir)/duo/login_duo.conf
-chmod 600 $(DESTDIR)$(sysconfdir)/duo/login_duo.conf

EXTRA_DIST = login_duo.conf
12 changes: 6 additions & 6 deletions pam_duo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ clean-local-semodule:


install-data-local:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)
-@if [ ! -f $(DESTDIR)$(sysconfdir)/pam_duo.conf ]; then \
cp pam_duo.conf $(DESTDIR)$(sysconfdir)/pam_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/pam_duo.conf"; \
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/duo
-@if [ ! -f $(DESTDIR)$(sysconfdir)/duo/pam_duo.conf ]; then \
cp pam_duo.conf $(DESTDIR)$(sysconfdir)/duo/pam_duo.conf; \
echo "Created ${DESTDIR}$(sysconfdir)/duo/pam_duo.conf"; \
echo "Please edit it to add your Duo integration and secret keys"; \
else \
echo "Found existing ${DESTDIR}$(sysconfdir)/pam_duo.conf - updating permissions"; \
echo "Found existing ${DESTDIR}$(sysconfdir)/duo/pam_duo.conf - updating permissions"; \
fi
-chmod 600 $(DESTDIR)$(sysconfdir)/pam_duo.conf
-chmod 600 $(DESTDIR)$(sysconfdir)/duo/pam_duo.conf
-@if test "x$(IS_AIX)" = "xyes"; then \
rm -f $(PAMDIR)/pam_duo.so; \
ar x $(top_builddir)/pam_duo/.libs/pam_duo.a $(PAMDIR)/pam_duo.so; \
Expand Down

0 comments on commit 1c0a8d6

Please sign in to comment.