diff options
author | Iker Pedrosa <ipedrosa@redhat.com> | 2023-07-10 12:45:12 +0200 |
---|---|---|
committer | Iker Pedrosa <ipedrosa@redhat.com> | 2023-07-17 09:53:24 +0200 |
commit | 45c2c496dcf89f568b90fcf403af9d63b2361fbd (patch) | |
tree | c2e0262b853da37f475f1f8b648cfa5d1b12380a /configure.ac | |
parent | 1fbf123d982b90d41463df7b6b59a4e544263358 (diff) | |
download | pam-45c2c496dcf89f568b90fcf403af9d63b2361fbd.tar.gz pam-45c2c496dcf89f568b90fcf403af9d63b2361fbd.tar.bz2 pam-45c2c496dcf89f568b90fcf403af9d63b2361fbd.zip |
pam_userdb: enable GDBM support
* configure.ac: add `gdbm` option to `enable-db`
* modules/pam_userdb/pam_userdb.c: conditionally provide database access
depending on the database technology
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 6666b1b2..7565a830 100644 --- a/configure.ac +++ b/configure.ac @@ -436,10 +436,10 @@ if test -n "$opt_randomdev"; then AC_DEFINE_UNQUOTED(PAM_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.]) fi -dnl check for libdb or libndbm as fallback. Some libndbm compat +dnl check for libdb or gdbm or libndbm as fallback. Some libndbm compat dnl libraries are unusable, so try libdb first. AC_ARG_ENABLE([db], - AS_HELP_STRING([--enable-db=(db|ndbm|yes|no)],[Default behavior 'yes', which is to check for libdb first, followed by ndbm. Use 'no' to disable db support.]), + AS_HELP_STRING([--enable-db=(db|gdbm|ndbm|yes|no)],[Default behavior 'yes', which is to check for libdb first, followed by gdbm and ndbm. Use 'no' to disable db support.]), WITH_DB=$enableval, WITH_DB=yes) AC_ARG_WITH([db-uniquename], AS_HELP_STRING([--with-db-uniquename=extension],[Unique name for db libraries and functions.])) @@ -451,6 +451,12 @@ if test x"$WITH_DB" != xno ; then [LIBDB="-ldb$with_db_uniquename"; break]) LIBS=$old_libs fi + if test x"$WITH_DB" = xgdbm ; then + AC_CHECK_LIB([gdbm],[gdbm_store], LIBDB="-lgdbm", LIBDB="") + if test -n "$LIBDB" ; then + AC_CHECK_HEADERS(gdbm.h) + fi + fi if test -z "$LIBDB" ; then AC_CHECK_LIB([ndbm],[dbm_store], LIBDB="-lndbm", LIBDB="") if test -n "$LIBDB" ; then |