[PATCH] Miscellaneous cleanup

Daniel Richard G. skunk at iSKUNK.ORG
Sat Jul 8 06:39:21 UTC 2006


Hello,

I've been working on the pam_exec module lately, and in the course of that, 
have fixed various small issues in the tree. Patches are attached, and 
below is the bullet-list summary.

These changes are mostly to the ends of

1. Allowing "make distcheck" to succeed
2. Allowing a build with -ansi -pedantic et al. to succeed
3. Eliminating some low-hanging-fruit warnings


configure.in:

	* Renamed pam_conv.y to pam_conv_y.y (more on this later)

	* Added AC_HELP_STRING()s to various AC_ARG_ENABLE() calls, as the 
	  quoting was wonky. Use autoconf quadrigraphs instead of '[' and 
	  ']' inside []-quoted strings.

	  (Note: the --enable-isadir bit is _really_ broken. I'm not sure 
	  what's supposed to happen there, but at the very least, backticks 
	  are not supposed to be used to print the help message)

	* Set the default DOCDIR to $datadir/doc/pam, instead of 
	  hard-coding /usr/share/doc/pam.

conf/pam_conv1/Makefile.am:

	* Made use of automake's built-in lex/yacc know-how

	* Renamed the parser source files to allow the automake logic to 
	  work: (1) The .lex extension is unrecognized, but .l is, and (2) 
	  the lex and yacc file must have different basenames, as the 
	  automake rules produce C source files with the same basename as 
	  the lex/yacc input files. In sum:
	  
	  	pam_conv.lex => pam_conv_l.l -> pam_conv_l.c
	  	pam_conv.y   => pam_conv_y.y -> pam_conv_y.[hc]
	  	
	  Attached is a separate patch covering minor changes needed by 
	  these files to cope with the new names.

doc/Makefile.am:

	* Use straight automake variables instead of a hook rule. (This 
	  takes care of "make uninstall" as well)

doc/{adg,mwg,sag}/Makefile.am:

	* Rewrote the test -f rules so that they work as advertised. 
	  Previously, if a test -f check failed, make(1) would see the
	  non-zero exit status and report that the rule failed.

doc/specs/Makefile.am:

	* Use automake's lex/yacc know-how.
	
	* Renamed the parser source files appropriately (separate patch 
	  also attached)

	* Use automake variables instead of a hook rule.

libpam/(various).c:

	* "#if HAVE_LIBAUDIT" is wrong, because HAVE_LIBAUDIT is either 
	  defined or it isn't, and if it's not defined, the preprocessor 
	  complains because it wants an integer value. Use "#ifdef".

libpam/pam_static.c:

	* A few extra lines to avoid the "ISO C prohibits an empty source 
	  file" warning

modules/pam_limits/pam_limits.c:

	* defined(linux) is false in ANSI mode, but defined(__linux) is 
	  true.

modules/pam_userdb/Makefile.am:

	* Don't compile tst-pam_userdb if you don't have libdb.

tests/tst-dlopen.c:

	* Was missing config.h.


Please let me know if there are any issues with the patches; I'll be happy 
to address them.


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk at iskunk.org        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk at alum.mit.edu      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/configure.in,v
retrieving revision 1.95
diff -u -b -r1.95 configure.in
--- configure.in	3 Jul 2006 07:23:29 -0000	1.95
+++ configure.in	8 Jul 2006 05:48:10 -0000
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(conf/pam_conv1/pam_conv.y)
+AC_INIT(conf/pam_conv1/pam_conv_y.y)
 AM_INIT_AUTOMAKE("Linux-PAM", 0.99.5.0)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_HOST
@@ -223,12 +223,12 @@
 AC_SUBST(WITH_DEBUG)
 
 AC_ARG_ENABLE(securedir,
-[  --enable-securedir=<path to location of PAMs> [default \$libdir/security]],
+	AC_HELP_STRING([--enable-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
 	SECUREDIR=$enableval, SECUREDIR=$libdir/security)
 AC_SUBST(SECUREDIR)
 
 AC_ARG_ENABLE([isadir],
-	AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files [default ../../`basename $libdir`/security]]),
+	AC_HELP_STRING([--enable-isadir=DIR],[path to arch-specific module files @<:@default=../../(basename of $libdir)/security@:>@]),
 ISA=$enableval,
 ISA=../../`basename $libdir`/security)
 unset mylibdirbase
