Reorganize:

- move libpam into lib/libpam
 - move the OATH code into lib/liboath
 - move oath.h into include/security
 - update all pointers


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@646 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2013-03-05 17:49:06 +00:00
parent 374a1769ca
commit a9a5497d3f
106 changed files with 331 additions and 136 deletions

14
HISTORY
View file

@ -3,18 +3,20 @@ OpenPAM ?????????? 2013-??-??
- FEATURE: Add a pam_oath module that implements RFC 4226 (HOTP) and - FEATURE: Add a pam_oath module that implements RFC 4226 (HOTP) and
RFC 6238 (TOTP). RFC 6238 (TOTP).
- ENHANCE: Allow openpam_straddch(3) to be called without a character
so it can be used to preallocate a string.
- ENHANCE: Improve portability by adding simple asprintf(3) and
vasprintf(3) implementations for platforms that don't have them.
- ENHANCE: Move the libpam sources into a separate subdirectory.
- BUGFIX: When openpam_readword(3) encountered an opening quote, it - BUGFIX: When openpam_readword(3) encountered an opening quote, it
would set the first byte in the buffer to '\0', discarding all would set the first byte in the buffer to '\0', discarding all
existing text and, unless the buffer was empty to begin with, all existing text and, unless the buffer was empty to begin with, all
subsequent text as well. This went unnoticed because none of the subsequent text as well. This went unnoticed because none of the
unit tests for quoted strings had any text preceding the opening unit tests for quoted strings had any text preceding the opening
quote. quote.
- ENHANCE: Allow openpam_straddch(3) to be called without a character
so it can be used to preallocate a string.
- ENHANCE: Improve portability by adding simple asprintf(3) and
vasprintf(3) implementations for platforms that don't have them.
============================================================================ ============================================================================
OpenPAM Micrampelis 2012-05-26 OpenPAM Micrampelis 2012-05-26

View file

@ -11,9 +11,9 @@ set -ex
export CONFIG_SHELL=/bin/sh export CONFIG_SHELL=/bin/sh
./configure \ ./configure \
--with-oath \
--with-doc \ --with-doc \
--with-pam-unix \ --with-pam-unix \
--with-pam-oath \
--with-pamtest \ --with-pamtest \
--with-su \ --with-su \
--with-modules-dir=/usr/lib \ --with-modules-dir=/usr/lib \

View file

@ -1,7 +1,7 @@
# $Id$ # $Id$
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/libpam
noinst_PROGRAMS = openpam_dump_policy noinst_PROGRAMS = openpam_dump_policy
openpam_dump_policy_SOURCES = openpam_dump_policy.c openpam_dump_policy_SOURCES = openpam_dump_policy.c
openpam_dump_policy_LDADD = $(top_builddir)/lib/libpam.la openpam_dump_policy_LDADD = $(top_builddir)/lib/libpam/libpam.la

View file

@ -4,6 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
bin_PROGRAMS = pamtest bin_PROGRAMS = pamtest
pamtest_SOURCES = pamtest.c pamtest_SOURCES = pamtest.c
pamtest_LDADD = $(top_builddir)/lib/libpam.la pamtest_LDADD = $(top_builddir)/lib/libpam/libpam.la
dist_man1_MANS = pamtest.1 dist_man1_MANS = pamtest.1

View file

@ -4,6 +4,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
bin_PROGRAMS = su bin_PROGRAMS = su
su_SOURCES = su.c su_SOURCES = su.c
su_LDADD = $(top_builddir)/lib/libpam.la su_LDADD = $(top_builddir)/lib/libpam/libpam.la
dist_man1_MANS = su.1 dist_man1_MANS = su.1

View file

