From bf6d33204afa13a6778c1ac21e744808f6b08955 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Fri, 23 Dec 2011 15:46:46 -0800 Subject: [PATCH] Update build for OpenPAM Lycopsida. --- lib/libpam/Makefile | 17 +-- lib/libpam/config.h | 147 +++++++++++++++++++ lib/libpam/patches/openpam_configure.c.patch | 14 -- lib/libpam/patches/openpam_ttyconv.c.patch | 13 -- lib/pam_module/Makefile.inc | 9 +- lib/pam_module/Makefile.shlib | 1 - 6 files changed, 160 insertions(+), 41 deletions(-) create mode 100644 lib/libpam/config.h delete mode 100644 lib/libpam/patches/openpam_configure.c.patch delete mode 100644 lib/libpam/patches/openpam_ttyconv.c.patch delete mode 100644 lib/pam_module/Makefile.shlib diff --git a/lib/libpam/Makefile b/lib/libpam/Makefile index 18ef35060b..9d53b50ff4 100644 --- a/lib/libpam/Makefile +++ b/lib/libpam/Makefile @@ -1,20 +1,20 @@ LIB= pam SRCDIR= ${.CURDIR}/../../contrib/openpam -CONTRIBDIR= ${SRCDIR}/lib -PATCHES!= echo ${.CURDIR}/patches/*.patch -MODULE_DIR= /usr/lib/security +MODULE_DIR= ${LIBDIR}/security +CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -DOPENPAM_MODULES_DIR='"${MODULE_DIR}/"' -CFLAGS+= -DLIB_MAJ=${MODULE_SHLIB_MAJOR} -CFLAGS+= -I${SRCDIR}/lib +CFLAGS+= -I${SRCDIR}/lib -I${.CURDIR} -SRCS= openpam_borrow_cred.c openpam_configure.c openpam_dispatch.c +SRCS= openpam_borrow_cred.c openpam_check_owner_perms.c +SRCS+= openpam_configure.c openpam_constants.c openpam_dispatch.c SRCS+= openpam_dynamic.c openpam_findenv.c openpam_free_data.c SRCS+= openpam_free_envlist.c openpam_get_option.c openpam_load.c SRCS+= openpam_log.c openpam_nullconv.c openpam_readline.c SRCS+= openpam_restore_cred.c openpam_set_option.c openpam_static.c +SRCS+= openpam_subst.c SRCS+= openpam_ttyconv.c pam_acct_mgmt.c pam_authenticate.c SRCS+= pam_chauthtok.c pam_close_session.c pam_end.c pam_error.c SRCS+= pam_get_authtok.c pam_get_data.c pam_get_item.c pam_get_user.c @@ -23,7 +23,6 @@ SRCS+= pam_prompt.c pam_putenv.c pam_set_data.c pam_set_item.c pam_setcred.c SRCS+= pam_setenv.c pam_start.c pam_strerror.c pam_verror.c pam_vinfo.c SRCS+= pam_vprompt.c SRCS+= pam_debug_log.c -SRCS+= ${PATCHES} PAMINCS= openpam.h openpam_version.h pam_appl.h pam_constants.h PAMINCS+= pam_modules.h pam_types.h openpam_attr.h @@ -33,7 +32,8 @@ INCSDIR= ${INCLUDEDIR}/security MAN= openpam.3 openpam_borrow_cred.3 openpam_free_data.3 MAN+= openpam_free_envlist.3 openpam_get_option.3 openpam_log.3 MAN+= openpam_nullconv.3 openpam_readline.3 openpam_restore_cred.3 -MAN+= openpam_set_option.3 openpam_ttyconv.3 pam.3 pam_acct_mgmt.3 +MAN+= openpam_set_option.3 openpam_subst.3 +MAN+= openpam_ttyconv.3 pam.3 pam_acct_mgmt.3 MAN+= pam_authenticate.3 pam_chauthtok.3 pam_close_session.3 pam_conv.3 MAN+= pam_end.3 pam_error.3 pam_get_authtok.3 pam_get_data.3 pam_get_item.3 MAN+= pam_get_user.3 pam_getenv.3 pam_getenvlist.3 pam_info.3 @@ -45,5 +45,4 @@ MAN+= pam_verror.3 pam_vinfo.3 pam_vprompt.3 pam.conf.5 .PATH: ${SRCDIR}/lib ${SRCDIR}/doc/man -.include "../pam_module/Makefile.shlib" .include diff --git a/lib/libpam/config.h b/lib/libpam/config.h new file mode 100644 index 0000000000..224442a9b7 --- /dev/null +++ b/lib/libpam/config.h @@ -0,0 +1,147 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Whether loading unversioned modules support is disabled */ +/* #undef DISABLE_UNVERSIONED_MODULES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRYPT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `fpurge' function. */ +#define HAVE_FPURGE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `crypt' library (-lcrypt). */ +#define HAVE_LIBCRYPT 1 + +/* Define to 1 if you have the `dl' library (-ldl). */ +/* #undef HAVE_LIBDL */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcmp' function. */ +/* #undef HAVE_STRLCMP */ + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* OpenPAM library major number */ +#define LIB_MAJ 2 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Turn debugging on by default */ +/* #undef OPENPAM_DEBUG */ + +/* OpenPAM modules directory */ +/* Let the Makefile decide this */ +/* #define OPENPAM_MODULES_DIR "${exec_prefix}/lib/" */ + +/* Name of package */ +#define PACKAGE "openpam" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "des@des.no" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "OpenPAM" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "OpenPAM 20111218" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "openpam" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "20111218" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "20111218" + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict __restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +/* #undef volatile */ diff --git a/lib/libpam/patches/openpam_configure.c.patch b/lib/libpam/patches/openpam_configure.c.patch deleted file mode 100644 index 7830fe8643..0000000000 --- a/lib/libpam/patches/openpam_configure.c.patch +++ /dev/null @@ -1,14 +0,0 @@ -$DragonFly: src/lib/libpam/patches/openpam_configure.c.patch,v 1.1 2005/07/13 12:34:21 joerg Exp $ - ---- openpam_configure.c.orig 2005-07-07 19:43:40.000000000 +0200 -+++ openpam_configure.c 2005-07-07 19:44:09.000000000 +0200 -@@ -69,7 +69,8 @@ - match_word(const char *str, const char *word) - { - -- while (*str && tolower(*str) == tolower(*word)) -+ while (*str && -+ tolower((unsigned char)*str) == tolower((unsigned char)*word)) - ++str, ++word; - return (*str == ' ' && *word == '\0'); - } diff --git a/lib/libpam/patches/openpam_ttyconv.c.patch b/lib/libpam/patches/openpam_ttyconv.c.patch deleted file mode 100644 index bbe461021f..0000000000 --- a/lib/libpam/patches/openpam_ttyconv.c.patch +++ /dev/null @@ -1,13 +0,0 @@ -$DragonFly: src/lib/libpam/patches/openpam_ttyconv.c.patch,v 1.1 2005/07/13 12:34:21 joerg Exp $ - ---- openpam_ttyconv.c.orig 2005-07-07 19:46:23.000000000 +0200 -+++ openpam_ttyconv.c 2005-07-07 19:46:26.000000000 +0200 -@@ -65,7 +65,7 @@ - char buf[PAM_MAX_RESP_SIZE]; - struct sigaction action, saved_action; - sigset_t saved_sigset, sigset; -- unsigned int saved_alarm; -+ unsigned int saved_alarm = 0; - int eof, error, fd; - size_t len; - char *retval; diff --git a/lib/pam_module/Makefile.inc b/lib/pam_module/Makefile.inc index d8b6865e7c..1d1bd9e75d 100644 --- a/lib/pam_module/Makefile.inc +++ b/lib/pam_module/Makefile.inc @@ -1,13 +1,14 @@ +LIBPAMDIR= ${.CURDIR}/../../libpam +MODULE_SHLIB_MAJOR!=grep -w LIB_MAJ ${LIBPAMDIR}/config.h | awk '{print $$3}' SHLIB_NAME= ${LIB}.so.${MODULE_SHLIB_MAJOR} SHLIB_MAJOR= ${MODULE_SHLIB_MAJOR} NOINSTALLLIB= yes NOPROFILE= yes -TARGET_LIBDIR= /usr/lib/security -TARGET_SHLIBDIR= /usr/lib/security +TARGET_LIBDIR= ${LIBDIR}/security +TARGET_SHLIBDIR= ${LIBDIR}/security +CFLAGS+= -I${LIBPAMDIR} LDADD+= -lpam OPENPAM_DIR= ${.CURDIR}/../../../contrib/openpam - -.include "Makefile.shlib" diff --git a/lib/pam_module/Makefile.shlib b/lib/pam_module/Makefile.shlib deleted file mode 100644 index 59f9a16dcc..0000000000 --- a/lib/pam_module/Makefile.shlib +++ /dev/null @@ -1 +0,0 @@ -MODULE_SHLIB_MAJOR= 1 -- 2.41.0