From 79612b5b2966c3316167d9cc51e1dfc23d146634 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Wed, 27 Aug 2014 09:37:38 +0200 Subject: [PATCH] break out util.c into it's own temporary library to make testing easier --- .gitignore | 18 +++++++++--------- Makefile.am | 17 +++++++++++------ pam_yubico.c | 3 +-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index ce800f0..862ccf0 100644 --- a/.gitignore +++ b/.gitignore @@ -27,17 +27,17 @@ m4/lt~obsolete.m4 missing pam_yubico-*.tar.gz pam_yubico-*.tar.gz.sig -pam_yubico.la -pam_yubico_la-drop_privs.lo -pam_yubico_la-pam_yubico.lo -pam_yubico_la-util.lo -test -test.o -ykpamcfg -ykpamcfg-util.o -ykpamcfg-ykpamcfg.o test-suite.log test.log test.trs pam_yubico.8 ykpamcfg.1 +drop_privs.lo +libpam_util.la +pam_yubico.la +pam_yubico.lo +tests/test +tests/test.o +util.lo +ykpamcfg +ykpamcfg.o diff --git a/Makefile.am b/Makefile.am index 2dfef4d..e29b9fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,16 +31,21 @@ SUBDIRS = . tests ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WARN_CFLAGS) +AM_CPPFLAGS = @YKPERS_CFLAGS@ libdir = $(PAMDIR) lib_LTLIBRARIES = pam_yubico.la -pam_yubico_la_SOURCES = pam_yubico.c util.h util.c drop_privs.h drop_privs.c +pam_yubico_la_SOURCES = pam_yubico.c drop_privs.h drop_privs.c # XXX add -Wl,-x too? PAM documentation suggests it. -pam_yubico_la_LIBADD = @LTLIBYKCLIENT@ @LIBLDAP@ @YKPERS_LIBS@ @LTLIBYUBIKEY@ -lpam +pam_yubico_la_LIBADD = @LTLIBYKCLIENT@ @LIBLDAP@ @YKPERS_LIBS@ -lpam +pam_yubico_la_LIBADD += libpam_util.la pam_yubico_la_LDFLAGS = -module -avoid-version -pam_yubico_la_CPPFLAGS = @YKPERS_CFLAGS@ + +noinst_LTLIBRARIES = libpam_util.la +libpam_util_la_SOURCES = util.c util.h +libpam_util_la_LIBADD = @LTLIBYUBIKEY@ DEFS = -DDEBUG_PAM -DPAM_DEBUG @DEFS@ @@ -50,9 +55,9 @@ if YKPERS bin_PROGRAMS = ykpamcfg endif -ykpamcfg_SOURCES = ykpamcfg.c util.c -ykpamcfg_LDADD = @LTLIBYKCLIENT@ @YKPERS_LIBS@ @LTLIBYUBIKEY@ -ykpamcfg_CPPFLAGS = @YKPERS_CFLAGS@ +ykpamcfg_SOURCES = ykpamcfg.c +ykpamcfg_LDADD = @YKPERS_LIBS@ +ykpamcfg_LDADD += libpam_util.la if YKPERS dist_man1_MANS = ykpamcfg.1 diff --git a/pam_yubico.c b/pam_yubico.c index a7ab2c0..dcbfeeb 100644 --- a/pam_yubico.c +++ b/pam_yubico.c @@ -46,8 +46,7 @@ #include "drop_privs.h" #if HAVE_CR -/* for yubikey_hex_decode and yubikey_hex_p */ -#include +/* for yubikey pbkdf2*/ #include #endif /* HAVE_CR */