@@ -236,25 +236,25 @@
 AC_MSG_RESULT([Defining \$ISA to "$ISA"])
 
 AC_ARG_ENABLE(sconfigdir,
-[  --enable-sconfigdir=<path to module conf files> [default \$sysconfdir/security]],
+	AC_HELP_STRING([--enable-sconfigdir=DIR],[path to module conf files @<:@default=$sysconfdir/security@:>@]),
 	SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
 AC_SUBST(SCONFIGDIR)
 
 AC_ARG_ENABLE(docdir,
-[  --enable-docdir=<path to store documentation in - /usr/share/doc/pam>],
-	DOCDIR=$enableval, DOCDIR=/usr/share/doc/pam)
+	AC_HELP_STRING([--enable-docdir=DIR],[path to documentation @<:@default=$datadir/doc/pam@:>@]),
+	DOCDIR=$enableval, DOCDIR=$datadir/doc/pam)
 AC_SUBST(DOCDIR)
 
 
 AC_ARG_ENABLE(pamlocking,
-[  --enable-pamlocking      configure libpam to observe a global authentication lock],
+	AC_HELP_STRING([--enable-pamlocking],[configure libpam to observe a global authentication lock]),
 	WITH_PAMLOCKING=yes ; AC_DEFINE([PAM_LOCKING],,
 		[libpam should observe a global authentication lock]),
 		WITH_PAMLOCKING=no)
 AC_SUBST(WITH_PAMLOCKING)
 
 AC_ARG_ENABLE(read-both-confs,
-[  --enable-read-both-confs  read both /etc/pam.d and /etc/pam.conf files],
+	AC_HELP_STRING([--enable-read-both-confs],[read both /etc/pam.d and /etc/pam.conf files]),
 	AC_DEFINE([PAM_READ_BOTH_CONFS],,
 		[read both /etc/pam.d and /etc/pam.conf files]))
 AC_SUBST(PAM_READ_BOTH_CONFS)
Index: conf/pam_conv1/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/conf/pam_conv1/Makefile.am,v
retrieving revision 1.3
diff -u -b -r1.3 Makefile.am
--- conf/pam_conv1/Makefile.am	27 Sep 2005 06:16:12 -0000	1.3
+++ conf/pam_conv1/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -6,9 +6,13 @@
 
 EXTRA_DIST = README
 
+AM_YFLAGS = -d
+
+BUILT_SOURCES = pam_conv_y.h
+
 noinst_PROGRAMS = pam_conv1
 
-pam_conv1_SOURCES = pam_conv.lex pam_conv.y
+pam_conv1_SOURCES = pam_conv_l.l pam_conv_y.y
 
 pam_conv1_LDADD = @LEXLIB@
 
Index: doc/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/doc/Makefile.am,v
retrieving revision 1.14
diff -u -b -r1.14 Makefile.am
--- doc/Makefile.am	29 Jun 2006 06:26:28 -0000	1.14
+++ doc/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -6,13 +6,11 @@
 
 CLEANFILES = *~
 
-EXTRA_DIST = index.html
+htmldir = $(DOCDIR)/html
 
-#######################################################
+dist_html_DATA = index.html
 
