diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-04-28 10:10:08 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-04-28 10:10:08 +0000 |
commit | ea951fdc8682146f7f03216a7839441678d45657 (patch) | |
tree | 1c270ce5309d39976c61297109b31212bb43a562 | |
parent | aa8e2399ead6c8e87c3fd878fcb4f0f1d008abf7 (diff) | |
download | pam-ea951fdc8682146f7f03216a7839441678d45657.tar.gz pam-ea951fdc8682146f7f03216a7839441678d45657.tar.bz2 pam-ea951fdc8682146f7f03216a7839441678d45657.zip |
build: rework vendordir substitution
Since Make.xml.rules is the only place where XSLTPROC_CUSTOM was used,
remove stereotypic definitions from other Makefiles, this way we no
longer have to worry about vendordir being used somewhere else in
documentation files.
Likewise, define VENDORDIR in config.h and remove stereotypic
-DVENDORDIR= additions from other Makefiles, this way we no longer
have to worry about VENDORDIR being used somewhere else in the code.
* configure.ac (AM_CONDITIONAL): Remove HAVE_VENDORDIR.
(AC_DEFINE_UNQUOTED): Add VENDORDIR.
(AC_SUBST): Remove VENDORDIR, add STRINGPARAM_VENDORDIR.
* Make.xml.rules.in: Replace $(XSLTPROC_CUSTOM) with
@STRINGPARAM_VENDORDIR@.
* doc/man/Makefile.am (XSLTPROC_CUSTOM): Remove.
* libpam/Makefile.am [HAVE_VENDORDIR]: Remove.
* modules/pam_securetty/Makefile.am [HAVE_VENDORDIR]: Remove.
(XSLTPROC_CUSTOM): Remove.
* modules/pam_securetty/pam_securetty.c: Move definitions of local
macros after config.h to benefit from macros defined there.
-rw-r--r-- | Make.xml.rules.in | 10 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | doc/man/Makefile.am | 5 | ||||
-rw-r--r-- | libpam/Makefile.am | 3 | ||||
-rw-r--r-- | modules/pam_securetty/Makefile.am | 8 | ||||
-rw-r--r-- | modules/pam_securetty/pam_securetty.c | 16 |
6 files changed, 21 insertions, 31 deletions
diff --git a/Make.xml.rules.in b/Make.xml.rules.in index 9bda445f..daa1b97b 100644 --- a/Make.xml.rules.in +++ b/Make.xml.rules.in @@ -5,22 +5,22 @@ README: $(XMLS) README: README.xml - $(XSLTPROC) --path $(srcdir) --xinclude --stringparam generate.toc "none" $(XSLTPROC_CUSTOM) --nonet $(top_srcdir)/doc/custom-html.xsl $< | $(BROWSER) > $(srcdir)/$@ + $(XSLTPROC) --path $(srcdir) --xinclude --stringparam generate.toc "none" @STRINGPARAM_VENDORDIR@ --nonet $(top_srcdir)/doc/custom-html.xsl $< | $(BROWSER) > $(srcdir)/$@ %.1: %.1.xml $(XMLLINT) --nonet --xinclude --postvalid --noout $< - $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude $(XSLTPROC_CUSTOM) --nonet $(top_srcdir)/doc/custom-man.xsl $< + $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude @STRINGPARAM_VENDORDIR@ --nonet $(top_srcdir)/doc/custom-man.xsl $< %.3: %.3.xml $(XMLLINT) --nonet --xinclude --postvalid --noout $< - $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude $(XSLTPROC_CUSTOM) --nonet $(top_srcdir)/doc/custom-man.xsl $< + $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude @STRINGPARAM_VENDORDIR@ --nonet $(top_srcdir)/doc/custom-man.xsl $< %.5: %.5.xml $(XMLLINT) --nonet --xinclude --postvalid --noout $< - $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude $(XSLTPROC_CUSTOM) --nonet $(top_srcdir)/doc/custom-man.xsl $< + $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude @STRINGPARAM_VENDORDIR@ --nonet $(top_srcdir)/doc/custom-man.xsl $< %.8: %.8.xml $(XMLLINT) --nonet --xinclude --postvalid --noout $< - $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude $(XSLTPROC_CUSTOM) --nonet $(top_srcdir)/doc/custom-man.xsl $< + $(XSLTPROC) -o $(srcdir)/$@ --path $(srcdir) --xinclude @STRINGPARAM_VENDORDIR@ --nonet $(top_srcdir)/doc/custom-man.xsl $< #CLEANFILES += $(man_MANS) README diff --git a/configure.ac b/configure.ac index 43e95e51..3d641db9 100644 --- a/configure.ac +++ b/configure.ac @@ -544,8 +544,14 @@ AC_SUBST([ECONF_CFLAGS]) AC_SUBST([ECONF_LIBS]) AC_ARG_ENABLE([vendordir], AS_HELP_STRING([--enable-vendordir=DIR], [Directory for distribution provided configuration files]),,[]) -AC_SUBST([VENDORDIR], [$enable_vendordir]) -AM_CONDITIONAL([HAVE_VENDORDIR], [test "x$enable_vendordir" != x]) +if test -n "$enable_vendordir"; then + AC_DEFINE_UNQUOTED([VENDORDIR], ["$enable_vendordir"], + [Directory for distribution provided configuration files]) + STRINGPARAM_VENDORDIR="--stringparam vendordir '$enable_vendordir'" +else + STRINGPARAM_VENDORDIR="--stringparam vendordir '<vendordir>'" +fi +AC_SUBST([STRINGPARAM_VENDORDIR]) dnl Checks for header files. AC_HEADER_DIRENT diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 8e76897e..78c891df 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -59,10 +59,5 @@ pam.d.5: pam.conf.5 pam_get_item.3: pam_item_types_std.inc.xml pam_item_types_ext.inc.xml pam_set_data.3: pam_item_types_std.inc.xml pam_item_types_ext.inc.xml pam.conf.5: pam.conf-desc.xml pam.conf-dir.xml pam.conf-syntax.xml -if HAVE_VENDORDIR -XSLTPROC_CUSTOM = --stringparam vendordir $(VENDORDIR) -else -XSLTPROC_CUSTOM = --stringparam vendordir "<vendordir>" -endif -include $(top_srcdir)/Make.xml.rules endif diff --git a/libpam/Makefile.am b/libpam/Makefile.am index 67048702..41ac9845 100644 --- a/libpam/Makefile.am +++ b/libpam/Makefile.am @@ -6,9 +6,6 @@ AM_CFLAGS = -DDEFAULT_MODULE_PATH=\"$(SECUREDIR)/\" -DLIBPAM_COMPILE \ -I$(srcdir)/include $(LIBPRELUDE_CFLAGS) $(ECONF_CFLAGS) \ -DPAM_VERSION=\"$(VERSION)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ $(WARN_CFLAGS) -if HAVE_VENDORDIR - AM_CFLAGS += -DVENDORDIR=\"$(VENDORDIR)\" -endif CLEANFILES = *~ diff --git a/modules/pam_securetty/Makefile.am b/modules/pam_securetty/Makefile.am index 093da829..1b11d953 100644 --- a/modules/pam_securetty/Makefile.am +++ b/modules/pam_securetty/Makefile.am @@ -22,19 +22,11 @@ AM_LDFLAGS = -no-undefined -avoid-version -module if HAVE_VERSIONING AM_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map endif -if HAVE_VENDORDIR - AM_CFLAGS += -DVENDORDIR=\"$(VENDORDIR)\" -endif securelib_LTLIBRARIES = pam_securetty.la pam_securetty_la_LIBADD = $(top_builddir)/libpam/libpam.la if ENABLE_REGENERATE_MAN noinst_DATA = README -if HAVE_VENDORDIR -XSLTPROC_CUSTOM = --stringparam vendordir $(VENDORDIR) -else -XSLTPROC_CUSTOM = --stringparam vendordir "<vendordir>" -endif -include $(top_srcdir)/Make.xml.rules endif diff --git a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c index 51249a9c..e594fb6a 100644 --- a/modules/pam_securetty/pam_securetty.c +++ b/modules/pam_securetty/pam_securetty.c @@ -1,13 +1,5 @@ /* pam_securetty module */ -#define SECURETTY_FILE "/etc/securetty" -#ifdef VENDORDIR -#define SECURETTY2_FILE VENDORDIR"/securetty" -#endif -#define TTY_PREFIX "/dev/" -#define CMDLINE_FILE "/proc/cmdline" -#define CONSOLEACTIVE_FILE "/sys/class/tty/console/active" - /* * by Elliot Lee <sopwith@redhat.com>, Red Hat Software. * July 25, 1996. @@ -48,6 +40,14 @@ #define PAM_DEBUG_ARG 0x0001 #define PAM_NOCONSOLE_ARG 0x0002 +#define SECURETTY_FILE "/etc/securetty" +#ifdef VENDORDIR +#define SECURETTY2_FILE VENDORDIR"/securetty" +#endif +#define TTY_PREFIX "/dev/" +#define CMDLINE_FILE "/proc/cmdline" +#define CONSOLEACTIVE_FILE "/sys/class/tty/console/active" + static int _pam_parse (const pam_handle_t *pamh, int argc, const char **argv) { |