Reverse sense of NO_STATIC_MODULES -> OPENPAM_STATIC_MODULES.

This avoids leaking NO_STATIC_MODULES into the public header, which
has led to considerable confusion and workarounds in pkgrsc.

PR security/39313
PR security/55216

ok christos
This commit is contained in:
riastradh 2020-04-29 02:16:56 +00:00
parent 91da5a2e36
commit 0f6461fb7e
4 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: openpam.h,v 1.9 2017/05/06 19:50:09 christos Exp $ */
/* $NetBSD: openpam.h,v 1.10 2020/04/29 02:16:56 riastradh Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@ -359,7 +359,7 @@ struct pam_module {
# define PAM_SOEXT ".so"
#endif
#if (defined(__GNUC__) || defined(__PCC__)) && !defined(NO_STATIC_MODULES)
#if (defined(__GNUC__) || defined(__PCC__)) && defined(OPENPAM_STATIC_MODULES)
# include <sys/cdefs.h>
# ifdef __FreeBSD__
# include <linker_set.h>
@ -369,7 +369,6 @@ struct pam_module {
# define SET_DECLARE(a, b) __link_set_decl(a, b)
# define SET_FOREACH(a, b) __link_set_foreach(a, b)
# endif
# define OPENPAM_STATIC_MODULES
# define PAM_EXTERN static
# define PAM_MODULE_ENTRY(name) \
static char _pam_name[] = name PAM_SOEXT; \

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.18 2017/05/06 19:52:25 christos Exp $
# $NetBSD: Makefile.inc,v 1.19 2020/04/29 02:16:56 riastradh Exp $
# Copyright 1998 Juniper Networks, Inc.
# All rights reserved.
#
@ -42,10 +42,6 @@ CPPFLAGS+= -DOPENPAM_MODULES_DIRECTORY=\"${MODLIBDIR}\"
# No debugging
#CPPFLAGS+= -DDEBUG
# ...and don't do either of those on the shared library.
# XXX CSHLIBFLAGS isn't perfect, but it'll do for now.
CSHLIBFLAGS+= -DNO_STATIC_MODULES
# Define the shared library version here. libpam and the modules share a
# version, and we need these variables early for module install rules.
SHLIB_MAJOR= 4

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.23 2020/03/03 00:46:06 christos Exp $
# $NetBSD: Makefile,v 1.24 2020/04/29 02:16:56 riastradh Exp $
#-
# Copyright (c) 1998 Juniper Networks, Inc.
# All rights reserved.
@ -206,6 +206,8 @@ openpam_static_modules.o: openpam_static.o ${STATIC_MODULE_LIBS}
${CC} ${LDFLAGS} -nostdlib -o ${.TARGET} -r -Wl,--whole-archive \
openpam_static.o ${STATIC_MODULE_LIBS}
CPPFLAGS.openpam_static.c+= -DOPENPAM_STATIC_MODULES
CWARNFLAGS.clang+= -Wno-error=tautological-pointer-compare
COPTS.openpam_dynamic.c+= ${GCC_NO_CAST_FUNCTION_TYPE}

View File

@ -1,4 +1,4 @@
# $NetBSD: mod.mk,v 1.15 2020/02/27 02:56:46 christos Exp $
# $NetBSD: mod.mk,v 1.16 2020/04/29 02:16:57 riastradh Exp $
NOLINT= # don't build a lint library
NOPROFILE= # don't build a profile library
@ -21,6 +21,7 @@ LIBDPLIBS+= pam ${NETBSDSRCDIR}/lib/libpam/libpam
libinstall:: ${DESTDIR}${LIBDIR}/${LIB}.so.${SHLIB_MAJOR}
.else
libinstall::
CPPFLAGS+= -DOPENPAM_STATIC_MODULES
.endif
.include <bsd.lib.mk>