diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 17:53:41 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 18:17:08 -0800 |
commit | 212b52cf29c06cc209bc8ac0540dbab1acdf1464 (patch) | |
tree | 58da0bf39f5c4122e4a1b4da20fdeea52b97a671 /xtests | |
parent | 9c52e721044e7501c3d4567b36d222dc7326224a (diff) | |
parent | 56c8282d128fb484ffc77dff73abf42229b291d3 (diff) |
New upstream version 1.1.0
Diffstat (limited to 'xtests')
-rw-r--r-- | xtests/Makefile.am | 11 | ||||
-rw-r--r-- | xtests/Makefile.in | 95 | ||||
-rw-r--r-- | xtests/access.conf | 1 | ||||
-rwxr-xr-x | xtests/run-xtests.sh | 17 | ||||
-rw-r--r-- | xtests/time.conf | 2 | ||||
-rw-r--r-- | xtests/tst-pam_access4.c | 28 | ||||
-rw-r--r-- | xtests/tst-pam_cracklib1.c | 4 | ||||
-rw-r--r-- | xtests/tst-pam_group1.c | 3 | ||||
-rw-r--r-- | xtests/tst-pam_pwhistory1.c | 169 | ||||
-rw-r--r-- | xtests/tst-pam_pwhistory1.pamd | 7 | ||||
-rwxr-xr-x | xtests/tst-pam_pwhistory1.sh | 7 | ||||
-rw-r--r-- | xtests/tst-pam_time1.c | 114 | ||||
-rw-r--r-- | xtests/tst-pam_time1.pamd | 5 | ||||
-rw-r--r-- | xtests/tst-pam_unix4.c | 154 | ||||
-rw-r--r-- | xtests/tst-pam_unix4.pamd | 6 | ||||
-rwxr-xr-x | xtests/tst-pam_unix4.sh | 14 |
16 files changed, 589 insertions, 48 deletions
diff --git a/xtests/Makefile.am b/xtests/Makefile.am index 30a923aa..4168e60e 100644 --- a/xtests/Makefile.am +++ b/xtests/Makefile.am @@ -14,7 +14,9 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ tst-pam_dispatch5.pamd \ tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd \ tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd \ + tst-pam_unix4.pamd \ tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh \ + tst-pam_unix4.sh \ access.conf tst-pam_access1.pamd tst-pam_access1.sh \ tst-pam_access2.pamd tst-pam_access2.sh \ tst-pam_access3.pamd tst-pam_access3.sh \ @@ -28,15 +30,18 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh \ tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh \ tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh \ - tst-pam_assemble_line1.pamd tst-pam_assemble_line1.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 XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \ tst-pam_dispatch4 tst-pam_dispatch5 \ tst-pam_cracklib1 tst-pam_cracklib2 \ - tst-pam_unix1 tst-pam_unix2 tst-pam_unix3 \ + tst-pam_unix1 tst-pam_unix2 tst-pam_unix3 tst-pam_unix4 \ 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_group1 tst-pam_authfail tst-pam_authsucceed \ + tst-pam_pwhistory1 tst-pam_time1 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 66a10700..86c28338 100644 --- a/xtests/Makefile.in +++ b/xtests/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -41,13 +41,16 @@ subdir = xtests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/japhar_grep_cflags.m4 \ $(top_srcdir)/m4/jh_path_xml_catalog.m4 \ $(top_srcdir)/m4/ld-O1.m4 $(top_srcdir)/m4/ld-as-needed.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libprelude.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -59,11 +62,12 @@ am__EXEEXT_1 = tst-pam_dispatch1$(EXEEXT) tst-pam_dispatch2$(EXEEXT) \ tst-pam_dispatch5$(EXEEXT) tst-pam_cracklib1$(EXEEXT) \ tst-pam_cracklib2$(EXEEXT) tst-pam_unix1$(EXEEXT) \ tst-pam_unix2$(EXEEXT) tst-pam_unix3$(EXEEXT) \ - tst-pam_access1$(EXEEXT) tst-pam_access2$(EXEEXT) \ - tst-pam_access3$(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_unix4$(EXEEXT) tst-pam_access1$(EXEEXT) \ + tst-pam_access2$(EXEEXT) tst-pam_access3$(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) PROGRAMS = $(noinst_PROGRAMS) tst_pam_access1_SOURCES = tst-pam_access1.c tst_pam_access1_OBJECTS = tst-pam_access1.$(OBJEXT) @@ -110,9 +114,15 @@ tst_pam_group1_LDADD = $(LDADD) tst_pam_limits1_SOURCES = tst-pam_limits1.c tst_pam_limits1_OBJECTS = tst-pam_limits1.$(OBJEXT) tst_pam_limits1_LDADD = $(LDADD) +tst_pam_pwhistory1_SOURCES = tst-pam_pwhistory1.c +tst_pam_pwhistory1_OBJECTS = tst-pam_pwhistory1.$(OBJEXT) +tst_pam_pwhistory1_LDADD = $(LDADD) tst_pam_succeed_if1_SOURCES = tst-pam_succeed_if1.c tst_pam_succeed_if1_OBJECTS = tst-pam_succeed_if1.$(OBJEXT) tst_pam_succeed_if1_LDADD = $(LDADD) +tst_pam_time1_SOURCES = tst-pam_time1.c +tst_pam_time1_OBJECTS = tst-pam_time1.$(OBJEXT) +tst_pam_time1_LDADD = $(LDADD) tst_pam_unix1_SOURCES = tst-pam_unix1.c tst_pam_unix1_OBJECTS = tst-pam_unix1.$(OBJEXT) tst_pam_unix1_LDADD = $(LDADD) @@ -122,6 +132,9 @@ tst_pam_unix2_LDADD = $(LDADD) tst_pam_unix3_SOURCES = tst-pam_unix3.c tst_pam_unix3_OBJECTS = tst-pam_unix3.$(OBJEXT) tst_pam_unix3_LDADD = $(LDADD) +tst_pam_unix4_SOURCES = tst-pam_unix4.c +tst_pam_unix4_OBJECTS = tst-pam_unix4.$(OBJEXT) +tst_pam_unix4_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -139,15 +152,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_succeed_if1.c tst-pam_unix1.c tst-pam_unix2.c \ - tst-pam_unix3.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_succeed_if1.c tst-pam_unix1.c tst-pam_unix2.c \ - tst-pam_unix3.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 ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -164,23 +179,19 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FO2PDF = @FO2PDF@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ @@ -192,6 +203,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -215,6 +227,7 @@ LIBPRELUDE_PTHREAD_CFLAGS = @LIBPRELUDE_PTHREAD_CFLAGS@ LIBS = @LIBS@ LIBSELINUX = @LIBSELINUX@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ @@ -224,15 +237,18 @@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ -PAM_READ_BOTH_CONFS = @PAM_READ_BOTH_CONFS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIE_CFLAGS = @PIE_CFLAGS@ PIE_LDFLAGS = @PIE_LDFLAGS@ @@ -246,10 +262,9 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_PAMLOCKING = @WITH_PAMLOCKING@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XMLCATALOG = @XMLCATALOG@ XMLLINT = @XMLLINT@ XML_CATALOG_FILE = @XML_CATALOG_FILE@ @@ -261,8 +276,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -294,6 +308,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -308,6 +323,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_srcdir)/libpam/include \ @@ -322,7 +338,9 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ tst-pam_dispatch5.pamd \ tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd \ tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd \ + tst-pam_unix4.pamd \ tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh \ + tst-pam_unix4.sh \ access.conf tst-pam_access1.pamd tst-pam_access1.sh \ tst-pam_access2.pamd tst-pam_access2.sh \ tst-pam_access3.pamd tst-pam_access3.sh \ @@ -336,15 +354,18 @@ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh \ tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh \ tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh \ - tst-pam_assemble_line1.pamd tst-pam_assemble_line1.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 XTESTS = tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \ tst-pam_dispatch4 tst-pam_dispatch5 \ tst-pam_cracklib1 tst-pam_cracklib2 \ - tst-pam_unix1 tst-pam_unix2 tst-pam_unix3 \ + tst-pam_unix1 tst-pam_unix2 tst-pam_unix3 tst-pam_unix4 \ 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_group1 tst-pam_authfail tst-pam_authsucceed \ + tst-pam_pwhistory1 tst-pam_time1 NOSRCTESTS = tst-pam_substack1 tst-pam_substack2 tst-pam_substack3 \ tst-pam_substack4 tst-pam_substack5 tst-pam_assemble_line1 @@ -357,8 +378,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -434,9 +455,15 @@ tst-pam_group1$(EXEEXT): $(tst_pam_group1_OBJECTS) $(tst_pam_group1_DEPENDENCIES tst-pam_limits1$(EXEEXT): $(tst_pam_limits1_OBJECTS) $(tst_pam_limits1_DEPENDENCIES) @rm -f tst-pam_limits1$(EXEEXT) $(LINK) $(tst_pam_limits1_OBJECTS) $(tst_pam_limits1_LDADD) $(LIBS) +tst-pam_pwhistory1$(EXEEXT): $(tst_pam_pwhistory1_OBJECTS) $(tst_pam_pwhistory1_DEPENDENCIES) + @rm -f tst-pam_pwhistory1$(EXEEXT) + $(LINK) $(tst_pam_pwhistory1_OBJECTS) $(tst_pam_pwhistory1_LDADD) $(LIBS) tst-pam_succeed_if1$(EXEEXT): $(tst_pam_succeed_if1_OBJECTS) $(tst_pam_succeed_if1_DEPENDENCIES) @rm -f tst-pam_succeed_if1$(EXEEXT) $(LINK) $(tst_pam_succeed_if1_OBJECTS) $(tst_pam_succeed_if1_LDADD) $(LIBS) +tst-pam_time1$(EXEEXT): $(tst_pam_time1_OBJECTS) $(tst_pam_time1_DEPENDENCIES) + @rm -f tst-pam_time1$(EXEEXT) + $(LINK) $(tst_pam_time1_OBJECTS) $(tst_pam_time1_LDADD) $(LIBS) tst-pam_unix1$(EXEEXT): $(tst_pam_unix1_OBJECTS) $(tst_pam_unix1_DEPENDENCIES) @rm -f tst-pam_unix1$(EXEEXT) $(LINK) $(tst_pam_unix1_OBJECTS) $(tst_pam_unix1_LDADD) $(LIBS) @@ -446,6 +473,9 @@ tst-pam_unix2$(EXEEXT): $(tst_pam_unix2_OBJECTS) $(tst_pam_unix2_DEPENDENCIES) tst-pam_unix3$(EXEEXT): $(tst_pam_unix3_OBJECTS) $(tst_pam_unix3_DEPENDENCIES) @rm -f tst-pam_unix3$(EXEEXT) $(LINK) $(tst_pam_unix3_OBJECTS) $(tst_pam_unix3_LDADD) $(LIBS) +tst-pam_unix4$(EXEEXT): $(tst_pam_unix4_OBJECTS) $(tst_pam_unix4_DEPENDENCIES) + @rm -f tst-pam_unix4$(EXEEXT) + $(LINK) $(tst_pam_unix4_OBJECTS) $(tst_pam_unix4_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -468,10 +498,13 @@ distclean-compile: @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@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -505,7 +538,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/xtests/access.conf b/xtests/access.conf index 8088ec61..25462dd9 100644 --- a/xtests/access.conf +++ b/xtests/access.conf @@ -1,2 +1,3 @@ -:ALL EXCEPT (tstpamaccess) tstpamaccess3 :LOCAL +-:ALL:127.0.0.1 diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh index 4e981858..3a890578 100755 --- a/xtests/run-xtests.sh +++ b/xtests/run-xtests.sh @@ -17,17 +17,18 @@ skiped=0 all=0 mkdir -p /etc/security -cp /etc/security/access.conf /etc/security/access.conf-pam-xtests -install -m 644 "${SRCDIR}"/access.conf /etc/security/access.conf -cp /etc/security/group.conf /etc/security/group.conf-pam-xtests -install -m 644 "${SRCDIR}"/group.conf /etc/security/group.conf -cp /etc/security/limits.conf /etc/security/limits.conf-pam-xtests -install -m 644 "${SRCDIR}"/limits.conf /etc/security/limits.conf +for config in access.conf group.conf time.conf limits.conf ; do + cp /etc/security/$config /etc/security/$config-pam-xtests + install -m 644 "${SRCDIR}"/$config /etc/security/$config +done +mv /etc/security/opasswd /etc/security/opasswd-pam-xtests + for testname in $XTESTS ; do for cfg in "${SRCDIR}"/$testname*.pamd ; do install -m 644 $cfg /etc/pam.d/$(basename $cfg .pamd) done - if test -x "${SRCDIR}"/$testname.sh ; then + if test -f "${SRCDIR}"/$testname.sh ; then + test -x "${SRCDIR}"/$testname.sh || chmod 755 "${SRCDIR}"/$testname.sh "${SRCDIR}"/$testname.sh > /dev/null else ./$testname > /dev/null @@ -48,7 +49,9 @@ for testname in $XTESTS ; do done mv /etc/security/access.conf-pam-xtests /etc/security/access.conf mv /etc/security/group.conf-pam-xtests /etc/security/group.conf +mv /etc/security/time.conf-pam-xtests /etc/security/time.conf mv /etc/security/limits.conf-pam-xtests /etc/security/limits.conf +mv /etc/security/opasswd-pam-xtests /etc/security/opasswd if test "$failed" -ne 0; then echo "===================" echo "$failed of $all tests failed" diff --git a/xtests/time.conf b/xtests/time.conf new file mode 100644 index 00000000..518124cd --- /dev/null +++ b/xtests/time.conf @@ -0,0 +1,2 @@ +*;*;you|me;!Al0000-2400 +*;*;x|y;!Al0000-2400 diff --git a/xtests/tst-pam_access4.c b/xtests/tst-pam_access4.c index 2b887a4d..115217f6 100644 --- a/xtests/tst-pam_access4.c +++ b/xtests/tst-pam_access4.c @@ -34,10 +34,12 @@ /* test case: - Check the following line in access.conf: + Check the following lines in access.conf: -:ALL EXCEPT tstpamaccess3 :LOCAL + -:ALL:127.0.0.1 - pam_authenticate should fail for /dev/tty1 and pass for www.example.com + pam_authenticate should fail for /dev/tty1, pass for www.example.com, + and fail again for localhost */ #ifdef HAVE_CONFIG_H @@ -121,12 +123,12 @@ main(int argc, char *argv[]) return 1; } - retval = pam_set_item (pamh, PAM_TTY, "www.example.com"); + retval = pam_set_item (pamh, PAM_RHOST, "www.example.com"); if (retval != PAM_SUCCESS) { if (debug) fprintf (stderr, - "pam_access4-2: pam_set_item(PAM_TTY) returned %d\n", + "pam_access4-2: pam_set_item(PAM_RHOST) returned %d\n", retval); return 1; } @@ -139,6 +141,24 @@ main(int argc, char *argv[]) return 1; } + retval = pam_set_item (pamh, PAM_RHOST, "localhost"); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, + "pam_access4-3: pam_set_item(PAM_RHOST) returned %d\n", + retval); + return 1; + } + + retval = pam_authenticate (pamh, 0); + if (retval != PAM_PERM_DENIED) + { + if (debug) + fprintf (stderr, "pam_access4-3: pam_authenticate returned %d\n", retval); + return 1; + } + retval = pam_end (pamh,retval); if (retval != PAM_SUCCESS) { diff --git a/xtests/tst-pam_cracklib1.c b/xtests/tst-pam_cracklib1.c index b0e52051..1a219c83 100644 --- a/xtests/tst-pam_cracklib1.c +++ b/xtests/tst-pam_cracklib1.c @@ -107,7 +107,7 @@ main(int argc, char *argv[]) /* Try one, first input is correct, second is NULL */ retval = pam_chauthtok (pamh, 0); - if (retval != PAM_AUTHTOK_RECOVERY_ERR) + if (retval != PAM_AUTHTOK_ERR) { if (debug) fprintf (stderr, "cracklib1-1: pam_chauthtok returned %d\n", retval); @@ -116,7 +116,7 @@ main(int argc, char *argv[]) /* Try two, second input is NULL */ retval = pam_chauthtok (pamh, 0); - if (retval != PAM_AUTHTOK_RECOVERY_ERR) + if (retval != PAM_AUTHTOK_ERR) { if (debug) fprintf (stderr, "cracklib1-2: pam_chauthtok returned %d\n", retval); diff --git a/xtests/tst-pam_group1.c b/xtests/tst-pam_group1.c index ca0c2ac9..e5e5ae1c 100644 --- a/xtests/tst-pam_group1.c +++ b/xtests/tst-pam_group1.c @@ -100,6 +100,7 @@ run_test (const char *user, gid_t groupid, int needit) { pam_handle_t *pamh = NULL; int retval; + int no_grps; retval = pam_start("tst-pam_group1", user, &conv, &pamh); if (retval != PAM_SUCCESS) @@ -136,7 +137,7 @@ run_test (const char *user, gid_t groupid, int needit) } - int no_grps = getgroups(0, NULL); /* find the current number of groups */ + no_grps = getgroups(0, NULL); /* find the current number of groups */ if (no_grps > 0) { int i, found; diff --git a/xtests/tst-pam_pwhistory1.c b/xtests/tst-pam_pwhistory1.c new file mode 100644 index 00000000..5c3246fa --- /dev/null +++ b/xtests/tst-pam_pwhistory1.c @@ -0,0 +1,169 @@ +/* + * 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. + */ + +/* + * Check remember handling + * Change ten times the password + * Try the ten passwords again, should always be rejected + * Try a new password, should succeed + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <security/pam_appl.h> + +static int in_test; + +static const char *passwords[] = { + "pamhistory01", "pamhistory02", "pamhistory03", + "pamhistory04", "pamhistory05", "pamhistory06", + "pamhistory07", "pamhistory08", "pamhistory09", + "pamhistory10", + "pamhistory01", "pamhistory02", "pamhistory03", + "pamhistory04", "pamhistory05", "pamhistory06", + "pamhistory07", "pamhistory08", "pamhistory09", + "pamhistory10", + "pamhistory11", + "pamhistory01", "pamhistory02", "pamhistory03", + "pamhistory04", "pamhistory05", "pamhistory06", + "pamhistory07", "pamhistory08", "pamhistory09", + "pamhistory10"}; + +static int debug; + +/* A conversation function which uses an internally-stored value for + the responses. */ +static int +fake_conv (int num_msg, const struct pam_message **msgm, + struct pam_response **response, void *appdata_ptr UNUSED) +{ + struct pam_response *reply; + int count; + + /* Sanity test. */ + if (num_msg <= 0) + return PAM_CONV_ERR; + + if (debug) + fprintf (stderr, "msg_style=%d, msg=%s\n", msgm[0]->msg_style, + msgm[0]->msg); + + if (msgm[0]->msg_style != 1) + return PAM_SUCCESS; + + /* Allocate memory for the responses. */ + reply = calloc (num_msg, sizeof (struct pam_response)); + if (reply == NULL) + return PAM_CONV_ERR; + + /* Each prompt elicits the same response. */ + for (count = 0; count < num_msg; ++count) + { + reply[count].resp_retcode = 0; + reply[count].resp = strdup (passwords[in_test]); + if (debug) + fprintf (stderr, "send password %s\n", reply[count].resp); + } + + /* Set the pointers in the response structure and return. */ + *response = reply; + return PAM_SUCCESS; +} + +static struct pam_conv conv = { + fake_conv, + NULL +}; + + +int +main(int argc, char *argv[]) +{ + pam_handle_t *pamh=NULL; + const char *user="tstpampwhistory"; + int retval; + + if (argc > 1 && strcmp (argv[1], "-d") == 0) + debug = 1; + + for (in_test = 0; + in_test < (int)(sizeof (passwords)/sizeof (char *)); 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", + in_test, retval); + return 1; + } + + retval = pam_chauthtok (pamh, 0); + if (in_test < 10 || in_test == 20) + { + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "pwhistory1-%d: pam_chauthtok returned %d\n", + in_test, retval); + return 1; + } + } + else if (in_test < 20) + { + if (retval != PAM_MAXTRIES) + { + if (debug) + fprintf (stderr, "pwhistory1-%d: pam_chauthtok returned %d\n", + in_test, retval); + return 1; + } + } + + retval = pam_end (pamh,retval); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "pwhistory1: pam_end returned %d\n", retval); + return 1; + } + } + + return 0; +} diff --git a/xtests/tst-pam_pwhistory1.pamd b/xtests/tst-pam_pwhistory1.pamd new file mode 100644 index 00000000..e096cc4f --- /dev/null +++ b/xtests/tst-pam_pwhistory1.pamd @@ -0,0 +1,7 @@ +#%PAM-1.0 +auth required pam_permit.so +account required pam_permit.so +password required pam_pwhistory.so remember=10 retry=1 +password required pam_unix.so use_authtok md5 +session required pam_permit.so + diff --git a/xtests/tst-pam_pwhistory1.sh b/xtests/tst-pam_pwhistory1.sh new file mode 100755 index 00000000..ddb3b8b1 --- /dev/null +++ b/xtests/tst-pam_pwhistory1.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +/usr/sbin/useradd tstpampwhistory +./tst-pam_pwhistory1 +RET=$? +/usr/sbin/userdel -r tstpampwhistory 2> /dev/null +exit $RET diff --git a/xtests/tst-pam_time1.c b/xtests/tst-pam_time1.c new file mode 100644 index 00000000..9fc0669e --- /dev/null +++ b/xtests/tst-pam_time1.c @@ -0,0 +1,114 @@ +/* + * 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. + */ + +/* + test case: + + Check the following lines in time.conf: + *;*;you|me;!Al0000-2400 + *;*;x|y;!Al0000-2400 + + User 'x' should not be able to login. +*/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <security/pam_appl.h> + + +struct test_t { + const char *user; + int retval; +}; + +static struct test_t tests[] = { + {"xy", 0}, + {"yx", 0}, + {"you",6}, + {"me", 6}, + {"x", 6}, + {"y", 6}, +}; + +static int num_tests = sizeof (tests) / sizeof (struct test_t); + +static struct pam_conv conv = { + NULL, NULL +}; + +int +main(int argc, char *argv[]) +{ + pam_handle_t *pamh = NULL; + int retval; + int debug = 0; + int i; + + if (argc > 1 && strcmp (argv[1], "-d") == 0) + debug = 1; + + for (i = 0; i < num_tests; i++) + { + retval = pam_start("tst-pam_time1", tests[i].user, &conv, &pamh); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "pam_time1: pam_start returned %d\n", retval); + return 1; + } + + retval = pam_acct_mgmt (pamh, 0); + if (retval != tests[i].retval) + { + if (debug) + fprintf (stderr, + "pam_time1: pam_acct_mgmt(%s) returned wrong value, %d, expected %d\n", + tests[i].user, retval, tests[i].retval); + return 1; + } + + retval = pam_end (pamh,retval); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "pam_time1: pam_end returned %d\n", retval); + return 1; + } + } + return 0; +} diff --git a/xtests/tst-pam_time1.pamd b/xtests/tst-pam_time1.pamd new file mode 100644 index 00000000..c4cd6c74 --- /dev/null +++ b/xtests/tst-pam_time1.pamd @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth required pam_permit.so +account required pam_time.so +password required pam_permit.so +session required pam_permit.so diff --git a/xtests/tst-pam_unix4.c b/xtests/tst-pam_unix4.c new file mode 100644 index 00000000..1ba0a40c --- /dev/null +++ b/xtests/tst-pam_unix4.c @@ -0,0 +1,154 @@ +/* + * 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. + */ + +/* + * Check password change minimum days handling. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <security/pam_appl.h> +#include <sys/types.h> +#include <pwd.h> +#include <unistd.h> + +/* A conversation function which uses an internally-stored value for + the responses. */ +static int +fake_conv (int num_msg, const struct pam_message **msgm UNUSED, + struct pam_response **response, void *appdata_ptr UNUSED) +{ + struct pam_response *reply; + int count; + static int respnum = 0; + static const char *resps[] = { "pamunix01", "TsTPAM01MAP", "TsTPAM01MAP" }; + + /* Sanity test. */ + if (num_msg <= 0) + return PAM_CONV_ERR; + + /* Allocate memory for the responses. */ + reply = calloc (num_msg, sizeof (struct pam_response)); + if (reply == NULL) + return PAM_CONV_ERR; + + /* Answer with appropriate response from the above array. */ + for (count = 0; count < num_msg; ++count) + { + if (msgm[count]->msg_style == PAM_PROMPT_ECHO_OFF) + { + reply[count].resp_retcode = 0; + reply[count].resp = strdup (resps[respnum % 3]); + ++respnum; + } + } + + /* Set the pointers in the response structure and return. */ + *response = reply; + return PAM_SUCCESS; +} + +static struct pam_conv conv = { + fake_conv, + NULL +}; + + +/* Check that errors of optional modules are ignored and that + required modules after a sufficient one are not executed. */ + +int +main(int argc, char *argv[]) +{ + pam_handle_t *pamh=NULL; + const char *user="tstpamunix"; + int retval; + int debug = 0; + int fail; + struct passwd *pwd; + + if (argc < 2 || (*argv[1] != 'f' && + *argv[1] != 'p')) + { + fprintf (stderr, "Need fail or pass argument.\n"); + return 2; + } + + fail = *argv[1] == 'f'; + + if (argc > 2 && strcmp (argv[2], "-d") == 0) + debug = 1; + + pwd = getpwnam (user); + + if (pwd == NULL) + { + if (debug) + fprintf (stderr, "unix4: Missing tstpamunix user.\n"); + return 2; + } + + /* we must switch the real (not effective) user so the restrictions + are enforced */ + setreuid (pwd->pw_uid, -1); + + retval = pam_start("tst-pam_unix4", user, &conv, &pamh); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "unix4: pam_start returned %d\n", retval); + return 1; + } + + retval = pam_chauthtok (pamh, 0); + if ((!fail && retval != PAM_SUCCESS) || (fail && retval == PAM_SUCCESS)) + { + if (debug) + fprintf (stderr, "unix4-1: pam_chauthtok returned %d\n", retval); + return 1; + } + + retval = pam_end (pamh,retval); + if (retval != PAM_SUCCESS) + { + if (debug) + fprintf (stderr, "unix4: pam_end returned %d\n", retval); + return 1; + } + return 0; +} diff --git a/xtests/tst-pam_unix4.pamd b/xtests/tst-pam_unix4.pamd new file mode 100644 index 00000000..4dc414fc --- /dev/null +++ b/xtests/tst-pam_unix4.pamd @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth required pam_unix.so +account required pam_unix.so +password required pam_unix.so debug +session required pam_unix.so + diff --git a/xtests/tst-pam_unix4.sh b/xtests/tst-pam_unix4.sh new file mode 100755 index 00000000..787c2f90 --- /dev/null +++ b/xtests/tst-pam_unix4.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU +/usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix +# this run must successfully change the password +./tst-pam_unix4 pass +RET=$? +/usr/sbin/usermod -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix +/usr/bin/chage -m 10000 tstpamunix +# this run must fail to change the password +./tst-pam_unix4 fail || RET=$? + +/usr/sbin/userdel -r tstpamunix 2> /dev/null +exit $RET |