Skip to content

Commit

Permalink
Change how sysconfdir is used to be more inline with how systems expect
Browse files Browse the repository at this point in the history
This reverts commit fab9947.
  • Loading branch information
ysyrota authored and AaronAtDuo committed Nov 7, 2024
1 parent 267d803 commit ac67381
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ AB_INIT
# Init header
AC_CONFIG_HEADER(config.h)

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

# Determine platform
AC_CANONICAL_HOST
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 ac67381

Please sign in to comment.