-install-data-local:
-	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/html
-	install -m 644 $(srcdir)/index.html $(DESTDIR)$(DOCDIR)/html/
+#######################################################
 
 releasedocs: all
 	$(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/specs
Index: doc/adg/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/doc/adg/Makefile.am,v
retrieving revision 1.4
diff -u -b -r1.4 Makefile.am
--- doc/adg/Makefile.am	29 Jun 2006 06:26:28 -0000	1.4
+++ doc/adg/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -52,35 +52,35 @@
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/txt
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/pdf
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/html
-	test -f html/Linux-PAM_ADG.html && \
+	test -f html/Linux-PAM_ADG.html || exit 0; \
 	    $(install_sh_DATA) html/Linux-PAM_ADG.html html/adg-*.html \
 		$(DESTDIR)$(DOCDIR)/html/ || \
 	    $(install_sh_DATA) $(srcdir)/html/Linux-PAM_ADG.html \
 		$(srcdir)/html/sag-*.html \
 		$(DESTDIR)$(DOCDIR)/html/
-	test -f Linux-PAM_ADG.txt && \
+	test -f Linux-PAM_ADG.txt || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_ADG.txt $(DESTDIR)$(DOCDIR)/txt/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_ADG.txt \
 		$(DESTDIR)$(DOCDIR)/txt/
-	test -f Linux-PAM_ADG.pdf && \
+	test -f Linux-PAM_ADG.pdf || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_ADG.pdf $(DESTDIR)$(DOCDIR)/pdf/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_ADG.pdf \
 		$(DESTDIR)$(DOCDIR)/pdf/
 
 releasedocs: all
 	$(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html
-	test -f html/Linux-PAM_ADG.html && \
+	test -f html/Linux-PAM_ADG.html || exit 0; \
 	    cp -ap html/Linux-PAM_ADG.html html/adg-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html/ || \
 	    cp -ap $(srcdir)/html/Linux-PAM_ADG.html \
 		$(srcdir)/html/adg-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html/
-	test -f Linux-PAM_ADG.txt && \
+	test -f Linux-PAM_ADG.txt || exit 0; \
 	    cp -p Linux-PAM_ADG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/ || \
 	    cp -p $(srcdir)/Linux-PAM_ADG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/
-	test -f Linux-PAM_ADG.pdf && \
+	test -f Linux-PAM_ADG.pdf || exit 0; \
 	    cp -p Linux-PAM_ADG.pdf \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/ || \
 	    cp -p $(srcdir)/Linux-PAM_ADG.pdf \
Index: doc/mwg/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/doc/mwg/Makefile.am,v
retrieving revision 1.4
diff -u -b -r1.4 Makefile.am
--- doc/mwg/Makefile.am	29 Jun 2006 06:26:28 -0000	1.4
+++ doc/mwg/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -52,35 +52,35 @@
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/txt
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/pdf
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/html
-	test -f html/Linux-PAM_MWG.html && \
+	test -f html/Linux-PAM_MWG.html || exit 0; \
 	    $(install_sh_DATA) html/Linux-PAM_MWG.html html/mwg-*.html \
 		$(DESTDIR)$(DOCDIR)/html/ || \
 	    $(install_sh_DATA) $(srcdir)/html/Linux-PAM_MWG.html \
 		$(srcdir)/html/sag-*.html \
 		$(DESTDIR)$(DOCDIR)/html/
-	test -f Linux-PAM_MWG.txt && \
+	test -f Linux-PAM_MWG.txt || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_MWG.txt $(DESTDIR)$(DOCDIR)/txt/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_MWG.txt \
 		$(DESTDIR)$(DOCDIR)/txt/
-	test -f Linux-PAM_MWG.pdf && \
+	test -f Linux-PAM_MWG.pdf || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_MWG.pdf $(DESTDIR)$(DOCDIR)/pdf/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_MWG.pdf \
 		$(DESTDIR)$(DOCDIR)/pdf/
 
 releasedocs: all
 	$(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html
-	test -f html/Linux-PAM_MWG.html && \
+	test -f html/Linux-PAM_MWG.html || exit 0; \
 	    cp -ap html/Linux-PAM_MWG.html html/mwg-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html/ || \
 	    cp -ap $(srcdir)/html/Linux-PAM_MWG.html \
 		$(srcdir)/html/mwg-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html/
-	test -f Linux-PAM_MWG.txt && \
+	test -f Linux-PAM_MWG.txt || exit 0; \
 	    cp -p Linux-PAM_MWG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/ || \
 	    cp -p $(srcdir)/Linux-PAM_MWG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/
-	test -f Linux-PAM_MWG.pdf && \
+	test -f Linux-PAM_MWG.pdf || exit 0; \
 	    cp -p Linux-PAM_MWG.pdf \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/ || \
 	    cp -p $(srcdir)/Linux-PAM_MWG.pdf \
Index: doc/sag/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/doc/sag/Makefile.am,v
retrieving revision 1.4
diff -u -b -r1.4 Makefile.am
--- doc/sag/Makefile.am	29 Jun 2006 06:26:28 -0000	1.4
+++ doc/sag/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -52,35 +52,35 @@
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/txt
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/pdf
 	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/html
-	test -f html/Linux-PAM_SAG.html && \
+	test -f html/Linux-PAM_SAG.html || exit 0; \
 	    $(install_sh_DATA) html/Linux-PAM_SAG.html html/sag-*.html \
 		$(DESTDIR)$(DOCDIR)/html/ || \
 	    $(install_sh_DATA) $(srcdir)/html/Linux-PAM_SAG.html \
 		$(srcdir)/html/sag-*.html \
 		$(DESTDIR)$(DOCDIR)/html/
-	test -f Linux-PAM_SAG.txt && \
+	test -f Linux-PAM_SAG.txt || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_SAG.txt $(DESTDIR)$(DOCDIR)/txt/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_SAG.txt \
 		$(DESTDIR)$(DOCDIR)/txt/
-	test -f Linux-PAM_SAG.pdf && \
+	test -f Linux-PAM_SAG.pdf || exit 0; \
 	    $(install_sh_DATA) Linux-PAM_SAG.pdf $(DESTDIR)$(DOCDIR)/pdf/ || \
 	    $(install_sh_DATA) $(srcdir)/Linux-PAM_SAG.pdf \
 		$(DESTDIR)$(DOCDIR)/pdf/
 
 releasedocs: all
 	$(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html
-	test -f html/Linux-PAM_SAG.html && \
+	test -f html/Linux-PAM_SAG.html || exit 0; \
 	    cp -ap html/Linux-PAM_SAG.html html/sag-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html/ || \
 	    cp -ap $(srcdir)/html/Linux-PAM_SAG.html \
 		$(srcdir)/html/sag-*.html \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html/
-	test -f Linux-PAM_SAG.txt && \
+	test -f Linux-PAM_SAG.txt || exit 0; \
 	    cp -p Linux-PAM_SAG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/ || \
 	    cp -p $(srcdir)/Linux-PAM_SAG.txt \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/
-	test -f Linux-PAM_SAG.pdf && \
+	test -f Linux-PAM_SAG.pdf || exit 0; \
 	    cp -p Linux-PAM_SAG.pdf \
 		$(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/ || \
 	    cp -p $(srcdir)/Linux-PAM_SAG.pdf \
Index: doc/specs/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/doc/specs/Makefile.am,v
retrieving revision 1.5
diff -u -b -r1.5 Makefile.am
--- doc/specs/Makefile.am	19 Jun 2006 15:38:34 -0000	1.5
+++ doc/specs/Makefile.am	8 Jul 2006 05:48:10 -0000
@@ -6,24 +6,19 @@
 
 EXTRA_DIST = draft-morgan-pam.raw std-agent-id.raw rfc86.0.txt
 
-all: draft-morgan-pam-current.txt
-	test -f rfc86.0.txt || cp -p $(srcdir)/rfc86.0.txt .
-
 draft-morgan-pam-current.txt: padout draft-morgan-pam.raw
 	./padout < $(srcdir)/draft-morgan-pam.raw > draft-morgan-pam-current.txt
 
+AM_YFLAGS = -d
+
+BUILT_SOURCES = parse_y.h
+
 noinst_PROGRAMS = padout
 
-padout_SOURCES = parse.y parse.lex
+padout_SOURCES = parse_l.l parse_y.y
 
 padout_LDADD = @LEXLIB@
 
-parse.c: lex.yy.c
-
-lex.yy.c: $(srcdir)/parse.lex
-	$(LEX) $(srcdir)/parse.lex
+specdir = $(DOCDIR)/spec
 
-install-data-local:
-	$(mkinstalldirs) $(DESTDIR)$(DOCDIR)/spec
-	$(INSTALL_DATA) draft-morgan-pam-current.txt $(DESTDIR)$(DOCDIR)/spec/
-	$(INSTALL_DATA) rfc86.0.txt $(DESTDIR)$(DOCDIR)/spec/
+spec_DATA = draft-morgan-pam-current.txt rfc86.0.txt
Index: libpam/pam_account.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_account.c,v
retrieving revision 1.4
diff -u -b -r1.4 pam_account.c
--- libpam/pam_account.c	12 Jan 2006 10:06:49 -0000	1.4
+++ libpam/pam_account.c	8 Jul 2006 05:48:10 -0000
@@ -19,7 +19,7 @@
 
     retval = _pam_dispatch(pamh, flags, PAM_ACCOUNT);
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_ACCOUNT, retval, flags);
 #endif
 
Index: libpam/pam_audit.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_audit.c,v
retrieving revision 1.2
diff -u -b -r1.2 pam_audit.c
--- libpam/pam_audit.c	13 Jan 2006 14:55:18 -0000	1.2
+++ libpam/pam_audit.c	8 Jul 2006 05:48:10 -0000
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <syslog.h>
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
 #include <libaudit.h>
 #include <pwd.h>
 #include <netdb.h>
Index: libpam/pam_auth.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_auth.c,v
retrieving revision 1.6
diff -u -b -r1.6 pam_auth.c
--- libpam/pam_auth.c	12 Jan 2006 10:06:49 -0000	1.6
+++ libpam/pam_auth.c	8 Jul 2006 05:48:10 -0000
@@ -45,7 +45,7 @@
     prelude_send_alert(pamh, retval);
 #endif
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_AUTHENTICATE, retval, flags);
 #endif
 
@@ -71,7 +71,7 @@
 
     retval = _pam_dispatch(pamh, flags, PAM_SETCRED);
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_SETCRED, retval, flags);
 #endif
 
Index: libpam/pam_password.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_password.c,v
retrieving revision 1.4
diff -u -b -r1.4 pam_password.c
--- libpam/pam_password.c	12 Jan 2006 10:06:49 -0000	1.4
+++ libpam/pam_password.c	8 Jul 2006 05:48:10 -0000
@@ -52,7 +52,7 @@
 	D(("will resume when ready", retval));
     }
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_CHAUTHTOK, retval, flags);
 #endif
 
