aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules3
-rw-r--r--Makefile.am12
-rw-r--r--NEWS44
-rw-r--r--README8
-rw-r--r--README-alpha2
-rw-r--r--README-hacking2
-rw-r--r--acinclude.m42
-rw-r--r--configure.ac54
-rw-r--r--doc/.gitignore3
-rw-r--r--doc/Makefile.am18
-rw-r--r--doc/debugcat.texi2
-rw-r--r--doc/ex-meta1.texi2
-rw-r--r--doc/gendocs.pl480
-rwxr-xr-xdoc/gendocs.sh490
-rw-r--r--doc/gendocs_template76
-rw-r--r--doc/html.init164
-rw-r--r--doc/macros.texi2
-rw-r--r--doc/otherdoc.texi.in9
-rw-r--r--doc/smap.texi927
-rw-r--r--doc/sockmap.texi2
-rw-r--r--doc/webdoc.init8
-rw-r--r--git2chg.awk45
-rw-r--r--include/Makefile.am2
-rw-r--r--include/smap/.gitignore1
-rw-r--r--include/smap/Makefile.am4
-rw-r--r--include/smap/diag.h2
-rw-r--r--include/smap/kwtab.h2
-rw-r--r--include/smap/module.h14
-rw-r--r--include/smap/parseopt.h2
-rw-r--r--include/smap/printf.h2
-rw-r--r--include/smap/stream.h4
-rw-r--r--include/smap/streamdef.h2
-rw-r--r--include/smap/url.h2
-rw-r--r--include/smap/wordsplit.h263
-rw-r--r--lib/Makefile.am14
-rw-r--r--lib/asnprintf.c2
-rw-r--r--lib/asprintf.c2
-rw-r--r--lib/debug.c2
-rw-r--r--lib/diag.c2
-rw-r--r--lib/fileoutstr.c2
-rw-r--r--lib/kwtab.c2
-rw-r--r--lib/memstr.c158
-rw-r--r--lib/nullstr.c55
-rw-r--r--lib/parseopt.c77
-rw-r--r--lib/progname.c2
-rw-r--r--lib/sockmapstr.c2
-rw-r--r--lib/stderr.c2
-rw-r--r--lib/stream.c3
-rw-r--r--lib/stream_printf.c2
-rw-r--r--lib/stream_vprintf.c2
-rw-r--r--lib/syslog.c2
-rw-r--r--lib/syslogstr.c2
-rw-r--r--lib/tracestr.c2
-rw-r--r--lib/url.c2
-rw-r--r--lib/vasnprintf.c2
m---------lib/wordsplit0
-rw-r--r--lib/wordsplit.c2447
-rw-r--r--lib/xscript.c2
-rw-r--r--modules/Makefile.am28
-rw-r--r--modules/echo/Makefile.am4
-rw-r--r--modules/echo/echo.c4
-rw-r--r--modules/getent/Makefile.am25
-rw-r--r--modules/getent/getent.c1067
-rw-r--r--modules/guile/Makefile.am4
-rw-r--r--modules/guile/getpw.scm4
-rw-r--r--modules/guile/guile.c102
-rw-r--r--modules/ldap/Makefile.am4
-rw-r--r--modules/ldap/ldap.c196
-rw-r--r--modules/lua/Makefile.am25
-rw-r--r--modules/lua/lua.c314
-rw-r--r--modules/mailutils/Makefile.am4
-rw-r--r--modules/mailutils/mailutils.c194
-rw-r--r--modules/mysql/Makefile.am4
-rw-r--r--modules/mysql/mysql.c4
-rw-r--r--modules/postgres/Makefile.am4
-rw-r--r--modules/postgres/postgres.c4
-rw-r--r--modules/sed/Makefile.am4
-rw-r--r--modules/sed/sed.c4
-rw-r--r--modules/sed/transform.c10
-rw-r--r--modules/sed/transform.h2
-rw-r--r--src/Makefile.am9
-rw-r--r--src/cfg.c10
-rw-r--r--src/close-fds.c2
-rw-r--r--src/cmdline.opt10
-rw-r--r--src/common.h4
-rw-r--r--src/getopt.m44
-rw-r--r--src/list.h134
-rw-r--r--src/log.c2
-rw-r--r--src/mem.c36
-rw-r--r--src/module.c280
-rw-r--r--src/query.c397
-rw-r--r--src/smapc.c70
-rw-r--r--src/smapccmd.opt12
-rw-r--r--src/smapd.c21
-rw-r--r--src/smapd.cfin2
-rw-r--r--src/smapd.h64
-rw-r--r--src/srvman.c2
-rw-r--r--src/srvman.h2
-rw-r--r--src/userprivs.c2
-rw-r--r--tests/.gitignore8
-rw-r--r--tests/Makefile.am54
-rw-r--r--tests/atlocal.in12
-rw-r--r--tests/dispatch.at31
-rw-r--r--tests/echo.at18
-rw-r--r--tests/guile.at83
-rw-r--r--tests/ldap.at125
-rw-r--r--tests/lua.at88
-rw-r--r--tests/parseopt.at102
-rw-r--r--tests/sed.at30
-rw-r--r--tests/smaptest.c461
-rw-r--r--tests/testopt.c130
-rw-r--r--tests/testsuite.at19
113 files changed, 5123 insertions, 4556 deletions
diff --git a/.gitignore b/.gitignore
index 7733ae0..1ed9f2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,7 +25,6 @@ config.status
configure
core
git-describe
-libltdl
libtool
m4
stamp-h1
diff --git a/.gitmodules b/.gitmodules
index 7c369d4..50664b0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "gint"]
path = gint
url = git://git.gnu.org.ua/gint.git
+[submodule "lib/wordsplit"]
+ path = lib/wordsplit
+ url = git://git.gnu.org.ua/wordsplit.git
diff --git a/Makefile.am b/Makefile.am
index 1f89b10..cefc16f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
# This file is part of Smap.
-# Copyright (C) 2010, 2014 Sergey Poznyakoff
+# Copyright (C) 2010, 2014, 2021 Sergey Poznyakoff
#
# Smap is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,13 +15,13 @@
# along with Smap. If not, see <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4 -I gint
-SUBDIRS = libltdl include lib src gint modules doc
+SUBDIRS = include lib src gint modules doc tests
distuninstallcheck_listfiles = find . -type f -not -name 'smapd.conf' -print
.PHONY: ChangeLog
-ChangeLog:
- $(AM_V_GEN)if test -d .git; then \
- git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \
- awk -f $(top_srcdir)/git2chg.awk > ChangeLog; \
+ChangeLog:
+ $(AM_V_GEN)if test -d .git; then \
+ git log --pretty='format:%ad %cn <%ae>%n%n%w(72,8,8)%s%n%n%b' \
+ --date=short > ChangeLog; \
fi
diff --git a/NEWS b/NEWS
index efe0707..9e2e59d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,46 @@
-Smap NEWS -- history of user-visible changes. 2015-06-20
-Copyright (C) 2006-2010, 2014-1015 Sergey Poznyakoff
+Smap NEWS -- history of user-visible changes. 2021-07-09
See the end of file for copying conditions.
Please send Smap bug reports to <gray+smap@gnu.org.ua>
+
+Version 2.1.90 (git)
+
+* Modules are loaded using plain dlopen/dlsym
+
+* New dispatch condition: in
+
+The condition "ARG in NAME", where ARG is "key" or "map" and NAME is a
+database name evaluates to true if the lookup of ARG in the database
+NAME gives positive result, i.e. a response beginning with the word "OK".
+
+* New module: getent
+
+* New module: lua
+
+* Modules can indicate per-database capabilities
+
+The smap_module structure has a new member, smap_dbcap, which
+can be called in order to determine capabilities provided by a
+particular database:
+
+ int (*smap_dbcap)(smap_database_t dbp)
+
+This function is used when the smap_capabilities value has the
+SMAP_CAPA_DBCAP flag set. The function returns actual database
+capabilities as a bitmask. Notice, that smap_dbcap is called
+and the returned value consulted only if the module reports a
+particular capability. I.e. in the presence of SMAP_CAPA_DBCAP,
+the SMAP_CAPA_QUERY and SMAP_CAPA_XFORM capability mean that
+a module can provide a particular capability, but the actual
+database is not required to do so.
+
+Version 2.1, 2021-07-01
+
+* Support for Guile 2.2
+
+* Bugfixes
+
+* Improved testsuite
Version 2.0, 2015-06-20
@@ -74,7 +112,7 @@ Version 1.0, 2010-06-19
=========================================================================
Copyright information:
-Copyright (C) 2006-2010, 2014-1015 Sergey Poznyakoff
+Copyright (C) 2006-2021 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/README b/README
index 170a593..393c379 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
Smap README
-Copyright (C) 2006-2010, 2014 Sergey Poznyakoff
+See end of file for copying conditions.
* Introduction
==============
@@ -70,7 +70,7 @@ Compile with TCP wrappers (libwrap) support. This is the default.
Compile with GNU Mailutils, build the `mailutils' module. By default,
this is enabled if configure determines that a sufficiently new
-version of GNU Mailutils (i.e. 2.0 or newer) is installed.
+version of GNU Mailutils (i.e. 3.0 or newer) is installed.
See http://www.gnu.org/software/mailutils for more information on GNU
Mailutils including file downloads.
@@ -79,7 +79,7 @@ Mailutils including file downloads.
Compile with Guile support; build the `guile' module. By default,
this is enabled if configure determines that a sufficiently new
-version of Guile (i.e. 1.8 or newer) is installed.
+version of Guile (i.e. 2.2 or newer) is installed.
See http://www.gnu.org/software/guile for additional information on
Guile including file downloads.
@@ -109,7 +109,7 @@ will remain intact.
* Copyright information
-Copyright (C) 2006, 2007, 2008, 2009, 2010 Sergey Poznyakoff
+Copyright (C) 2006-2021 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/README-alpha b/README-alpha
index 43661c4..57885b1 100644
--- a/README-alpha
+++ b/README-alpha
@@ -54,7 +54,7 @@ See INSTALL and README for the detailed instructions.
* Copyright information:
-Copyright (C) 2010, 2014 Sergey Poznyakoff
+Copyright (C) 2010-2021 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/README-hacking b/README-hacking
index 7c186a1..28a58fe 100644
--- a/README-hacking
+++ b/README-hacking
@@ -51,7 +51,7 @@ Similarly, for debugging from Emacs run:
* Copyright information
-Copyright (C) 2006-2010, 2014 Sergey Poznyakoff
+Copyright (C) 2006-2021 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/acinclude.m4 b/acinclude.m4
index 361de60..bade9e5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,5 +1,5 @@
dnl This file is part of Smap. -*- autoconf -*-
-dnl Copyright (C) 2010, 2014 Sergey Poznyakoff
+dnl Copyright (C) 2010-2021 Sergey Poznyakoff
dnl
dnl Smap is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
diff --git a/configure.ac b/configure.ac
index 8bec28d..cb08a15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# This file is part of Smap. -*- autoconf -*-
-# Copyright (C) 2010, 2014-2016 Sergey Poznyakoff
+# Copyright (C) 2010-2021 Sergey Poznyakoff
#
# Smap is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,11 +16,13 @@
AC_PREREQ(2.63)
m4_define([SMAP_VERSION_MAJOR], 2)
-m4_define([SMAP_VERSION_MINOR], 0)
+m4_define([SMAP_VERSION_MINOR], 1)
m4_define([SMAP_VERSION_PATCH], 90)
AC_INIT([smap],
SMAP_VERSION_MAJOR.SMAP_VERSION_MINOR[]m4_ifdef([SMAP_VERSION_PATCH],.SMAP_VERSION_PATCH),
- [gray+smap@gnu.org.ua])
+ [gray+smap@gnu.org.ua],
+ [smap],
+ [http://smap.software.gnu.org.ua])
AC_CONFIG_SRCDIR([src/smapd.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
@@ -37,14 +39,10 @@ AC_SUBST(SMAP_MODDIR,'$(libdir)/$(PACKAGE)')
AC_PROG_CC
AC_PROG_LN_S
-dnl Checks for libraries.
-LT_PREREQ(2.2.5a)
-LT_CONFIG_LTDL_DIR([libltdl])
-LT_INIT([dlopen])
-LTDL_INIT([recursive])
-LT_WITH_LTDL
-AC_CONFIG_FILES([libltdl/Makefile])
+dnl Checks for libraries
+LT_INIT([disable-static])
+AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyaddr)
@@ -101,7 +99,7 @@ AC_ARG_WITH([mailutils],
[status_mailutils=maybe])
if test $status_mailutils != no; then
- AM_GNU_MAILUTILS(2.99.992, [all],
+ AM_GNU_MAILUTILS(3.0, [all],
[status_mailutils=yes],
[if test $status_mailutils = yes; then
AC_MSG_ERROR([GNU Mailutils not found])
@@ -112,7 +110,7 @@ fi
AM_CONDITIONAL([MAILUTILS_COND],[test $status_mailutils = yes])
# Guile
-GINT_INIT([gint],[1.8 with-guile nodoc],
+GINT_INIT([gint],[2.2.0 with-guile nodoc],
[status_guile=yes],
[status_guile=no])
AM_CONDITIONAL([GUILE_COND],[test $status_guile = yes])
@@ -176,6 +174,12 @@ if test $status_ldap != no; then
fi])
fi
AM_CONDITIONAL([LDAP_COND],[test $status_ldap = yes])
+if test $status_ldap = yes; then
+ AC_ARG_VAR([SLAPD],[Full pathname of the slapd binary (for testsuite)])
+ AC_PATH_PROG([SLAPD], [slapd], [], $PATH:/usr/libexec:/usr/local/libexec)
+ AC_ARG_VAR([SLAPADD],[Full pathname of the slapadd binary (for testsuite)])
+ AC_PATH_PROG([SLAPADD], [slapadd], [], $PATH:/sbin:/usr/sbin:/usr/local/sbin)
+fi
# Readline
AC_ARG_WITH([readline],
@@ -221,6 +225,28 @@ if test "$status_readline" != "no"; then
fi
fi
+# Test for Lua
+AC_ARG_WITH([lua],
+ AC_HELP_STRING([--with-lua],
+ [use Lua]),
+ [status_lua=${withval}],
+ [status_lua=probe])
+PKG_PROG_PKG_CONFIG
+set -x
+if test $status_lua != no; then
+ PKG_CHECK_MODULES([LUA], [lua >= 5.3],
+ [status_lua=yes],
+ [status_lua=no])
+fi
+set +x
+AM_CONDITIONAL([LUA_COND],[test $status_lua = yes])
+
+# ##
+AC_CONFIG_LINKS(include/smap/wordsplit.h:lib/wordsplit/wordsplit.h)
+
+AC_CONFIG_TESTDIR(tests)
+AC_CONFIG_FILES([tests/Makefile tests/atlocal])
+AM_MISSING_PROG([AUTOM4TE], [autom4te])