summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2020-08-11 14:54:29 -0700
committerSteve Langasek <steve.langasek@canonical.com>2020-08-11 14:54:29 -0700
commitf6d08ed47a3da3c08345bce2ca366e961c52ad7c (patch)
treedcbd0efb229b17f696f7195671f05b354b4f70fc /tests
parent668b13da8f830c38388cecac45539972e80cb246 (diff)
parent9e5bea9e146dee574796259ca464ad2435be3590 (diff)
New upstream version 1.4.0
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/Makefile.in187
-rw-r--r--tests/confdir1
-rw-r--r--tests/tst-pam_get_item.c10
-rw-r--r--tests/tst-pam_mkargv.c8
-rw-r--r--tests/tst-pam_set_data.c2
-rw-r--r--tests/tst-pam_set_item.c8
-rw-r--r--tests/tst-pam_start_confdir.c99
8 files changed, 256 insertions, 65 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7fb62dea..a33d3d8d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,7 @@
#
AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \
- -I$(top_srcdir)/libpam
+ -I$(top_srcdir)/libpam $(WARN_CFLAGS)
LDADD = $(top_builddir)/libpam/libpam.la
CLEANFILES = *~
@@ -12,7 +12,9 @@ TESTS = tst-pam_start tst-pam_end tst-pam_fail_delay tst-pam_open_session \
tst-pam_close_session tst-pam_acct_mgmt tst-pam_authenticate \
tst-pam_chauthtok tst-pam_setcred tst-pam_get_item tst-pam_set_item \
tst-pam_getenvlist tst-pam_get_user tst-pam_set_data \
- tst-pam_mkargv
+ tst-pam_mkargv tst-pam_start_confdir
+
+EXTRA_DIST = confdir
check_PROGRAMS = ${TESTS} tst-dlopen
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 980ed061..09b560d0 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,17 @@
# Copyright (c) 2006, 2009 Thorsten Kukuk <kukuk@suse.de>
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -88,12 +98,9 @@ TESTS = tst-pam_start$(EXEEXT) tst-pam_end$(EXEEXT) \
tst-pam_setcred$(EXEEXT) tst-pam_get_item$(EXEEXT) \
tst-pam_set_item$(EXEEXT) tst-pam_getenvlist$(EXEEXT) \
tst-pam_get_user$(EXEEXT) tst-pam_set_data$(EXEEXT) \
- tst-pam_mkargv$(EXEEXT)
+ tst-pam_mkargv$(EXEEXT) tst-pam_start_confdir$(EXEEXT)
check_PROGRAMS = $(am__EXEEXT_1) tst-dlopen$(EXEEXT)
subdir = tests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/build-aux/depcomp \
- $(top_srcdir)/build-aux/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
@@ -109,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -120,7 +128,7 @@ am__EXEEXT_1 = tst-pam_start$(EXEEXT) tst-pam_end$(EXEEXT) \
tst-pam_setcred$(EXEEXT) tst-pam_get_item$(EXEEXT) \
tst-pam_set_item$(EXEEXT) tst-pam_getenvlist$(EXEEXT) \
tst-pam_get_user$(EXEEXT) tst-pam_set_data$(EXEEXT) \
- tst-pam_mkargv$(EXEEXT)
+ tst-pam_mkargv$(EXEEXT) tst-pam_start_confdir$(EXEEXT)
tst_dlopen_SOURCES = tst-dlopen.c
tst_dlopen_OBJECTS = tst-dlopen.$(OBJEXT)
tst_dlopen_DEPENDENCIES =
@@ -188,6 +196,10 @@ tst_pam_start_SOURCES = tst-pam_start.c
tst_pam_start_OBJECTS = tst-pam_start.$(OBJEXT)
tst_pam_start_LDADD = $(LDADD)
tst_pam_start_DEPENDENCIES = $(top_builddir)/libpam/libpam.la
+tst_pam_start_confdir_SOURCES = tst-pam_start_confdir.c
+tst_pam_start_confdir_OBJECTS = tst-pam_start_confdir.$(OBJEXT)
+tst_pam_start_confdir_LDADD = $(LDADD)
+tst_pam_start_confdir_DEPENDENCIES = $(top_builddir)/libpam/libpam.la
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -202,7 +214,22 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/tst-dlopen.Po \
+ ./$(DEPDIR)/tst-pam_acct_mgmt.Po \
+ ./$(DEPDIR)/tst-pam_authenticate.Po \
+ ./$(DEPDIR)/tst-pam_chauthtok.Po \
+ ./$(DEPDIR)/tst-pam_close_session.Po \
+ ./$(DEPDIR)/tst-pam_end.Po ./$(DEPDIR)/tst-pam_fail_delay.Po \
+ ./$(DEPDIR)/tst-pam_get_item.Po \
+ ./$(DEPDIR)/tst-pam_get_user.Po \
+ ./$(DEPDIR)/tst-pam_getenvlist.Po \
+ ./$(DEPDIR)/tst-pam_mkargv.Po \
+ ./$(DEPDIR)/tst-pam_open_session.Po \
+ ./$(DEPDIR)/tst-pam_set_data.Po \
+ ./$(DEPDIR)/tst-pam_set_item.Po ./$(DEPDIR)/tst-pam_setcred.Po \
+ ./$(DEPDIR)/tst-pam_start.Po \
+ ./$(DEPDIR)/tst-pam_start_confdir.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -227,13 +254,13 @@ SOURCES = tst-dlopen.c tst-pam_acct_mgmt.c tst-pam_authenticate.c \
tst-pam_fail_delay.c tst-pam_get_item.c tst-pam_get_user.c \
tst-pam_getenvlist.c tst-pam_mkargv.c tst-pam_open_session.c \
tst-pam_set_data.c tst-pam_set_item.c tst-pam_setcred.c \
- tst-pam_start.c
+ tst-pam_start.c tst-pam_start_confdir.c
DIST_SOURCES = tst-dlopen.c tst-pam_acct_mgmt.c tst-pam_authenticate.c \
tst-pam_chauthtok.c tst-pam_close_session.c tst-pam_end.c \
tst-pam_fail_delay.c tst-pam_get_item.c tst-pam_get_user.c \
tst-pam_getenvlist.c tst-pam_mkargv.c tst-pam_open_session.c \
tst-pam_set_data.c tst-pam_set_item.c tst-pam_setcred.c \
- tst-pam_start.c
+ tst-pam_start.c tst-pam_start_confdir.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -462,6 +489,9 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -490,6 +520,8 @@ DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
+ECONF_CFLAGS = @ECONF_CFLAGS@
+ECONF_LIBS = @ECONF_LIBS@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
@@ -498,7 +530,6 @@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
-HAVE_KEY_MANAGEMENT = @HAVE_KEY_MANAGEMENT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -534,6 +565,7 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -570,11 +602,13 @@ SECUREDIR = @SECUREDIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+STRINGPARAM_VENDORDIR = @STRINGPARAM_VENDORDIR@
STRIP = @STRIP@
TIRPC_CFLAGS = @TIRPC_CFLAGS@
TIRPC_LIBS = @TIRPC_LIBS@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
@@ -642,10 +676,11 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \
- -I$(top_srcdir)/libpam
+ -I$(top_srcdir)/libpam $(WARN_CFLAGS)
LDADD = $(top_builddir)/libpam/libpam.la
CLEANFILES = *~
+EXTRA_DIST = confdir
tst_dlopen_LDADD = -ldl
all: all-am
@@ -663,14 +698,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -755,42 +789,53 @@ tst-pam_start$(EXEEXT): $(tst_pam_start_OBJECTS) $(tst_pam_start_DEPENDENCIES) $
@rm -f tst-pam_start$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_pam_start_OBJECTS) $(tst_pam_start_LDADD) $(LIBS)
+tst-pam_start_confdir$(EXEEXT): $(tst_pam_start_confdir_OBJECTS) $(tst_pam_start_confdir_DEPENDENCIES) $(EXTRA_tst_pam_start_confdir_DEPENDENCIES)
+ @rm -f tst-pam_start_confdir$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_pam_start_confdir_OBJECTS) $(tst_pam_start_confdir_LDADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-dlopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_acct_mgmt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authenticate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_chauthtok.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_close_session.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_end.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_fail_delay.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_get_item.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_get_user.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_getenvlist.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_mkargv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_open_session.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_set_data.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_set_item.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_setcred.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_start.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-dlopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_acct_mgmt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authenticate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_chauthtok.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_close_session.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_end.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_fail_delay.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_get_item.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_get_user.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_getenvlist.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_mkargv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_open_session.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_set_data.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_set_item.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_setcred.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_start.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_start_confdir.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -887,7 +932,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
- else \
+ elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
@@ -977,7 +1022,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
fi; \
$$success || exit 1
-check-TESTS:
+check-TESTS: $(check_PROGRAMS)
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -1103,6 +1148,13 @@ tst-pam_mkargv.log: tst-pam_mkargv$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst-pam_start_confdir.log: tst-pam_start_confdir$(EXEEXT)
+ @p='tst-pam_start_confdir$(EXEEXT)'; \
+ b='tst-pam_start_confdir'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
@@ -1118,7 +1170,10 @@ tst-pam_mkargv.log: tst-pam_mkargv$(EXEEXT)
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -1194,7 +1249,23 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tst-dlopen.Po
+ -rm -f ./$(DEPDIR)/tst-pam_acct_mgmt.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authenticate.Po
+ -rm -f ./$(DEPDIR)/tst-pam_chauthtok.Po
+ -rm -f ./$(DEPDIR)/tst-pam_close_session.Po
+ -rm -f ./$(DEPDIR)/tst-pam_end.Po
+ -rm -f ./$(DEPDIR)/tst-pam_fail_delay.Po
+ -rm -f ./$(DEPDIR)/tst-pam_get_item.Po
+ -rm -f ./$(DEPDIR)/tst-pam_get_user.Po
+ -rm -f ./$(DEPDIR)/tst-pam_getenvlist.Po
+ -rm -f ./$(DEPDIR)/tst-pam_mkargv.Po
+ -rm -f ./$(DEPDIR)/tst-pam_open_session.Po
+ -rm -f ./$(DEPDIR)/tst-pam_set_data.Po
+ -rm -f ./$(DEPDIR)/tst-pam_set_item.Po
+ -rm -f ./$(DEPDIR)/tst-pam_setcred.Po
+ -rm -f ./$(DEPDIR)/tst-pam_start.Po
+ -rm -f ./$(DEPDIR)/tst-pam_start_confdir.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -1240,7 +1311,23 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tst-dlopen.Po
+ -rm -f ./$(DEPDIR)/tst-pam_acct_mgmt.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authenticate.Po
+ -rm -f ./$(DEPDIR)/tst-pam_chauthtok.Po
+ -rm -f ./$(DEPDIR)/tst-pam_close_session.Po
+ -rm -f ./$(DEPDIR)/tst-pam_end.Po
+ -rm -f ./$(DEPDIR)/tst-pam_fail_delay.Po
+ -rm -f ./$(DEPDIR)/tst-pam_get_item.Po
+ -rm -f ./$(DEPDIR)/tst-pam_get_user.Po
+ -rm -f ./$(DEPDIR)/tst-pam_getenvlist.Po
+ -rm -f ./$(DEPDIR)/tst-pam_mkargv.Po
+ -rm -f ./$(DEPDIR)/tst-pam_open_session.Po
+ -rm -f ./$(DEPDIR)/tst-pam_set_data.Po
+ -rm -f ./$(DEPDIR)/tst-pam_set_item.Po
+ -rm -f ./$(DEPDIR)/tst-pam_setcred.Po
+ -rm -f ./$(DEPDIR)/tst-pam_start.Po
+ -rm -f ./$(DEPDIR)/tst-pam_start_confdir.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1261,20 +1348,22 @@ uninstall-am:
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
- clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/confdir b/tests/confdir
new file mode 100644
index 00000000..3883c869
--- /dev/null
+++ b/tests/confdir
@@ -0,0 +1 @@
+# This is an empty pam service file for tst-pam_start_confdir
diff --git a/tests/tst-pam_get_item.c b/tests/tst-pam_get_item.c
index e6c98a0f..2b0cc7e2 100644
--- a/tests/tst-pam_get_item.c
+++ b/tests/tst-pam_get_item.c
@@ -39,6 +39,7 @@
#include <unistd.h>
#include <security/pam_appl.h>
+#include "pam_inline.h"
struct mapping {
int type;
@@ -67,7 +68,8 @@ main (void)
const char *user = "root";
struct pam_conv conv;
pam_handle_t *pamh;
- int retval, num, i;
+ int retval;
+ unsigned int i;
const void *value;
/* 1: Call with NULL as pam handle */
@@ -89,9 +91,7 @@ main (void)
/* 2: check for valid item types. Expected return value is
PAM_SUCCESS, except it has to fail. */
- num = sizeof(items) / sizeof(struct mapping);
-
- for (i = 0; i < num; i++)
+ for (i = 0; i < PAM_ARRAY_SIZE(items); i++)
{
retval = pam_get_item (pamh, items[i].type, &value);
@@ -115,7 +115,7 @@ main (void)
}
/* 4: check for valid item types, but NULL as value address. */
- for (i = 0; i < num; i++)
+ for (i = 0; i < PAM_ARRAY_SIZE(items); i++)
{
retval = pam_get_item (pamh, items[i].type, NULL);
diff --git a/tests/tst-pam_mkargv.c b/tests/tst-pam_mkargv.c
index d3e7a616..cb005e5f 100644
--- a/tests/tst-pam_mkargv.c
+++ b/tests/tst-pam_mkargv.c
@@ -18,16 +18,16 @@
/* Simple program to see if _pam_mkargv() would succeed. */
int main(void)
{
- char *argvstring = "user = XENDT\\userα user=XENDT\\user1";
- const char *argvresult[] = {"user", "=", "XENDT\\userα",
- "user=XENDT\\user1"};
+ static const char argvstring[] = "user = XENDT\\userα user=XENDT\\user1";
+ static const char * const argvresult[] = {"user", "=", "XENDT\\userα",
+ "user=XENDT\\user1"};
int myargc;
char **myargv;
int argvlen;
int explen;
int i;
- explen = (strlen(argvstring) + 1) * ((sizeof(char)) + sizeof(char *));
+ explen = sizeof(argvstring) * ((sizeof(char)) + sizeof(char *));
argvlen = _pam_mkargv(argvstring, &myargv, &myargc);
#if 0
diff --git a/tests/tst-pam_set_data.c b/tests/tst-pam_set_data.c
index 3b30dcc1..9acab6a6 100644
--- a/tests/tst-pam_set_data.c
+++ b/tests/tst-pam_set_data.c
@@ -331,7 +331,7 @@ main (void)
if (retval == PAM_SUCCESS)
{
fprintf (stderr,
- "pam_set_data with NULL as module_data_name succeded!\n");
+ "pam_set_data with NULL as module_data_name succeeded!\n");
return 1;
}
free (dataptr);
diff --git a/tests/tst-pam_set_item.c b/tests/tst-pam_set_item.c
index f8f271d1..bd17e11a 100644
--- a/tests/tst-pam_set_item.c
+++ b/tests/tst-pam_set_item.c
@@ -40,6 +40,7 @@
#include <string.h>
#include <security/pam_appl.h>
+#include "pam_inline.h"
struct mapping {
int type;
@@ -68,7 +69,8 @@ main (void)
const char *user = "root";
struct pam_conv conv;
pam_handle_t *pamh;
- int retval, num, i;
+ int retval;
+ unsigned int i;
/* 1: Call with NULL as pam handle */
retval = pam_set_item (NULL, PAM_SERVICE, "dummy");
@@ -108,9 +110,7 @@ main (void)
}
/* 4: try to replace all items */
- num = sizeof(items) / sizeof(struct mapping);
-
- for (i = 0; i < num; i++)
+ for (i = 0; i < PAM_ARRAY_SIZE(items); i++)
{
retval = pam_set_item (pamh, items[i].type, items[i].new_value);
diff --git a/tests/tst-pam_start_confdir.c b/tests/tst-pam_start_confdir.c
new file mode 100644
index 00000000..e40b6e70
--- /dev/null
+++ b/tests/tst-pam_start_confdir.c
@@ -0,0 +1,99 @@
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, and the entire permission notice in its entirety,
+ * including the disclaimer of warranties.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * ALTERNATIVELY, this product may be distributed under the terms of
+ * the GNU Public License, in which case the provisions of the GPL are
+ * required INSTEAD OF the above restrictions. (This clause is
+ * necessary due to a potential bad interaction between the GPL and
+ * the restrictions contained in a BSD-style copyright.)
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <security/pam_appl.h>
+
+
+int
+main (void)
+{
+ const char *service = "confdir";
+ const char *xservice = "nonexistent-service";
+ const char *user = "root";
+ const char *confdir;
+ const char *xconfdir = "/nonexistent-confdir";
+ struct pam_conv conv;
+ pam_handle_t *pamh;
+ int retval;
+
+ confdir = getenv("srcdir");
+
+ if (confdir == NULL)
+ {
+ fprintf (stderr, "Error: srcdir not set\n");
+ return 1;
+ }
+
+ /* 1: check with valid arguments */
+ retval = pam_start_confdir (service, user, &conv, confdir, &pamh);
+ if (retval != PAM_SUCCESS)
+ {
+ fprintf (stderr, "pam_start_confdir (%s, %s, &conv, %s, &pamh) returned %d\n",
+ service, user, confdir, retval);
+ return 1;
+ }
+ else if (pamh == NULL)
+ {
+ fprintf (stderr, "pam_start_confdir (%s, %s, &conv, %s, &pamh) returned NULL for pamh\n",
+ service, user, confdir);
+ return 1;
+ }
+
+ /* 2: check with invalid service */
+ retval = pam_start_confdir (xservice, user, &conv, confdir, &pamh);
+ if (retval == PAM_SUCCESS)
+ {
+ fprintf (stderr, "pam_start_confdir (%s, %s, &conv, %s, &pamh) incorrectly succeeded\n",
+ xservice, user, confdir);
+ return 1;
+ }
+
+ /* 3: check with invalid confdir */
+ retval = pam_start_confdir (service, user, &conv, xconfdir, &pamh);
+ if (retval == PAM_SUCCESS)
+ {
+ fprintf (stderr, "pam_start_confdir (%s, %s, &conv, %s, &pamh) incorrectly succeeded\n",
+ service, user, xconfdir);
+ return 1;
+ }
+
+ return 0;
+}