aboutsummaryrefslogtreecommitdiff
path: root/xtests
diff options
context:
space:
mode:
Diffstat (limited to 'xtests')
-rw-r--r--xtests/Makefile.am10
-rw-r--r--xtests/Makefile.in220
-rwxr-xr-xxtests/run-xtests.sh8
-rw-r--r--xtests/tst-pam_motd.c69
-rwxr-xr-xxtests/tst-pam_motd.sh8
-rw-r--r--xtests/tst-pam_motd1.pamd3
-rwxr-xr-xxtests/tst-pam_motd1.sh36
-rw-r--r--xtests/tst-pam_motd2.pamd3
-rwxr-xr-xxtests/tst-pam_motd2.sh53
-rw-r--r--xtests/tst-pam_motd3.pamd3
-rwxr-xr-xxtests/tst-pam_motd3.sh53
-rw-r--r--xtests/tst-pam_motd4.pamd3
-rwxr-xr-xxtests/tst-pam_motd4.sh27
-rw-r--r--xtests/tst-pam_pwhistory1.c12
-rw-r--r--xtests/tst-pam_time1.c7
15 files changed, 439 insertions, 76 deletions
diff --git a/xtests/Makefile.am b/xtests/Makefile.am
index a6d6f8db..2e942e8d 100644
--- a/xtests/Makefile.am
+++ b/xtests/Makefile.am
@@ -3,7 +3,8 @@
#
AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \
- -I$(top_srcdir)/libpamc/include -I$(top_srcdir)/libpam_misc/include
+ -I$(top_srcdir)/libpamc/include -I$(top_srcdir)/libpam_misc/include \
+ $(WARN_CFLAGS)
LDADD = $(top_builddir)/libpam/libpam.la \
$(top_builddir)/libpam_misc/libpam_misc.la
@@ -32,7 +33,10 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh \
tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh \
tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh \
- tst-pam_time1.pamd time.conf
+ tst-pam_time1.pamd time.conf \
+ tst-pam_motd.sh tst-pam_motd1.sh tst-pam_motd2.sh \
+ tst-pam_motd3.sh tst-pam_motd4.sh tst-pam_motd1.pamd \
+ tst-pam_motd2.pamd tst-pam_motd3.pamd tst-pam_motd4.pamd
XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \
tst-pam_dispatch4 tst-pam_dispatch5 \
@@ -41,7 +45,7 @@ XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \
tst-pam_access1 tst-pam_access2 tst-pam_access3 \
tst-pam_access4 tst-pam_limits1 tst-pam_succeed_if1 \
tst-pam_group1 tst-pam_authfail tst-pam_authsucceed \
- tst-pam_pwhistory1 tst-pam_time1
+ tst-pam_pwhistory1 tst-pam_time1 tst-pam_motd
NOSRCTESTS = tst-pam_substack1 tst-pam_substack2 tst-pam_substack3 \
tst-pam_substack4 tst-pam_substack5 tst-pam_assemble_line1
diff --git a/xtests/Makefile.in b/xtests/Makefile.in
index 4325d0d6..02723870 100644
--- a/xtests/Makefile.in
+++ b/xtests/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 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 \
?) ;; \
@@ -83,8 +93,6 @@ build_triplet = @build@
host_triplet = @host@
EXTRA_PROGRAMS = $(am__EXEEXT_1)
subdir = xtests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/build-aux/depcomp
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 \
@@ -100,6 +108,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 =
@@ -114,7 +123,8 @@ am__EXEEXT_1 = tst-pam_dispatch1$(EXEEXT) tst-pam_dispatch2$(EXEEXT) \
tst-pam_access4$(EXEEXT) tst-pam_limits1$(EXEEXT) \
tst-pam_succeed_if1$(EXEEXT) tst-pam_group1$(EXEEXT) \
tst-pam_authfail$(EXEEXT) tst-pam_authsucceed$(EXEEXT) \
- tst-pam_pwhistory1$(EXEEXT) tst-pam_time1$(EXEEXT)
+ tst-pam_pwhistory1$(EXEEXT) tst-pam_time1$(EXEEXT) \
+ tst-pam_motd$(EXEEXT)
tst_pam_access1_SOURCES = tst-pam_access1.c
tst_pam_access1_OBJECTS = tst-pam_access1.$(OBJEXT)
tst_pam_access1_LDADD = $(LDADD)
@@ -194,6 +204,11 @@ tst_pam_limits1_OBJECTS = tst-pam_limits1.$(OBJEXT)
tst_pam_limits1_LDADD = $(LDADD)
tst_pam_limits1_DEPENDENCIES = $(top_builddir)/libpam/libpam.la \
$(top_builddir)/libpam_misc/libpam_misc.la
+tst_pam_motd_SOURCES = tst-pam_motd.c
+tst_pam_motd_OBJECTS = tst-pam_motd.$(OBJEXT)
+tst_pam_motd_LDADD = $(LDADD)
+tst_pam_motd_DEPENDENCIES = $(top_builddir)/libpam/libpam.la \
+ $(top_builddir)/libpam_misc/libpam_misc.la
tst_pam_pwhistory1_SOURCES = tst-pam_pwhistory1.c
tst_pam_pwhistory1_OBJECTS = tst-pam_pwhistory1.$(OBJEXT)
tst_pam_pwhistory1_LDADD = $(LDADD)
@@ -243,7 +258,24 @@ 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-pam_access1.Po \
+ ./$(DEPDIR)/tst-pam_access2.Po ./$(DEPDIR)/tst-pam_access3.Po \
+ ./$(DEPDIR)/tst-pam_access4.Po ./$(DEPDIR)/tst-pam_authfail.Po \
+ ./$(DEPDIR)/tst-pam_authsucceed.Po \
+ ./$(DEPDIR)/tst-pam_cracklib1.Po \
+ ./$(DEPDIR)/tst-pam_cracklib2.Po \
+ ./$(DEPDIR)/tst-pam_dispatch1.Po \
+ ./$(DEPDIR)/tst-pam_dispatch2.Po \
+ ./$(DEPDIR)/tst-pam_dispatch3.Po \
+ ./$(DEPDIR)/tst-pam_dispatch4.Po \
+ ./$(DEPDIR)/tst-pam_dispatch5.Po ./$(DEPDIR)/tst-pam_group1.Po \
+ ./$(DEPDIR)/tst-pam_limits1.Po ./$(DEPDIR)/tst-pam_motd.Po \
+ ./$(DEPDIR)/tst-pam_pwhistory1.Po \
+ ./$(DEPDIR)/tst-pam_succeed_if1.Po \
+ ./$(DEPDIR)/tst-pam_time1.Po ./$(DEPDIR)/tst-pam_unix1.Po \
+ ./$(DEPDIR)/tst-pam_unix2.Po ./$(DEPDIR)/tst-pam_unix3.Po \
+ ./$(DEPDIR)/tst-pam_unix4.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -268,17 +300,17 @@ SOURCES = tst-pam_access1.c tst-pam_access2.c tst-pam_access3.c \
tst-pam_cracklib1.c tst-pam_cracklib2.c tst-pam_dispatch1.c \
tst-pam_dispatch2.c tst-pam_dispatch3.c tst-pam_dispatch4.c \
tst-pam_dispatch5.c tst-pam_group1.c tst-pam_limits1.c \
- tst-pam_pwhistory1.c tst-pam_succeed_if1.c tst-pam_time1.c \
- tst-pam_unix1.c tst-pam_unix2.c tst-pam_unix3.c \
- tst-pam_unix4.c
+ tst-pam_motd.c tst-pam_pwhistory1.c tst-pam_succeed_if1.c \
+ tst-pam_time1.c tst-pam_unix1.c tst-pam_unix2.c \
+ tst-pam_unix3.c tst-pam_unix4.c
DIST_SOURCES = tst-pam_access1.c tst-pam_access2.c tst-pam_access3.c \
tst-pam_access4.c tst-pam_authfail.c tst-pam_authsucceed.c \
tst-pam_cracklib1.c tst-pam_cracklib2.c tst-pam_dispatch1.c \
tst-pam_dispatch2.c tst-pam_dispatch3.c tst-pam_dispatch4.c \
tst-pam_dispatch5.c tst-pam_group1.c tst-pam_limits1.c \
- tst-pam_pwhistory1.c tst-pam_succeed_if1.c tst-pam_time1.c \
- tst-pam_unix1.c tst-pam_unix2.c tst-pam_unix3.c \
- tst-pam_unix4.c
+ tst-pam_motd.c tst-pam_pwhistory1.c tst-pam_succeed_if1.c \
+ tst-pam_time1.c tst-pam_unix1.c tst-pam_unix2.c \
+ tst-pam_unix3.c tst-pam_unix4.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -303,6 +335,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -331,6 +365,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@
@@ -339,7 +375,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@
@@ -375,6 +410,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@
@@ -411,11 +447,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@
@@ -483,7 +521,8 @@ 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)/libpamc/include -I$(top_srcdir)/libpam_misc/include
+ -I$(top_srcdir)/libpamc/include -I$(top_srcdir)/libpam_misc/include \
+ $(WARN_CFLAGS)
LDADD = $(top_builddir)/libpam/libpam.la \
$(top_builddir)/libpam_misc/libpam_misc.la
@@ -512,7 +551,10 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh \
tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh \
tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh \
- tst-pam_time1.pamd time.conf
+ tst-pam_time1.pamd time.conf \
+ tst-pam_motd.sh tst-pam_motd1.sh tst-pam_motd2.sh \
+ tst-pam_motd3.sh tst-pam_motd4.sh tst-pam_motd1.pamd \
+ tst-pam_motd2.pamd tst-pam_motd3.pamd tst-pam_motd4.pamd
XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \
tst-pam_dispatch4 tst-pam_dispatch5 \
@@ -521,7 +563,7 @@ XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \
tst-pam_access1 tst-pam_access2 tst-pam_access3 \
tst-pam_access4 tst-pam_limits1 tst-pam_succeed_if1 \
tst-pam_group1 tst-pam_authfail tst-pam_authsucceed \
- tst-pam_pwhistory1 tst-pam_time1
+ tst-pam_pwhistory1 tst-pam_time1 tst-pam_motd
NOSRCTESTS = tst-pam_substack1 tst-pam_substack2 tst-pam_substack3 \
tst-pam_substack4 tst-pam_substack5 tst-pam_assemble_line1
@@ -542,14 +584,13 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xtests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu xtests/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)
@@ -621,6 +662,10 @@ tst-pam_limits1$(EXEEXT): $(tst_pam_limits1_OBJECTS) $(tst_pam_limits1_DEPENDENC
@rm -f tst-pam_limits1$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_pam_limits1_OBJECTS) $(tst_pam_limits1_LDADD) $(LIBS)
+tst-pam_motd$(EXEEXT): $(tst_pam_motd_OBJECTS) $(tst_pam_motd_DEPENDENCIES) $(EXTRA_tst_pam_motd_DEPENDENCIES)
+ @rm -f tst-pam_motd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_pam_motd_OBJECTS) $(tst_pam_motd_LDADD) $(LIBS)
+
tst-pam_pwhistory1$(EXEEXT): $(tst_pam_pwhistory1_OBJECTS) $(tst_pam_pwhistory1_DEPENDENCIES) $(EXTRA_tst_pam_pwhistory1_DEPENDENCIES)
@rm -f tst-pam_pwhistory1$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_pam_pwhistory1_OBJECTS) $(tst_pam_pwhistory1_LDADD) $(LIBS)
@@ -655,42 +700,49 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access4.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authfail.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authsucceed.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_cracklib1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_cracklib2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch4.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_group1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_limits1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_pwhistory1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_succeed_if1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_time1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix4.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_access4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authfail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_authsucceed.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_cracklib1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_cracklib2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_dispatch5.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_group1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_limits1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_motd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_pwhistory1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_succeed_if1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_time1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst-pam_unix4.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 $@ $<
@@ -757,7 +809,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-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)'; \
@@ -827,7 +882,29 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tst-pam_access1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access4.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authfail.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authsucceed.Po
+ -rm -f ./$(DEPDIR)/tst-pam_cracklib1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_cracklib2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch4.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch5.Po
+ -rm -f ./$(DEPDIR)/tst-pam_group1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_limits1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_motd.Po
+ -rm -f ./$(DEPDIR)/tst-pam_pwhistory1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_succeed_if1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_time1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix4.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -873,7 +950,29 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/tst-pam_access1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_access4.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authfail.Po
+ -rm -f ./$(DEPDIR)/tst-pam_authsucceed.Po
+ -rm -f ./$(DEPDIR)/tst-pam_cracklib1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_cracklib2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch4.Po
+ -rm -f ./$(DEPDIR)/tst-pam_dispatch5.Po
+ -rm -f ./$(DEPDIR)/tst-pam_group1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_limits1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_motd.Po
+ -rm -f ./$(DEPDIR)/tst-pam_pwhistory1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_succeed_if1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_time1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix1.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix2.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix3.Po
+ -rm -f ./$(DEPDIR)/tst-pam_unix4.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -894,18 +993,21 @@ uninstall-am:
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean 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 tags tags-am uninstall uninstall-am
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ 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 \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
xtests: $(XTESTS) run-xtests.sh
diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
index 1cf8684b..14f585d9 100755
--- a/xtests/run-xtests.sh
+++ b/xtests/run-xtests.sh
@@ -13,7 +13,7 @@ XTESTS="$@"
failed=0
pass=0
-skiped=0
+skipped=0
all=0
mkdir -p /etc/security
@@ -36,7 +36,7 @@ for testname in $XTESTS ; do
RETVAL=$?
if test $RETVAL -eq 77 ; then
echo "SKIP: $testname"
- skiped=`expr $skiped + 1`
+ skipped=`expr $skipped + 1`
elif test $RETVAL -ne 0 ; then
echo "FAIL: $testname"
failed=`expr $failed + 1`
@@ -55,13 +55,13 @@ mv /etc/security/opasswd-pam-xtests /etc/security/opasswd
if test "$failed" -ne 0; then
echo "==================="
echo "$failed of $all tests failed"
- echo "$skiped tests not run"
+ echo "$skipped tests not run"
echo "==================="
exit 1
else
echo "=================="
echo "$all tests passed"
- echo "$skiped tests not run"
+ echo "$skipped tests not run"
echo "=================="
fi
exit 0
diff --git a/xtests/tst-pam_motd.c b/xtests/tst-pam_motd.c
new file mode 100644
index 00000000..bba2f9d5
--- /dev/null
+++ b/xtests/tst-pam_motd.c
@@ -0,0 +1,69 @@
+/*
+ * 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 <security/pam_appl.h>
+#include <security/pam_misc.h>
+
+static struct pam_conv conv = {
+ misc_conv,
+ NULL
+};
+
+int main(int argc, char *argv[])
+{
+ pam_handle_t *pamh=NULL;
+ char *tst_arg = NULL;
+ int retval;
+
+ if (argc > 1)
+ tst_arg = argv[1];
+
+ retval = pam_start(tst_arg, NULL, &conv, &pamh);
+
+ retval = pam_open_session(pamh, 0);
+
+ retval = pam_close_session(pamh, 0);
+
+ if (pam_end(pamh,retval) != PAM_SUCCESS) { /* close Linux-PAM */
+ pamh = NULL;
+ exit(1);
+ }
+
+ return ( retval == PAM_SUCCESS ? 0:1 ); /* indicate success */
+}
diff --git a/xtests/tst-pam_motd.sh b/xtests/tst-pam_motd.sh
new file mode 100755
index 00000000..90801280
--- /dev/null
+++ b/xtests/tst-pam_motd.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -e
+
+./tst-pam_motd1.sh
+./tst-pam_motd2.sh
+./tst-pam_motd3.sh
+./tst-pam_motd4.sh
diff --git a/xtests/tst-pam_motd1.pamd b/xtests/tst-pam_motd1.pamd
new file mode 100644
index 00000000..ddea82c1
--- /dev/null
+++ b/xtests/tst-pam_motd1.pamd
@@ -0,0 +1,3 @@
+#%PAM-1.0
+session required pam_permit.so
+session optional pam_motd.so motd=tst-pam_motd1.d/etc/motd motd_dir=tst-pam_motd1.d/etc/motd.d
diff --git a/xtests/tst-pam_motd1.sh b/xtests/tst-pam_motd1.sh
new file mode 100755
index 00000000..cc888547
--- /dev/null
+++ b/xtests/tst-pam_motd1.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+TST_DIR="tst-pam_motd1.d"
+
+function tst_cleanup() {
+ rm -rf "${TST_DIR}"
+ rm -f tst-pam_motd1.out
+}
+
+mkdir -p ${TST_DIR}
+mkdir -p ${TST_DIR}/etc/motd.d
+
+# Verify the case of single motd and motd.d directory works
+echo "motd: /etc/motd" > ${TST_DIR}/etc/motd
+echo "motd: /etc/motd.d/test" > ${TST_DIR}/etc/motd.d/test
+
+./tst-pam_motd tst-pam_motd1 > tst-pam_motd1.out
+
+RET=$?
+
+motd_to_show_output=$(cat tst-pam_motd1.out | grep "motd: /etc/motd")
+if [ -z "${motd_to_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+motd_dir_to_show_output=$(cat tst-pam_motd1.out | grep "motd: /etc/motd.d/test")
+if [ -z "${motd_dir_to_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+tst_cleanup
+exit $RET
diff --git a/xtests/tst-pam_motd2.pamd b/xtests/tst-pam_motd2.pamd
new file mode 100644
index 00000000..82001915
--- /dev/null
+++ b/xtests/tst-pam_motd2.pamd
@@ -0,0 +1,3 @@
+#%PAM-1.0
+session required pam_permit.so
+session optional pam_motd.so motd=tst-pam_motd2.d/etc/motd:tst-pam_motd2.d/run/motd:tst-pam_motd2.d/usr/lib/motd motd_dir=tst-pam_motd2.d/etc/motd.d:tst-pam_motd2.d/run/motd.d:tst-pam_motd2.d/usr/lib/motd.d
diff --git a/xtests/tst-pam_motd2.sh b/xtests/tst-pam_motd2.sh
new file mode 100755
index 00000000..d26ea923
--- /dev/null
+++ b/xtests/tst-pam_motd2.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+TST_DIR="tst-pam_motd2.d"
+
+function tst_cleanup() {
+ rm -rf "${TST_DIR}"
+ rm -f tst-pam_motd2.out
+}
+
+mkdir -p ${TST_DIR}
+mkdir -p ${TST_DIR}/etc/motd.d
+mkdir -p ${TST_DIR}/run/motd.d
+mkdir -p ${TST_DIR}/usr/lib/motd.d
+
+echo "motd: /etc/motd" > ${TST_DIR}/etc/motd
+echo "motd: /run/motd" > ${TST_DIR}/run/motd
+echo "motd: /usr/lib/motd" > ${TST_DIR}/usr/lib/motd
+
+# Drop a motd file in test directories such that every overriding
+# condition (for 3 directories in this case) will be seen.
+echo "motd: e0r0u1 in usr/lib - will show" > ${TST_DIR}/usr/lib/motd.d/e0r0u1.motd
+echo "motd: e0r1u0 in run - will show" > ${TST_DIR}/run/motd.d/e0r1u0.motd
+echo "motd: e0r1u1 in usr/lib - not show" > ${TST_DIR}/usr/lib/motd.d/e0r1u1.motd
+echo "motd: e0r1u1 in run - will show" > ${TST_DIR}/run/motd.d/e0r1u1.motd
+echo "motd: e1r0u0 in etc - will show" > ${TST_DIR}/etc/motd.d/e1r0u0.motd
+echo "motd: e1r0u1 in usr/lib - not show" > ${TST_DIR}/usr/lib/motd.d/e1r0u1.motd
+echo "motd: e1r0u1 in etc - will show" > ${TST_DIR}/etc/motd.d/e1r0u1.motd
+echo "motd: e1r1u0 in run - not show" > ${TST_DIR}/run/motd.d/e1r1u0.motd
+echo "motd: e1r1u0 in etc - will show" > ${TST_DIR}/etc/motd.d/e1r1u0.motd
+echo "motd: e1r1u1 in usr/lib - not show" > ${TST_DIR}/usr/lib/motd.d/e1r1u1.motd
+echo "motd: e1r1u1 in run - not show" > ${TST_DIR}/run/motd.d/e1r1u1.motd
+echo "motd: e1r1u1 in etc - will show" > ${TST_DIR}/etc/motd.d/e1r1u1.motd
+
+./tst-pam_motd tst-pam_motd2 > tst-pam_motd2.out
+
+RET=$?
+
+motd_to_show_output=$(cat tst-pam_motd2.out | grep "motd: /etc/motd")
+if [ -z "${motd_to_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+motd_dir_not_show_output=$(cat tst-pam_motd2.out | grep "not show")
+if [ -n "${motd_dir_not_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+tst_cleanup
+exit $RET
diff --git a/xtests/tst-pam_motd3.pamd b/xtests/tst-pam_motd3.pamd
new file mode 100644
index 00000000..a8b8cbf2
--- /dev/null
+++ b/xtests/tst-pam_motd3.pamd
@@ -0,0 +1,3 @@
+#%PAM-1.0
+session required pam_permit.so
+session optional pam_motd.so motd=tst-pam_motd3.d/etc/motd:tst-pam_motd3.d/run/motd:tst-pam_motd3.d/usr/lib/motd motd_dir=tst-pam_motd3.d/etc/motd.d:tst-pam_motd3.d/run/motd.d:tst-pam_motd3.d/usr/lib/motd.d
diff --git a/xtests/tst-pam_motd3.sh b/xtests/tst-pam_motd3.sh
new file mode 100755
index 00000000..e18856b1
--- /dev/null
+++ b/xtests/tst-pam_motd3.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+TST_DIR="tst-pam_motd3.d"
+
+function tst_cleanup() {
+ rm -rf "${TST_DIR}"
+ rm -f tst-pam_motd3.out
+}
+
+mkdir -p ${TST_DIR}
+mkdir -p ${TST_DIR}/etc/motd.d
+mkdir -p ${TST_DIR}/run/motd.d
+mkdir -p ${TST_DIR}/usr/lib/motd.d
+
+# Verify motd is still displayed when not overridden
+echo "motd: test-show in run - show" > ${TST_DIR}/run/motd.d/test-show.motd
+
+# Test overridden by a symlink to a file that isn't /dev/null; symlink target should show
+echo "motd: hidden-by-symlink in usr/lib - not show" > ${TST_DIR}/usr/lib/motd.d/hidden-by-symlink.motd
+echo "motd: test-from-symlink - show" > ${TST_DIR}/test-from-symlink.motd
+ln -sr ${TST_DIR}/test-from-symlink.motd ${TST_DIR}/run/motd.d/hidden-by-symlink.motd
+
+# Test hidden by a null symlink
+echo "motd: hidden-by-null-symlink in run - not show" > ${TST_DIR}/run/motd.d/hidden-by-null-symlink.motd
+ln -s /dev/null ${TST_DIR}/etc/motd.d/hidden-by-null-symlink.motd
+
+./tst-pam_motd tst-pam_motd3 > tst-pam_motd3.out
+
+RET=$?
+
+motd_dir_not_show_output=$(cat tst-pam_motd3.out | grep "not show")
+if [ -n "${motd_dir_not_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+motd_test_show_output=$(cat tst-pam_motd3.out | grep "test-show.*- show")
+if [ -z "${motd_test_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+motd_general_symlink_show_output=$(cat tst-pam_motd3.out | grep "test-from-symlink.*- show")
+if [ -z "${motd_general_symlink_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+tst_cleanup
+exit $RET
diff --git a/xtests/tst-pam_motd4.pamd b/xtests/tst-pam_motd4.pamd
new file mode 100644
index 00000000..9dc311ad
--- /dev/null
+++ b/xtests/tst-pam_motd4.pamd
@@ -0,0 +1,3 @@
+#%PAM-1.0
+session required pam_permit.so
+session optional pam_motd.so motd=tst-pam_motd4.d/etc/motd
diff --git a/xtests/tst-pam_motd4.sh b/xtests/tst-pam_motd4.sh
new file mode 100755
index 00000000..6022177f
--- /dev/null
+++ b/xtests/tst-pam_motd4.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+TST_DIR="tst-pam_motd4.d"
+
+function tst_cleanup() {
+ rm -rf "${TST_DIR}"
+ rm -f tst-pam_motd4.out
+}
+
+mkdir -p ${TST_DIR}/etc
+
+# Verify the case of single motd with no motd_dir given in tst-pam_motd4.pamd
+echo "motd: /etc/motd" > ${TST_DIR}/etc/motd
+
+./tst-pam_motd tst-pam_motd4 > tst-pam_motd4.out
+
+RET=$?
+
+motd_to_show_output=$(cat tst-pam_motd4.out | grep "motd: /etc/motd")
+if [ -z "${motd_to_show_output}" ];
+then
+ tst_cleanup
+ exit 1
+fi
+
+tst_cleanup
+exit $RET
diff --git a/xtests/tst-pam_pwhistory1.c b/xtests/tst-pam_pwhistory1.c
index 5c3246fa..1641c298 100644
--- a/xtests/tst-pam_pwhistory1.c
+++ b/xtests/tst-pam_pwhistory1.c
@@ -46,8 +46,9 @@
#include <stdlib.h>
#include <string.h>
#include <security/pam_appl.h>
+#include "pam_inline.h"
-static int in_test;
+static unsigned int in_test;
static const char *passwords[] = {
"pamhistory01", "pamhistory02", "pamhistory03",
@@ -121,15 +122,14 @@ main(int argc, char *argv[])
if (argc > 1 && strcmp (argv[1], "-d") == 0)
debug = 1;
- for (in_test = 0;
- in_test < (int)(sizeof (passwords)/sizeof (char *)); in_test++)
+ for (in_test = 0; in_test < PAM_ARRAY_SIZE(passwords); in_test++)
{
retval = pam_start("tst-pam_pwhistory1", user, &conv, &pamh);
if (retval != PAM_SUCCESS)
{
if (debug)
- fprintf (stderr, "pwhistory1-%d: pam_start returned %d\n",
+ fprintf (stderr, "pwhistory1-%u: pam_start returned %d\n",
in_test, retval);
return 1;
}
@@ -140,7 +140,7 @@ main(int argc, char *argv[])
if (retval != PAM_SUCCESS)
{
if (debug)
- fprintf (stderr, "pwhistory1-%d: pam_chauthtok returned %d\n",
+ fprintf (stderr, "pwhistory1-%u: pam_chauthtok returned %d\n",
in_test, retval);
return 1;
}
@@ -150,7 +150,7 @@ main(int argc, char *argv[])
if (retval != PAM_MAXTRIES)
{
if (debug)
- fprintf (stderr, "pwhistory1-%d: pam_chauthtok returned %d\n",
+ fprintf (stderr, "pwhistory1-%u: pam_chauthtok returned %d\n",
in_test, retval);
return 1;
}
diff --git a/xtests/tst-pam_time1.c b/xtests/tst-pam_time1.c
index 9fc0669e..18dfeba9 100644
--- a/xtests/tst-pam_time1.c
+++ b/xtests/tst-pam_time1.c
@@ -49,6 +49,7 @@
#include <stdlib.h>
#include <string.h>
#include <security/pam_appl.h>
+#include "pam_inline.h"
struct test_t {
@@ -65,8 +66,6 @@ static struct test_t tests[] = {
{"y", 6},
};
-static int num_tests = sizeof (tests) / sizeof (struct test_t);
-
static struct pam_conv conv = {
NULL, NULL
};
@@ -77,12 +76,12 @@ main(int argc, char *argv[])
pam_handle_t *pamh = NULL;
int retval;
int debug = 0;
- int i;
+ unsigned int i;
if (argc > 1 && strcmp (argv[1], "-d") == 0)
debug = 1;
- for (i = 0; i < num_tests; i++)
+ for (i = 0; i < PAM_ARRAY_SIZE(tests); i++)
{
retval = pam_start("tst-pam_time1", tests[i].user, &conv, &pamh);
if (retval != PAM_SUCCESS)