Index: libpam/pam_private.h
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_private.h,v
retrieving revision 1.18
diff -u -b -r1.18 pam_private.h
--- libpam/pam_private.h	14 Jun 2006 11:41:47 -0000	1.18
+++ libpam/pam_private.h	8 Jul 2006 05:48:10 -0000
@@ -149,7 +149,7 @@
     const char *mod_name;	/* Name of the module currently executed */
     int choice;			/* Which function we call from the module */
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     int audit_state;             /* keep track of reported audit messages */
 #endif
 };
@@ -293,7 +293,7 @@
 #define __PAM_TO_APP(pamh)    \
         do { (pamh)->caller_is = _PAM_CALLED_FROM_APP; } while (0)
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
 extern int _pam_auditlog(pam_handle_t *pamh, int action, int retval, int flags);
 extern int _pam_audit_end(pam_handle_t *pamh, int pam_status);
 #endif
Index: libpam/pam_session.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_session.c,v
retrieving revision 1.5
diff -u -b -r1.5 pam_session.c
--- libpam/pam_session.c	12 Jan 2006 10:06:49 -0000	1.5
+++ libpam/pam_session.c	8 Jul 2006 05:48:10 -0000
@@ -22,7 +22,7 @@
     }
     retval = _pam_dispatch(pamh, flags, PAM_OPEN_SESSION);
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_OPEN_SESSION, retval, flags);
 #endif                                                                                
     return retval;
