# HG changeset patch # User Taylor R Campbell # Date 1588120617 0 # Wed Apr 29 00:36:57 2020 +0000 # Branch trunk # Node ID 961ad43108e782718f6363791d1e4f8515f41ccf # Parent e97f864210ce4fb3a39a1b09857e39cfeda7710c 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 diff -r e97f864210ce -r 961ad43108e7 external/bsd/openpam/dist/include/security/openpam.h --- a/external/bsd/openpam/dist/include/security/openpam.h Tue Apr 28 16:27:25 2020 +0000 +++ b/external/bsd/openpam/dist/include/security/openpam.h Wed Apr 29 00:36:57 2020 +0000 @@ -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 # ifdef __FreeBSD__ # include @@ -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; \ diff -r e97f864210ce -r 961ad43108e7 lib/libpam/Makefile.inc --- a/lib/libpam/Makefile.inc Tue Apr 28 16:27:25 2020 +0000 +++ b/lib/libpam/Makefile.inc Wed Apr 29 00:36:57 2020 +0000 @@ -42,10 +42,6 @@ CPPFLAGS+= -DOPENPAM_MODULES_DIRECTORY=\ # 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 diff -r e97f864210ce -r 961ad43108e7 lib/libpam/libpam/Makefile --- a/lib/libpam/libpam/Makefile Tue Apr 28 16:27:25 2020 +0000 +++ b/lib/libpam/libpam/Makefile Wed Apr 29 00:36:57 2020 +0000 @@ -206,6 +206,8 @@ openpam_static_modules.o: openpam_static ${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} diff -r e97f864210ce -r 961ad43108e7 lib/libpam/modules/mod.mk --- a/lib/libpam/modules/mod.mk Tue Apr 28 16:27:25 2020 +0000 +++ b/lib/libpam/modules/mod.mk Wed Apr 29 00:36:57 2020 +0000 @@ -21,6 +21,7 @@ LIBDPLIBS+= pam ${NETBSDSRCDIR}/li libinstall:: ${DESTDIR}${LIBDIR}/${LIB}.so.${SHLIB_MAJOR} .else libinstall:: +CPPFLAGS+= -DOPENPAM_STATIC_MODULES .endif .include