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 /modules/pam_securetty | |
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.
Diffstat (limited to 'modules/pam_securetty')
-rw-r--r-- | modules/pam_securetty/Makefile.am | 8 | ||||
-rw-r--r-- | modules/pam_securetty/pam_securetty.c | 16 |
2 files changed, 8 insertions, 16 deletions
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) { |