@@ -43,7 +43,7 @@
 
     retval = _pam_dispatch(pamh, flags, PAM_CLOSE_SESSION);
 
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     retval = _pam_auditlog(pamh, PAM_CLOSE_SESSION, retval, flags);
 #endif
 
Index: libpam/pam_start.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_start.c,v
retrieving revision 1.8
diff -u -b -r1.8 pam_start.c
--- libpam/pam_start.c	12 Jan 2006 10:06:49 -0000	1.8
+++ libpam/pam_start.c	8 Jul 2006 05:48:10 -0000
@@ -88,7 +88,7 @@
     (*pamh)->oldauthtok = NULL;
     (*pamh)->fail_delay.delay_fn_ptr = NULL;
     (*pamh)->former.choice = PAM_NOT_STACKED;
-#if HAVE_LIBAUDIT
+#ifdef HAVE_LIBAUDIT
     (*pamh)->audit_state = 0;
 #endif
 
Index: libpam/pam_static.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_static.c,v
retrieving revision 1.5
diff -u -b -r1.5 pam_static.c
--- libpam/pam_static.c	24 Jan 2006 23:28:32 -0000	1.5
+++ libpam/pam_static.c	8 Jul 2006 05:48:10 -0000
@@ -84,7 +84,11 @@
     return ((voidfunc *)NULL);
 }
 
-#endif /* PAM_STATIC */
+#else /* ! PAM_STATIC */
+
+typedef int blarg;
+
+#endif /* ! PAM_STATIC */
 
 /*
  * Copyright (C) 1995 by Red Hat Software, Michael K. Johnson
Index: modules/pam_limits/pam_limits.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/modules/pam_limits/pam_limits.c,v
retrieving revision 1.37
diff -u -b -r1.37 pam_limits.c
--- modules/pam_limits/pam_limits.c	23 Jun 2006 10:10:32 -0000	1.37
+++ modules/pam_limits/pam_limits.c	8 Jul 2006 05:48:12 -0000
@@ -13,7 +13,7 @@
  * See end for Copyright information
  */
 