@ -3,7 +3,7 @@ dnl $Id$
AC_PREREQ([2.62]) AC_PREREQ([2.62])
AC_REVISION([$Id$]) AC_REVISION([$Id$])
AC_INIT([OpenPAM], [trunk], [des@des.no]) AC_INIT([OpenPAM], [trunk], [des@des.no])
AC_CONFIG_SRCDIR([lib/pam_start.c]) AC_CONFIG_SRCDIR([lib/libpam/pam_start.c])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign]) AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
@ -69,11 +69,11 @@ AC_ARG_WITH([pam-unix],
[with_pam_unix=no]) [with_pam_unix=no])
AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"]) AM_CONDITIONAL([WITH_PAM_UNIX], [test x"$with_pam_unix" = x"yes"])
AC_ARG_WITH([pam-oath], AC_ARG_WITH([oath],
AC_HELP_STRING([--with-pam-oath], [compile pam_oath(8) module]), AC_HELP_STRING([--with-oath], [compile OATH library, module and utility]),
[], [],
[with_pam_oath=no]) [with_oath=no])
AM_CONDITIONAL([WITH_PAM_OATH], [test x"$with_pam_oath" = x"yes"]) AM_CONDITIONAL([WITH_OATH], [test x"$with_oath" = x"yes"])
AC_ARG_WITH(pamtest, AC_ARG_WITH(pamtest,
AC_HELP_STRING([--with-pamtest], [compile test application]), AC_HELP_STRING([--with-pamtest], [compile test application]),
@ -137,6 +137,8 @@ AC_CONFIG_FILES([
include/Makefile include/Makefile
include/security/Makefile include/security/Makefile
lib/Makefile lib/Makefile
lib/liboath/Makefile
lib/libpam/Makefile
modules/Makefile modules/Makefile
modules/pam_deny/Makefile modules/pam_deny/Makefile
modules/pam_permit/Makefile modules/pam_permit/Makefile

View file

@ -73,7 +73,7 @@ CLEANFILES = $(ALLCMAN) openpam.3 pam.3
GENDOC = $(top_srcdir)/misc/gendoc.pl GENDOC = $(top_srcdir)/misc/gendoc.pl
LIBSRCDIR = $(top_srcdir)/lib LIBSRCDIR = $(top_srcdir)/lib/libpam
VPATH = $(LIBSRCDIR) $(srcdir) VPATH = $(LIBSRCDIR) $(srcdir)

View file

@ -1,8 +1,8 @@
# $Id$ # $Id$
openpamdir = $(includedir)/security securitydir = $(includedir)/security
openpam_HEADERS = \ security_HEADERS = \
openpam.h \ openpam.h \
openpam_attr.h \ openpam_attr.h \
openpam_version.h \ openpam_version.h \
@ -10,3 +10,7 @@ openpam_HEADERS = \
pam_constants.h \ pam_constants.h \
pam_modules.h \ pam_modules.h \
pam_types.h pam_types.h
if WITH_OATH
security_HEADERS += oath.h
endif

View file

@ -1,99 +1,7 @@
# $Id$ # $Id$
NULL = SUBDIRS = libpam
AM_CPPFLAGS = -I$(top_srcdir)/include if WITH_OATH
SUBDIRS += liboath
lib_LTLIBRARIES = libpam.la endif
noinst_HEADERS = \
openpam_asprintf.h \
openpam_constants.h \
openpam_cred.h \
openpam_ctype.h \
openpam_debug.h \
openpam_features.h \
openpam_impl.h \
openpam_strlcat.h \
openpam_strlcmp.h \
openpam_strlcpy.h \
openpam_vasprintf.h
libpam_la_SOURCES = \
openpam_asprintf.c \
openpam_borrow_cred.c \
openpam_check_owner_perms.c \
openpam_configure.c \
openpam_constants.c \
openpam_dispatch.c \
openpam_dynamic.c \
openpam_features.c \
openpam_findenv.c \
openpam_free_data.c \
openpam_free_envlist.c \
openpam_get_feature.c \
openpam_get_option.c \
openpam_load.c \
openpam_log.c \
openpam_nullconv.c \
openpam_readline.c \
openpam_readlinev.c \
openpam_readword.c \
openpam_restore_cred.c \
openpam_set_option.c \
openpam_set_feature.c \
openpam_static.c \
openpam_strlcat.c \
openpam_strlcpy.c \
openpam_straddch.c \
openpam_subst.c \
openpam_vasprintf.c \
openpam_ttyconv.c \
pam_acct_mgmt.c \
pam_authenticate.c \
pam_chauthtok.c \
pam_close_session.c \
pam_end.c \
pam_error.c \
pam_get_authtok.c \
pam_get_data.c \
pam_get_item.c \
pam_get_user.c \
pam_getenv.c \
pam_getenvlist.c \
pam_info.c \
pam_open_session.c \
pam_prompt.c \
pam_putenv.c \
pam_set_data.c \
pam_set_item.c \
pam_setcred.c \
pam_setenv.c \
pam_start.c \
pam_strerror.c \
pam_verror.c \
pam_vinfo.c \
pam_vprompt.c \
$(NULL)
libpam_la_LDFLAGS = -no-undefined -version-info @LIB_MAJ@
libpam_la_LIBADD = @DL_LIBS@
EXTRA_DIST = \
pam_authenticate_secondary.c \
pam_get_mapped_authtok.c \
pam_get_mapped_username.c \
pam_set_mapped_authtok.c \
pam_set_mapped_username.c \
\
pam_sm_acct_mgmt.c \
pam_sm_authenticate.c \
pam_sm_authenticate_secondary.c \
pam_sm_chauthtok.c \
pam_sm_close_session.c \
pam_sm_get_mapped_authtok.c \
pam_sm_get_mapped_username.c \
pam_sm_open_session.c \
pam_sm_set_mapped_authtok.c \
pam_sm_set_mapped_username.c \
pam_sm_setcred.c

15
lib/liboath/Makefile.am Normal file
View file

@ -0,0 +1,15 @@
# $Id$
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/libpam
lib_LTLIBRARIES = liboath.la
liboath_la_SOURCES = \
oath_base32.c \
oath_base64.c \
oath_hotp.c \
oath_totp.c \
oath_key.c
liboath_la_LDFLAGS = -no-undefined -version-info @LIB_MAJ@
liboath_la_LIBADD = $(top_builddir)/lib/libpam/libpam.la

View file

@ -38,7 +38,7 @@
#include <errno.h> #include <errno.h>
#include <stdint.h> #include <stdint.h>
#include "oath.h" #include <security/oath.h>
static const char b32[] = static const char b32[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";

View file

@ -38,7 +38,7 @@
#include <errno.h> #include <errno.h>
#include <stdint.h> #include <stdint.h>
#include "oath.h" #include <security/oath.h>
static const char b64[] = static const char b64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

View file

@ -39,7 +39,7 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "oath.h" #include <security/oath.h>
#define StToNum(St) (St) #define StToNum(St) (St)

View file

@ -49,7 +49,7 @@
#include "openpam_asprintf.h" #include "openpam_asprintf.h"
#include "openpam_strlcmp.h" #include "openpam_strlcmp.h"
#include "oath.h" #include <security/oath.h>
/* /*
* Allocate a struct oath_key with sufficient additional space for the * Allocate a struct oath_key with sufficient additional space for the

View file

@ -37,7 +37,7 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include "oath.h" #include <security/oath.h>
#define TOTP_TIME_STEP 30 #define TOTP_TIME_STEP 30

99
lib/libpam/Makefile.am Normal file
View file

@ -0,0 +1,99 @@
# $Id$
NULL =
AM_CPPFLAGS = -I$(top_srcdir)/include
lib_LTLIBRARIES = libpam.la
noinst_HEADERS = \
openpam_asprintf.h \
openpam_constants.h \
openpam_cred.h \
openpam_ctype.h \
openpam_debug.h \
openpam_features.h \
openpam_impl.h \
openpam_strlcat.h \
openpam_strlcmp.h \
openpam_strlcpy.h \
openpam_vasprintf.h
libpam_la_SOURCES = \
openpam_asprintf.c \
openpam_borrow_cred.c \
openpam_check_owner_perms.c \
openpam_configure.c \
openpam_constants.c \
openpam_dispatch.c \
openpam_dynamic.c \
openpam_features.c \
openpam_findenv.c \
openpam_free_data.c \
openpam_free_envlist.c \
openpam_get_feature.c \
openpam_get_option.c \
openpam_load.c \
openpam_log.c \
openpam_nullconv.c \
openpam_readline.c \
openpam_readlinev.c \
openpam_readword.c \
openpam_restore_cred.c \
openpam_set_option.c \
openpam_set_feature.c \
openpam_static.c \
openpam_strlcat.c \
openpam_strlcpy.c \
openpam_straddch.c \
openpam_subst.c \
openpam_vasprintf.c \
openpam_ttyconv.c \
pam_acct_mgmt.c \
pam_authenticate.c \
pam_chauthtok.c \
pam_close_session.c \
pam_end.c \
pam_error.c \
pam_get_authtok.c \
pam_get_data.c \
pam_get_item.c \
pam_get_user.c \
pam_getenv.c \
pam_getenvlist.c \
pam_info.c \
pam_open_session.c \
pam_prompt.c \
pam_putenv.c \
pam_set_data.c \
pam_set_item.c \
pam_setcred.c \
pam_setenv.c \
pam_start.c \
pam_strerror.c \
pam_verror.c \
pam_vinfo.c \
pam_vprompt.c \
$(NULL)
libpam_la_LDFLAGS = -no-undefined -version-info @LIB_MAJ@
libpam_la_LIBADD = @DL_LIBS@
EXTRA_DIST = \
pam_authenticate_secondary.c \
pam_get_mapped_authtok.c \
pam_get_mapped_username.c \
pam_set_mapped_authtok.c \
pam_set_mapped_username.c \
\
pam_sm_acct_mgmt.c \
pam_sm_authenticate.c \
pam_sm_authenticate_secondary.c \
pam_sm_chauthtok.c \
pam_sm_close_session.c \
pam_sm_get_mapped_authtok.c \
pam_sm_get_mapped_username.c \
pam_sm_open_session.c \
pam_sm_set_mapped_authtok.c \
pam_sm_set_mapped_username.c \
pam_sm_setcred.c

View file

@ -6,6 +6,6 @@ if WITH_PAM_UNIX
SUBDIRS += pam_unix SUBDIRS += pam_unix
endif endif
if WITH_PAM_OATH if WITH_OATH
SUBDIRS += pam_oath SUBDIRS += pam_oath
endif endif

View file

@ -8,4 +8,4 @@ pkglib_LTLIBRARIES = pam_deny.la
pam_deny_la_SOURCES = pam_deny.c pam_deny_la_SOURCES = pam_deny.c
pam_deny_la_LDFLAGS = -no-undefined -module -version-info @LIB_MAJ@ \ pam_deny_la_LDFLAGS = -no-undefined -module -version-info @LIB_MAJ@ \
-export-symbols-regex '^pam_sm_' -export-symbols-regex '^pam_sm_'
pam_deny_la_LIBADD = $(top_builddir)/lib/libpam.la pam_deny_la_LIBADD = $(top_builddir)/lib/libpam/libpam.la

Some files were not shown because too many files have changed in this diff Show more