-#if !(defined(linux))
+#if !defined(linux) && !defined(__linux)
 #error THIS CODE IS KNOWN TO WORK ONLY ON LINUX !!!
 #endif
 
Index: modules/pam_userdb/Makefile.am
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/modules/pam_userdb/Makefile.am,v
retrieving revision 1.9
diff -u -b -r1.9 Makefile.am
--- modules/pam_userdb/Makefile.am	13 Jun 2006 18:52:36 -0000	1.9
+++ modules/pam_userdb/Makefile.am	8 Jul 2006 05:48:12 -0000
@@ -9,8 +9,6 @@
 man_MANS = pam_userdb.8
 XMLS = README.xml pam_userdb.8.xml
 
-TESTS = tst-pam_userdb
-
 securelibdir = $(SECUREDIR)
 secureconfdir = $(SCONFIGDIR)
 
@@ -23,6 +21,7 @@
 
 if HAVE_LIBDB
   securelib_LTLIBRARIES = pam_userdb.la
+  TESTS = tst-pam_userdb
 endif
 
 noinst_HEADERS = pam_userdb.h
Index: tests/tst-dlopen.c
===================================================================
RCS file: /cvsroot/pam/Linux-PAM/tests/tst-dlopen.c,v
retrieving revision 1.1
diff -u -b -r1.1 tst-dlopen.c
--- tests/tst-dlopen.c	12 Mar 2006 08:36:48 -0000	1.1
+++ tests/tst-dlopen.c	8 Jul 2006 05:48:12 -0000
@@ -7,6 +7,10 @@
    (at your option) any later version.
 */
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <dlfcn.h>
 #include <stdio.h>
 #include <limits.h>
-------------- next part --------------
--- pam_conv.lex	2006-07-08 02:26:16.959211522 -0400
+++ pam_conv_l.l	2006-07-08 01:29:38.472149897 -0400
@@ -13,6 +13,14 @@
 	"$Id: pam_conv.lex,v 1.2 2005/08/18 11:11:46 kukuk Exp $\n"
 	"Copyright (c) Andrew G. Morgan 1997 <morgan at parc.power.net>\n";
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include "pam_conv_y.h"
+
     extern int current_line;
 %}
 
--- pam_conv.y	2006-07-08 02:26:17.018198172 -0400
+++ pam_conv_y.y	2006-07-08 01:30:20.746588017 -0400
@@ -13,6 +13,10 @@
 	"$Id: pam_conv.y,v 1.4 2005/09/27 06:16:12 kukuk Exp $\n"
 	"Copyright (c) Andrew G. Morgan 1997-8 <morgan at linux.kernel.org>\n";
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <string.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -20,6 +24,8 @@
 #include <ctype.h>
 #include <sys/stat.h>
 
+    extern int yylex(void);
+
     int current_line=1;
     extern char *yytext;
 
@@ -162,8 +168,6 @@
 
 %%
 
-#include "lex.yy.c"
-
 const char *old_to_new_ctrl_flag(const char *old)
 {
     static const char *clist[] = {
-------------- next part --------------
--- parse.lex	2006-07-08 02:27:27.982138566 -0400
+++ parse_l.l	2006-07-08 01:23:35.698201919 -0400
@@ -1,3 +1,13 @@
+%{
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include "parse_y.h"
+%}
+
 %%
 
 \#[\$]+[a-zA-Z]*(\=[0-9]+)?          return NEW_COUNTER;
--- parse.y	2006-07-08 02:27:28.025128837 -0400
+++ parse_y.y	2006-07-08 01:21:13.599340612 -0400
@@ -1,5 +1,9 @@
 
 %{
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -12,13 +16,12 @@
     int line=1;
     char *last_label=NULL;
 
+    extern int yylex(void);
+    extern char *yytext;
     extern void yyerror(const char *x);
     extern char *get_label(const char *label);
     extern void set_label(const char *label, const char *target);
     char *new_counter(const char *key);
-
-#include "lex.yy.c"
-
 %}
 
 %union {


More information about the Pam-list mailing list