summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile.am4
-rw-r--r--NEWS31
-rw-r--r--README-alpha2
-rw-r--r--README-hacking2
-rw-r--r--TODO2
-rw-r--r--am/anubis.m42
-rw-r--r--am/gnutls.m42
-rw-r--r--am/gpgme.m42
-rw-r--r--build/Makefile.am3
-rw-r--r--build/guile-1.6/.gitignore2
-rw-r--r--build/guile-1.6/Makefile.am21
-rwxr-xr-xbuild/guile-1.6/guile-doc-snarf72
-rw-r--r--build/guile-1.6/guile-doc-snarf.awk88
-rwxr-xr-xbuild/keygen.sh2
-rwxr-xr-xbuild/specgen.sh2
-rw-r--r--configure.ac66
-rw-r--r--contrib/Makefile.am2
-rwxr-xr-xcontrib/msg2smtp.pl2
-rw-r--r--doc/Makefile.am2
-rw-r--r--elisp/Makefile.am2
-rw-r--r--elisp/anubis-mode.el2
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/anubis.scm2
-rw-r--r--examples/pam/Makefile.am2
-rw-r--r--gnulib.modules1
-rw-r--r--guile/Makefile.am2
-rw-r--r--guile/entire-msg.scm2
-rw-r--r--guile/remailer.scm2
-rw-r--r--guile/rot-13.scm2
-rw-r--r--lib/.gitignore57
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/keyword.c2
-rw-r--r--lib/keyword.h2
-rw-r--r--po/POTFILES.in3
-rw-r--r--scripts/Makefile.am2
-rw-r--r--src/Makefile.am38
-rw-r--r--src/adm.opt2
-rw-r--r--src/anubisadm.c4
-rw-r--r--src/anubisadm.h2
-rw-r--r--src/anubisdb.c2
-rw-r--r--src/anubisusr.c7
-rw-r--r--src/anubisusr.h2
-rw-r--r--src/authmode.c2
-rw-r--r--src/daemon.c6
-rw-r--r--src/dbtext.c2
-rw-r--r--src/env.opt9
-rw-r--r--src/errs.c2
-rw-r--r--src/esmtp.c2
-rw-r--r--src/exec.c2
-rw-r--r--src/extern.h2
-rw-r--r--src/gdbm.c30
-rw-r--r--src/getopt.m44
-rw-r--r--src/gpg.c23
-rw-r--r--src/gsasl.c7
-rw-r--r--src/gsasl_srv.c2
-rw-r--r--src/guile.c25
-rw-r--r--src/headers.h8
-rw-r--r--src/help.c5
-rw-r--r--src/ident.c2
-rw-r--r--src/list.c2
-rw-r--r--src/list.h2
-rw-r--r--src/log.c2
-rw-r--r--src/logport.c240
-rw-r--r--src/main.c12
-rw-r--r--src/map.c2
-rw-r--r--src/mda.c2
-rw-r--r--src/message.c2
-rw-r--r--src/mime.c4
-rw-r--r--src/misc.c2
-rw-r--r--src/mysql.c2
-rw-r--r--src/net.c4
-rw-r--r--src/pgsql.c2
-rw-r--r--src/proclist.c2
-rw-r--r--src/quit.c2
-rw-r--r--src/rc-gram.y2
-rw-r--r--src/rc-lex.l2
-rw-r--r--src/rcfile.c18
-rw-r--r--src/rcfile.h2
-rw-r--r--src/regex.c2
-rw-r--r--src/smtprepl.c2
-rw-r--r--src/smtprepl.h2
-rw-r--r--src/socks.c2
-rw-r--r--src/sql.c2
-rw-r--r--src/sql.h2
-rw-r--r--src/stream.c8
-rw-r--r--src/tls.c5
-rw-r--r--src/transmode.c2
-rw-r--r--src/tunnel.c4
-rw-r--r--src/url.c2
-rw-r--r--src/usr.opt2
-rw-r--r--src/xdatabase.c2
-rw-r--r--tests/.gitignore8
-rw-r--r--tests/Makefile.am91
-rw-r--r--tests/anubisusr.at131
-rw-r--r--tests/anustart.c372
-rw-r--r--tests/atlocal.in14
-rw-r--r--tests/badd.at82
-rw-r--r--tests/bmod.at84
-rw-r--r--tests/cond.at89
-rw-r--r--tests/empty.at50
-rw-r--r--tests/fadd.at78
-rw-r--r--tests/gpgcrypt.at101
-rw-r--r--tests/gpgse.at102
-rw-r--r--tests/gpgsign.at105
-rw-r--r--tests/hadd00.at71
-rw-r--r--tests/hadd01.at (renamed from testsuite/etc/del2.pat)96
-rw-r--r--tests/hadd02.at (renamed from testsuite/etc/add3.pat)87
-rw-r--r--tests/hdel00.at71
-rw-r--r--tests/hdel01.at (renamed from testsuite/etc/add2.pat)101
-rw-r--r--tests/hdel02.at (renamed from testsuite/etc/del3.pat)88
-rw-r--r--tests/hdel03.at72
-rw-r--r--tests/hmod.at109
-rw-r--r--tests/mime00.at (renamed from testsuite/etc/mime1.pat)54
-rw-r--r--tests/mime01.at (renamed from testsuite/etc/mime2.pat)55
-rw-r--r--tests/mta.c (renamed from testsuite/mta.c)23
-rw-r--r--tests/mult.at (renamed from testsuite/etc/mult.pat)74
-rw-r--r--tests/no-backref.at72
-rw-r--r--tests/paolo.at71
-rw-r--r--tests/parse.at103
-rw-r--r--tests/remailer.at88
-rw-r--r--tests/rot-13.at145
-rw-r--r--tests/testsuite.at73
-rw-r--r--tests/tlsoneway.at80
-rw-r--r--tests/trigger.at101
-rw-r--r--testsuite/.gitignore9
-rw-r--r--testsuite/Makefile.am94
-rw-r--r--testsuite/anubis.authmode/DISTFILES5
-rw-r--r--testsuite/anubis.authmode/abase.exp107
-rw-r--r--testsuite/anubis.authmode/base.exp9
-rw-r--r--testsuite/anubis.authmode/gpg.exp9
-rw-r--r--testsuite/anubis.authmode/guile.exp9
-rw-r--r--testsuite/anubis.authmode/mime.exp9
-rw-r--r--testsuite/anubis/DISTFILES7
-rw-r--r--testsuite/anubis/abase.exp21
-rw-r--r--testsuite/anubis/base.exp59
-rw-r--r--testsuite/anubis/gpg.exp26
-rw-r--r--testsuite/anubis/guile.exp24
-rw-r--r--testsuite/anubis/mime.exp24
-rw-r--r--testsuite/anubis/no-backref.exp29
-rw-r--r--testsuite/anubis/paolo.exp3
-rw-r--r--testsuite/anubis/tls.exp23
-rw-r--r--testsuite/data/.gitignore5
-rw-r--r--testsuite/data/Makefile.am30
-rw-r--r--testsuite/data/anubis.pem33
-rw-r--r--testsuite/data/append.txt4
-rw-r--r--testsuite/data/pubring.asc24
-rw-r--r--testsuite/data/secring.asc26
-rw-r--r--testsuite/data/users5
-rw-r--r--testsuite/etc/.gitignore12
-rw-r--r--testsuite/etc/Makefile.am113
-rw-r--r--testsuite/etc/add-body-file.pat50
-rw-r--r--testsuite/etc/add-body.pat51
-rw-r--r--testsuite/etc/add.in42
-rw-r--r--testsuite/etc/add1.pat51
-rw-r--r--testsuite/etc/cond.in47
-rw-r--r--testsuite/etc/cond.pat53
-rw-r--r--testsuite/etc/del.in28
-rw-r--r--testsuite/etc/del1.pat53
-rw-r--r--testsuite/etc/del4.pat52
-rw-r--r--testsuite/etc/empty.in22
-rw-r--r--testsuite/etc/empty.pat43
-rw-r--r--testsuite/etc/entire.in23
-rw-r--r--testsuite/etc/gpg.in42
-rw-r--r--testsuite/etc/gpgcrypt.pat54
-rw-r--r--testsuite/etc/gpgse.pat55
-rw-r--r--testsuite/etc/gpgsign.pat57
-rw-r--r--testsuite/etc/interface.in.in31
-rw-r--r--testsuite/etc/mod-body.in30
-rw-r--r--testsuite/etc/mod-body.pat53
-rw-r--r--testsuite/etc/mod-header.in34
-rw-r--r--testsuite/etc/mod-header.pat68
-rw-r--r--testsuite/etc/net.rc6
-rw-r--r--testsuite/etc/no-backref.in26
-rw-r--r--testsuite/etc/no-backref.pat52
-rw-r--r--testsuite/etc/paolo.in27
-rw-r--r--testsuite/etc/paolo.pat56
-rw-r--r--testsuite/etc/remail.in50
-rw-r--r--testsuite/etc/remail.pat53
-rw-r--r--testsuite/etc/rot-13.pat98
-rw-r--r--testsuite/etc/simple.in29
-rw-r--r--testsuite/etc/std.in97
-rw-r--r--testsuite/etc/std.pin105
-rw-r--r--testsuite/etc/target.in.in41
-rw-r--r--testsuite/etc/tlsoneway.in23
-rw-r--r--testsuite/etc/tlsoneway.pat53
-rw-r--r--testsuite/etc/trigger.in35
-rw-r--r--testsuite/etc/trigger.pat74
-rw-r--r--testsuite/findport.c188
-rw-r--r--testsuite/lib/DISTFILES1
-rw-r--r--testsuite/lib/anubis.exp970
190 files changed, 3056 insertions, 4456 deletions
diff --git a/Makefile.am b/Makefile.am
index 7382036..64a66f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@
2## Makefile.am 2## Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
@@ -20,7 +20,7 @@
20 20
21ACLOCAL_AMFLAGS = -I m4 -I am -I gint 21ACLOCAL_AMFLAGS = -I m4 -I am -I gint
22SUBDIRS = build lib gint src po doc scripts examples guile contrib \ 22SUBDIRS = build lib gint src po doc scripts examples guile contrib \
23 elisp testsuite 23 elisp tests
24 24
25AM_DISTCHECK_CONFIGURE_FLAGS =\ 25AM_DISTCHECK_CONFIGURE_FLAGS =\
26 --with-gsasl\ 26 --with-gsasl\
diff --git a/NEWS b/NEWS
index 16f46b2..c38cf1b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,20 +1,27 @@
1GNU Anubis NEWS -- history of user-visible changes. 2014-05-18 1GNU Anubis NEWS -- history of user-visible changes. 2020-06-06
2Copyright (C) 2001-2014 The Anubis Team. 2Copyright (C) 2001-2020 The Anubis Team.
3 3
4See the end of file for copying conditions. 4See the end of file for copying conditions.
5Please send your bug reports to <bug-anubis@gnu.org>. 5Please send your bug reports to <bug-anubis@gnu.org>.
6
7* Version 4.2.90 (Git)
8
9** Fix compilation with GDBM 1.18.1
10
11* Support for Guile version 2.2.0 and later
6 12
13Support for prior versions has been withdrawn.
7 14
8* Version 4.1.92 (Git) 15* Version 4.2, 2014-05-23
9 16
10* New operation mode: proxy 17** New operation mode: proxy
11 18
12* Command line option precedence 19** Command line option precedence
13 20
14Command line options take precedence over configuration file 21Command line options take precedence over configuration file
15statements. 22statements.
16 23
17* elif statement 24** elif statement
18 25
19A familiar `elif' statement is supported, e.g.: 26A familiar `elif' statement is supported, e.g.:
20 27
@@ -28,14 +35,14 @@ else
28 action-list-4 35 action-list-4
29fi 36fi
30 37
31* New CONTROL statement esmtp-auth-delayed. 38** New CONTROL statement esmtp-auth-delayed.
32 39
33When set to `yes', this statement instructs Anubis to postpone ESMTP 40When set to `yes', this statement instructs Anubis to postpone ESMTP
34authentication until MAIL command is issued by the client. This 41authentication until MAIL command is issued by the client. This
35allows to change authentication credentials in the SMTP section (see 42allows to change authentication credentials in the SMTP section (see
36below). 43below).
37 44
38* SMTP section 45** SMTP section
39 46
40The new section "SMTP" is invoked each time an SMTP command 47The new section "SMTP" is invoked each time an SMTP command
41is received. This section may alter the command's argument, using the 48is received. This section may alter the command's argument, using the
@@ -64,14 +71,14 @@ else
64fi 71fi
65END 72END
66 73
67* New keywords: log-facility and log-tag 74** New keywords: log-facility and log-tag
68 75
69* Guile output 76** Guile output
70 77
71By default Scheme's standard error and output ports are redirected to 78By default Scheme's standard error and output ports are redirected to
72syslog, using priorities `err' and `warning' correspondingly. 79syslog, using priorities `err' and `warning' correspondingly.
73 80
74* MySQL options file 81** MySQL options file
75 82
76When using MySQL for Anubis user database, the database parameters and 83When using MySQL for Anubis user database, the database parameters and
77access credentials are read from the file /etc/my.cnf, section 84access credentials are read from the file /etc/my.cnf, section
@@ -506,7 +513,7 @@ translations.
506 513
507 Copyright information: 514 Copyright information:
508 515
509 Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008 The Anubis Team. 516 Copyright (C) 2001-2020 The Anubis Team.
510 517
511 Permission is granted to anyone to make or distribute verbatim copies 518 Permission is granted to anyone to make or distribute verbatim copies
512 of this document as received, in any medium, provided that the 519 of this document as received, in any medium, provided that the
diff --git a/README-alpha b/README-alpha
index 7210aeb..5cdbc77 100644
--- a/README-alpha
+++ b/README-alpha
@@ -39,7 +39,7 @@ Git version.
39 39
40* Copyright information 40* Copyright information
41 41
42 Copyright (C) 2001-2014 The Anubis Team. 42 Copyright (C) 2001-2020 The Anubis Team.
43 43
44 Permission is granted to anyone to make or distribute verbatim copies 44 Permission is granted to anyone to make or distribute verbatim copies
45 of this document as received, in any medium, provided that the 45 of this document as received, in any medium, provided that the
diff --git a/README-hacking b/README-hacking
index 5df0ddc..8d4435d 100644
--- a/README-hacking
+++ b/README-hacking
@@ -53,7 +53,7 @@ For more information about `bootstrap', run `bootstrap --help'.
53 53
54* Copyright information 54* Copyright information
55 55
56 Copyright (C) 2007-2014 The Anubis Team. 56 Copyright (C) 2007-2020 The Anubis Team.
57 57
58 Permission is granted to anyone to make or distribute verbatim copies 58 Permission is granted to anyone to make or distribute verbatim copies
59 of this document as received, in any medium, provided that the 59 of this document as received, in any medium, provided that the
diff --git a/TODO b/TODO
index 8ad8dd7..a98ba77 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
1GNU Anubis TODO list. 2005-05-25 1GNU Anubis TODO list. 2005-05-25
2Copyright (C) 2003-2014 The Anubis Team 2Copyright (C) 2003-2020 The Anubis Team
3 3
4* Urgent: 4* Urgent:
5 5
diff --git a/am/anubis.m4 b/am/anubis.m4
index 15c78e4..d758054 100644
--- a/am/anubis.m4
+++ b/am/anubis.m4
@@ -1,6 +1,6 @@
1dnl 1dnl
2dnl This file is part of GNU Anubis. 2dnl This file is part of GNU Anubis.
3dnl Copyright (C) 2001-2014 The Anubis Team. 3dnl Copyright (C) 2001-2020 The Anubis Team.
4dnl 4dnl
5dnl GNU Anubis is free software; you can redistribute it and/or modify it 5dnl GNU Anubis is free software; you can redistribute it and/or modify it
6dnl under the terms of the GNU General Public License as published by the 6dnl under the terms of the GNU General Public License as published by the
diff --git a/am/gnutls.m4 b/am/gnutls.m4
index 6d69467..a3cf946 100644
--- a/am/gnutls.m4
+++ b/am/gnutls.m4
@@ -1,5 +1,5 @@
1dnl This file is part of GNU Anubis. 1dnl This file is part of GNU Anubis.
2dnl Copyright (C) 2001-2014 The Anubis Team. 2dnl Copyright (C) 2001-2020 The Anubis Team.
3dnl 3dnl
4dnl GNU Anubis is free software; you can redistribute it and/or modify it 4dnl GNU Anubis is free software; you can redistribute it and/or modify it
5dnl under the terms of the GNU General Public License as published by the 5dnl under the terms of the GNU General Public License as published by the
diff --git a/am/gpgme.m4 b/am/gpgme.m4
index 21ac088..64d4cf4 100644
--- a/am/gpgme.m4
+++ b/am/gpgme.m4
@@ -1,6 +1,6 @@
1dnl 1dnl
2dnl This file is part of GNU Anubis. 2dnl This file is part of GNU Anubis.
3dnl Copyright (C) 2001-2014 The Anubis Team. 3dnl Copyright (C) 2001-2020 The Anubis Team.
4dnl 4dnl
5dnl GNU Anubis is free software; you can redistribute it and/or modify it 5dnl GNU Anubis is free software; you can redistribute it and/or modify it
6dnl under the terms of the GNU General Public License as published by the 6dnl under the terms of the GNU General Public License as published by the
diff --git a/build/Makefile.am b/build/Makefile.am
index d849cc3..9bfa70b 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -2,7 +2,7 @@
2## build/Makefile.am 2## build/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
@@ -18,7 +18,6 @@
18## with GNU Anubis. If not, see <http://www.gnu.org/licenses/>. 18## with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
19## 19##
20 20
21SUBDIRS = guile-1.6
22EXTRA_DIST = keygen.sh specgen.sh cflow.rc 21EXTRA_DIST = keygen.sh specgen.sh cflow.rc
23 22
24## EOF 23## EOF
diff --git a/build/guile-1.6/.gitignore b/build/guile-1.6/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/build/guile-1.6/.gitignore
+++ b/dev/null
@@ -1,2 +0,0 @@
1Makefile
2Makefile.in
diff --git a/build/guile-1.6/Makefile.am b/build/guile-1.6/Makefile.am
deleted file mode 100644
index c5b7cd5..0000000
--- a/build/guile-1.6/Makefile.am
+++ b/dev/null
@@ -1,21 +0,0 @@
1##
2## This file is part of GNU Anubis.
3## Copyright (C) 2003-2014 The Anubis Team.
4##
5## GNU Anubis is free software; you can redistribute it and/or modify it
6## under the terms of the GNU General Public License as published by the
7## Free Software Foundation; either version 3 of the License, or (at your
8## option) any later version.
9##
10## GNU Anubis is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License along
16## with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
17##
18
19EXTRA_DIST = \
20 guile-doc-snarf\
21 guile-doc-snarf.awk
diff --git a/build/guile-1.6/guile-doc-snarf b/build/guile-1.6/guile-doc-snarf
deleted file mode 100755
index b03be6b..0000000
--- a/build/guile-1.6/guile-doc-snarf
+++ b/dev/null
@@ -1,72 +0,0 @@
1#! /bin/sh
2# Copyright (C) 2002 Sergey Poznyakoff
3#
4# This is a snarfer for guile version 1.6
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software Foundation,
18# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
20OUTFILE=/dev/tty
21DOCFILE=0
22BASEDIR=`dirname $0`
23test -n "${CPP+set}" || CPP="gcc -E"
24test -n "${AWK+set}" || AWK=awk
25temp=/tmp/snarf.$$
26trap "rm -f $temp" 0 1 2 15
27
28# process aruments
29while [ $# -gt 0 ];
30do
31 case $1 in
32 -o) OUTFILE=$2; shift 2;;
33 -d) DOCFILE=1; shift;;
34 *) break;;
35 esac
36done
37
38INFILE=$1; shift
39
40cpp_exit=1
41
42snarf_x() {
43 echo "/* source: $INFILE */" ;
44 echo "/* cpp arguments: $@ */" ;
45 $CPP -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp}
46 cpp_exit=$?
47 grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/"
48}
49
50snarf_doc() {
51 $CPP -DSCM_MAGIC_SNARF_DOCS "$@" > ${temp}
52 cpp_exit=$?
53 $AWK '
54NF<2 {next}
55state == 0 && /\^\^ {/ { state = 1; print; next }
56state == 0 && /\^\^/ { print }
57state == 1 && /\^\^ }/ { state = 0; print; next }
58state == 1 { print }
59state == 0 { next }' $temp |\
60 tr -d '\n' | tr '^' '\n' |\
61 awk -f $BASEDIR/guile-doc-snarf.awk > $OUTFILE
62}
63
64case "$DOCFILE" in
65 0) snarf_x $INFILE "$@" > $OUTFILE;;
66 1) snarf_doc $INFILE "$@" > $OUTFILE;;
67esac
68
69if [ $cpp_exit -ne 0 ]; then
70 [ "$OUTFILE" != "/dev/tty" ] && rm $OUTFILE
71fi
72exit $cpp_exit
diff --git a/build/guile-1.6/guile-doc-snarf.awk b/build/guile-1.6/guile-doc-snarf.awk
deleted file mode 100644
index 7fafbd3..0000000
--- a/build/guile-1.6/guile-doc-snarf.awk
+++ b/dev/null
@@ -1,88 +0,0 @@
1# Copyright (C) 2002 Sergey Poznyakoff
2#
3# This is a snarfer for guile version 1.6
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 3 of the License, or (at your
8# option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program. If not, see <http://www.gnu.org/licenses/>.
17
18BEGIN {
19 cname = ""
20}
21
22function flush() {
23 if (cname == "")
24 return;
25 if (arg_req + arg_opt + arg_var != numargs)
26 error(cname " incorrectly defined as taking " numargs " arguments")
27
28 print "\f" cname
29 print "@c snarfed from " loc_source ":" loc_line
30 printf "@deffn {Scheme procedure} %s", cname
31 for (i = 1; i <= numargs; i++)
32 printf(" %s", arglist[i])
33 print ""
34 print docstring
35 print "@end deffn\n"
36
37 delete argpos
38 delete arglist
39 cname = ""
40}
41
42function error(s) {
43 print loc_source ":" loc_line ": " s > "/dev/stderr"
44 exit 1
45}
46
47state == 0 && /{/ {
48 flush()
49 cname = $3
50 next
51 }
52
53state == 0 && /fname/ { fname = $2; next }
54state == 0 && /type/ { type = $2; next }
55state == 0 && /location/ { loc_source = $2; loc_line = $3 }
56state == 0 && /arglist/ {
57 match($0, "\\(.*\\)")
58 s = substr($0,RSTART+1,RLENGTH-2)
59 numargs = split(s, a, ",")
60 for (i = 1; i <= numargs; i++) {
61 m = split(a[i], b, "[ \t]*")
62 if (b[1] == "") {
63 t = b[2]
64 n = b[3]
65 m--
66 } else {
67 t = b[1]
68 n = b[2]
69 }
70 if (m > 2 || t != "SCM")
71 error(cname ": wrong argument type for arg " i " " t)
72 arglist[i] = n
73 }
74}
75state == 0 && /argsig/ { arg_req = $2; arg_opt = $3; arg_var = $4 }
76
77state == 0 && /.*\"/ {
78 gsub("\"\"", "")
79 gsub("\\\\n", "\n")
80 match($0,"\".*\"")
81 docstring = substr($0,RSTART+1,RLENGTH-2)
82}
83
84/argpos/ { argpos[$2] = $3 }
85
86END {
87 flush()
88}
diff --git a/build/keygen.sh b/build/keygen.sh
index 1c2c028..b163e5a 100755
--- a/build/keygen.sh
+++ b/build/keygen.sh
@@ -3,7 +3,7 @@
3# keygen.sh 3# keygen.sh
4# 4#
5# This file is part of GNU Anubis. 5# This file is part of GNU Anubis.
6# Copyright (C) 2001-2014 The Anubis Team. 6# Copyright (C) 2001-2020 The Anubis Team.
7# 7#
8# GNU Anubis is free software; you can redistribute it and/or modify it 8# GNU Anubis is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by the Free 9# under the terms of the GNU General Public License as published by the Free
diff --git a/build/specgen.sh b/build/specgen.sh
index 977abc9..712dde1 100755
--- a/build/specgen.sh
+++ b/build/specgen.sh
@@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# This file is part of GNU Anubis. 3# This file is part of GNU Anubis.
4# Copyright (C) 2001-2014 The Anubis Team. 4# Copyright (C) 2001-2020 The Anubis Team.
5# 5#
6# GNU Anubis is free software; you can redistribute it and/or modify it 6# GNU Anubis is free software; you can redistribute it and/or modify it
7# under the terms of the GNU General Public License as published by the Free 7# under the terms of the GNU General Public License as published by the Free
diff --git a/configure.ac b/configure.ac
index 40e76cf..f6091d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
1dnl configure.ac -*- autoconf-*- 1dnl configure.ac -*- autoconf-*-
2dnl 2dnl
3dnl This file is part of GNU Anubis. 3dnl This file is part of GNU Anubis.
4dnl Copyright (C) 2001-2014 The Anubis Team. 4dnl Copyright (C) 2001-2020 The Anubis Team.
5dnl 5dnl
6dnl GNU Anubis is free software; you can redistribute it and/or modify it 6dnl GNU Anubis is free software; you can redistribute it and/or modify it
7dnl under the terms of the GNU General Public License as published by the 7dnl under the terms of the GNU General Public License as published by the
@@ -18,7 +18,7 @@ dnl with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
18dnl 18dnl
19 19
20dnl Process this file with autoconf to produce a configure script. 20dnl Process this file with autoconf to produce a configure script.
21AC_INIT([GNU Anubis], [4.1.92], [bug-anubis@gnu.org]) 21AC_INIT([GNU Anubis], [4.2.90], [bug-anubis@gnu.org])
22AC_PREREQ([2.63]) 22AC_PREREQ([2.63])
23AC_CONFIG_HEADERS([config.h]) 23AC_CONFIG_HEADERS([config.h])
24AC_CONFIG_AUX_DIR([build]) 24AC_CONFIG_AUX_DIR([build])
@@ -39,6 +39,42 @@ $PATH:/sbin:/usr/sbin:/usr/local/sbin)
39AC_DEFINE_UNQUOTED(IDECRYPT_PATH,"${idecrypt_path}", 39AC_DEFINE_UNQUOTED(IDECRYPT_PATH,"${idecrypt_path}",
40[Define if IDECRYPT_PATH is present.]) 40[Define if IDECRYPT_PATH is present.])
41 41
42# *********************************************************************
43# GPG v2 (for the testsuite)
44# The testsuite needs to create GPG keys, which would be prohibitively
45# slow without the %transient-key statement, which appeared in GPG 2.1
46# *********************************************************************
47AC_ARG_VAR([GPG],[Name of the gpg version 2 binary])
48AC_MSG_CHECKING([for the GPG v2 binary])
49uGPG=$GPG
50unset GPG
51gpgver() {
52 GPG_VERSION_STRING=$($1 --version|head -n 1|sed -e 's/.* //')
53 oIFS=$IFS
54 IFS="."
55 set -- $GPG_VERSION_STRING
56 GPG_VERSION_MAJOR=$1
57 GPG_VERSION_MINOR=$2
58 IFS=$oIFS
59}
60for prog in $uGPG gpg2 gpg
61do
62 gpgver $prog
63 if test -n "$GPG_VERSION_MAJOR" -a -n "$GPG_VERSION_MINOR"; then
64 if test $GPG_VERSION_MAJOR -eq 2; then
65 if test $GPG_VERSION_MINOR -ge 1; then
66 GPG=$prog
67 break
68 fi
69 elif test $GPG_VERSION_MAJOR -gt 2; then
70 GPG=$prog
71 break
72 fi
73 fi
74done
75AC_MSG_RESULT([${GPG:-none}${GPG:+, $GPG_VERSION_STRING}])
76AM_CONDITIONAL([COND_GPG2],[test -n "$GPG"])
77
42dnl Checks for header files. 78dnl Checks for header files.
43AC_HEADER_STDC 79AC_HEADER_STDC
44AC_TYPE_SIZE_T 80AC_TYPE_SIZE_T
@@ -90,21 +126,19 @@ dnl Internationalization macros.
90AM_GNU_GETTEXT([external], [need-formatstring-macros]) 126AM_GNU_GETTEXT([external], [need-formatstring-macros])
91AM_GNU_GETTEXT_VERSION([0.16]) 127AM_GNU_GETTEXT_VERSION([0.16])
92 128
93AC_SUBST([M4_DEFS])
94AC_SUBST([GUILE_SCRIPTS]) 129AC_SUBST([GUILE_SCRIPTS])
95GINT_INIT([gint],[1.8 with-guile nodoc std-site-dir], 130GINT_INIT([gint],[2.2.0 with-guile nodoc std-site-dir],
96 [useguile=yes 131 [useguile=yes
97 AC_DEFINE(WITH_GUILE,1,[Enable Guile support]) 132 AC_DEFINE(WITH_GUILE,1,[Enable Guile support])
98 GUILE_SCRIPTS='$(GUILE_SCM)' 133 GUILE_SCRIPTS='$(GUILE_SCM)'],
99 M4_DEFS="$M4_DEFS -DWITH_GUILE"],
100 [useguile=no]) 134 [useguile=no])
101 135
102if test "$useguile" = "no"; then 136if test "$useguile" = "no"; then
103 AC_MSG_RESULT([Disabling GUILE support...]) 137 AC_MSG_RESULT([Disabling GUILE support...])
104fi 138fi
139AM_CONDITIONAL([GUILE_COND], [test "$useguile" = "yes"])
105 140
106dnl Use option --without-gpgme to NOT compile GnuPG (GPGME library) support. 141dnl Use option --without-gpgme to NOT compile GnuPG (GPGME library) support.
107AC_SUBST(ANUBIS_GPGFILES)
108AC_ARG_WITH(gpgme, 142AC_ARG_WITH(gpgme,
109 AC_HELP_STRING([--without-gpgme], 143 AC_HELP_STRING([--without-gpgme],
110 [without GnuPG (GPGME library) support]), 144 [without GnuPG (GPGME library) support]),
@@ -120,7 +154,6 @@ fi
120if test "$with_gpgme" = "no"; then 154if test "$with_gpgme" = "no"; then
121 AC_MSG_RESULT([Disabling GPGME support...]) 155 AC_MSG_RESULT([Disabling GPGME support...])
122else 156else
123 AC_PATH_PROG(GPG, gpg)
124 findgpgmedir() { : 157 findgpgmedir() { :
125 if test -f "$1/include/gpgme.h"; then 158 if test -f "$1/include/gpgme.h"; then
126 gpgmedir=1 159 gpgmedir=1
@@ -139,9 +172,8 @@ else
139 else 172 else
140 AC_CHECK_HEADERS(gpgme.h) 173 AC_CHECK_HEADERS(gpgme.h)
141 fi 174 fi
142 ANUBIS_GPGFILES='$(GPGFILES)'
143 M4_DEFS="$M4_DEFS -DWITH_GPG"
144fi 175fi
176AM_CONDITIONAL([GPG_COND],[test "$with_gpgme" = "yes"])
145 177
146AC_SUBST(GSASL_LIBS) 178AC_SUBST(GSASL_LIBS)
147AC_CHECK_LIB(resolv, res_query) 179AC_CHECK_LIB(resolv, res_query)
@@ -177,7 +209,6 @@ MU_CHECK_GSASL(0.2.3, [
177 AC_MSG_RESULT([Enabling GSASL support...]) 209 AC_MSG_RESULT([Enabling GSASL support...])
178 ANUBIS_SBIN_ADM='$(adm_sbin_programs)' 210 ANUBIS_SBIN_ADM='$(adm_sbin_programs)'
179 ANUBIS_BIN_ADM='$(adm_bin_programs)' 211 ANUBIS_BIN_ADM='$(adm_bin_programs)'
180 M4_DEFS="$M4_DEFS -DWITH_GSASL"
181 212
182 AC_CHECK_LIB(gdbm, gdbm_open, 213 AC_CHECK_LIB(gdbm, gdbm_open,
183 [WITH_GDBM=yes 214 [WITH_GDBM=yes
@@ -246,11 +277,13 @@ MU_CHECK_GSASL(0.2.3, [
246 fi 277 fi
247 278
248 AC_LIBOBJ(lbuf)]) 279 AC_LIBOBJ(lbuf)])
280AM_CONDITIONAL([GSASL_COND],[test "$WITH_GSASL" = yes])
281AM_CONDITIONAL([GDBM_COND],[test "$WITH_GDBM" = yes])
249 282
250ANUBIS_CHECK_TLS([ 283ANUBIS_CHECK_TLS([
251 M4_DEFS="$M4_DEFS -DWITH_SSL -DWITH_GNUTLS"
252 AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if USE_GNUTLS is requested.])]) 284 AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if USE_GNUTLS is requested.])])
253AM_CONDITIONAL([TLS_COND], [test $anubis_cv_gnutls = yes]) 285AM_CONDITIONAL([TLS_COND], [test $anubis_cv_gnutls = yes])
286AC_PATH_PROG([CERTTOOL],[certtool])
254 287
255dnl Use option --with-socks-proxy to compile SOCKS v4/5 proxy support. 288dnl Use option --with-socks-proxy to compile SOCKS v4/5 proxy support.
256AC_ARG_WITH(socks-proxy, 289AC_ARG_WITH(socks-proxy,
@@ -366,7 +399,6 @@ with_unprivileged_user=$with_unprivileged_user])
366 399
367AC_CONFIG_FILES([Makefile 400AC_CONFIG_FILES([Makefile
368 build/Makefile 401 build/Makefile
369 build/guile-1.6/Makefile
370 contrib/Makefile 402 contrib/Makefile
371 gint/Makefile 403 gint/Makefile
372 doc/Makefile 404 doc/Makefile
@@ -378,9 +410,11 @@ AC_CONFIG_FILES([Makefile
378 po/Makefile.in 410 po/Makefile.in
379 scripts/Makefile 411 scripts/Makefile
380 src/Makefile 412 src/Makefile
381 testsuite/Makefile
382 testsuite/data/Makefile
383 testsuite/etc/Makefile
384 ]) 413 ])
385 414
415# Initialize the test suite.
416AC_CONFIG_TESTDIR(tests)
417AC_CONFIG_FILES([tests/Makefile tests/atlocal])
418AM_MISSING_PROG([AUTOM4TE], [autom4te])
419
386AC_OUTPUT 420AC_OUTPUT
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 405aa32..76efc95 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -2,7 +2,7 @@
2## contrib/Makefile.am 2## contrib/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/contrib/msg2smtp.pl b/contrib/msg2smtp.pl
index cc2a2b1..e85a91d 100755
--- a/contrib/msg2smtp.pl
+++ b/contrib/msg2smtp.pl
@@ -33,7 +33,7 @@ $0 -h HOST [options]
33# 0. GPL License 33# 0. GPL License
34# 34#
35# This file is part of GNU Anubis. 35# This file is part of GNU Anubis.
36# Copyright (C) 2001-2014 The Anubis Team. 36# Copyright (C) 2001-2020 The Anubis Team.
37# 37#
38# GNU Anubis is free software; you can redistribute it and/or modify 38# GNU Anubis is free software; you can redistribute it and/or modify
39# it under the terms of the GNU General Public License as published by 39# it under the terms of the GNU General Public License as published by
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2c89081..7f7add1 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,7 +2,7 @@
2## doc/Makefile.am 2## doc/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/elisp/Makefile.am b/elisp/Makefile.am
index 71a4b12..25dbdca 100644
--- a/elisp/Makefile.am
+++ b/elisp/Makefile.am
@@ -1,6 +1,6 @@
1## 1##
2## This file is part of GNU Anubis. 2## This file is part of GNU Anubis.
3## Copyright (C) 2003-2014 The Anubis Team. 3## Copyright (C) 2003-2020 The Anubis Team.
4## 4##
5## GNU Anubis is free software; you can redistribute it and/or modify it 5## GNU Anubis is free software; you can redistribute it and/or modify it
6## under the terms of the GNU General Public License as published by the 6## under the terms of the GNU General Public License as published by the
diff --git a/elisp/anubis-mode.el b/elisp/anubis-mode.el
index 91a10e9..16456da 100644
--- a/elisp/anubis-mode.el
+++ b/elisp/anubis-mode.el
@@ -6,7 +6,7 @@
6;; $Id$ 6;; $Id$
7 7
8;; This file is part of GNU Anubis. 8;; This file is part of GNU Anubis.
9;; Copyright (C) 2003-2014 The Anubis Team. 9;; Copyright (C) 2003-2020 The Anubis Team.
10 10
11;; GNU Anubis is free software; you can redistribute it and/or modify it 11;; GNU Anubis is free software; you can redistribute it and/or modify it
12;; under the terms of the GNU General Public License as published by the 12;; under the terms of the GNU General Public License as published by the
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 58d1ebc..d44239e 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -2,7 +2,7 @@
2## examples/Makefile.am 2## examples/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/examples/anubis.scm b/examples/anubis.scm
index 6d84e0d..0aa93da 100644
--- a/examples/anubis.scm
+++ b/examples/anubis.scm
@@ -2,7 +2,7 @@
2;;; anubis.scm 2;;; anubis.scm
3;;; 3;;;
4;;; This file is part of GNU Anubis. 4;;; This file is part of GNU Anubis.
5;;; Copyright (C) 2003-2014 The Anubis Team. 5;;; Copyright (C) 2003-2020 The Anubis Team.
6;;; 6;;;
7;;; GNU Anubis is free software; you can redistribute it and/or modify it 7;;; GNU Anubis is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by the 8;;; under the terms of the GNU General Public License as published by the
diff --git a/examples/pam/Makefile.am b/examples/pam/Makefile.am
index 2e88c0a..1f6df10 100644
--- a/examples/pam/Makefile.am
+++ b/examples/pam/Makefile.am
@@ -2,7 +2,7 @@
2## pam/Makefile.am 2## pam/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/gnulib.modules b/gnulib.modules
index 8fe0e0d..fe87dbf 100644
--- a/gnulib.modules
+++ b/gnulib.modules
@@ -5,7 +5,6 @@ gettext
5getline 5getline
6gitlog-to-changelog 6gitlog-to-changelog
7obstack 7obstack
8getopt
9getpass 8getpass
10regex 9regex
11setenv 10setenv
diff --git a/guile/Makefile.am b/guile/Makefile.am
index 152c075..9d8de38 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -2,7 +2,7 @@
2## guile/Makefile.am 2## guile/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2003-2014 The Anubis Team. 5## Copyright (C) 2003-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/guile/entire-msg.scm b/guile/entire-msg.scm
index c906462..274f1f0 100644
--- a/guile/entire-msg.scm
+++ b/guile/entire-msg.scm
@@ -2,7 +2,7 @@
2;;; entire-msg.scm 2;;; entire-msg.scm
3;;; 3;;;
4;;; This file is part of GNU Anubis. 4;;; This file is part of GNU Anubis.
5;;; Copyright (C) 2003-2014 The Anubis Team. 5;;; Copyright (C) 2003-2020 The Anubis Team.
6;;; 6;;;
7;;; GNU Anubis is free software; you can redistribute it and/or modify it 7;;; GNU Anubis is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by the 8;;; under the terms of the GNU General Public License as published by the
diff --git a/guile/remailer.scm b/guile/remailer.scm
index df95bca..b4dadd1 100644
--- a/guile/remailer.scm
+++ b/guile/remailer.scm
@@ -2,7 +2,7 @@
2;;; remailer.scm 2;;; remailer.scm
3;;; 3;;;
4;;; This file is part of GNU Anubis. 4;;; This file is part of GNU Anubis.
5;;; Copyright (C) 2003-2014 The Anubis Team. 5;;; Copyright (C) 2003-2020 The Anubis Team.
6;;; 6;;;
7;;; GNU Anubis is free software; you can redistribute it and/or modify it 7;;; GNU Anubis is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by the 8;;; under the terms of the GNU General Public License as published by the
diff --git a/guile/rot-13.scm b/guile/rot-13.scm
index a48dbf7..42faf2c 100644
--- a/guile/rot-13.scm
+++ b/guile/rot-13.scm
@@ -2,7 +2,7 @@
2;;; rot-13.scm 2;;; rot-13.scm
3;;; 3;;;
4;;; This file is part of GNU Anubis. 4;;; This file is part of GNU Anubis.
5;;; Copyright (C) 2003-2014 The Anubis Team. 5;;; Copyright (C) 2003-2020 The Anubis Team.
6;;; 6;;;
7;;; GNU Anubis is free software; you can redistribute it and/or modify it 7;;; GNU Anubis is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by the 8;;; under the terms of the GNU General Public License as published by the
diff --git a/lib/.gitignore b/lib/.gitignore
index a3fb283..02b1d4b 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -1,20 +1,41 @@
1_Noreturn.h
2alignof.h
1alloca.c 3alloca.c
2alloca.h 4alloca.h
3alloca.in.h 5alloca.in.h
6arg-nonnull.h
7attribute.h
8basename-lgpl.c
4btowc.c 9btowc.c
10c++defs.h
11cdefs.h
5charset.alias 12charset.alias
13cloexec.c
14cloexec.h
15close.c
6config.charset 16config.charset
7configmake.h 17configmake.h
18dirname-lgpl.c
19dirname.h
20dup2.c
8errno.h 21errno.h
9errno.in.h 22errno.in.h
10error.c 23error.c
11error.h 24error.h
12exitfail.c 25exitfail.c
13exitfail.h 26exitfail.h
27fcntl.c
28fcntl.h
29fcntl.in.h
30fd-hook.c
31fd-hook.h
32filename.h
33fopen.c
14fseek.c 34fseek.c
15fseeko.c 35fseeko.c
16fstat.c 36fstat.c
17getdelim.c 37getdelim.c
38getdtablesize.c
18getline.c 39getline.c
19getopt.c 40getopt.c
20getopt.h 41getopt.h
@@ -23,12 +44,23 @@ getopt1.c
23getopt_int.h 44getopt_int.h
24getpass.c 45getpass.c
25getpass.h 46getpass.h
47getprogname.c
48getprogname.h
26gettext.h 49gettext.h
27gettimeofday.c 50gettimeofday.c
28gnulib.mk 51gnulib.mk
52hard-locale.c
53hard-locale.h
29intprops.h 54intprops.h
55inttypes.h
56inttypes.in.h
30langinfo.h 57langinfo.h
31langinfo.in.h 58langinfo.in.h
59lc-charset-dispatch.c
60lc-charset-dispatch.h
61libc-config.h
62limits.h
63limits.in.h
32localcharset.c 64localcharset.c
33localcharset.h 65localcharset.h
34locale.h 66locale.h
@@ -39,9 +71,13 @@ malloc.c
39malloca.c 71malloca.c
40malloca.h 72malloca.h
41malloca.valgrind 73malloca.valgrind
74mbrtowc-impl-utf8.h
75mbrtowc-impl.h
42mbrtowc.c 76mbrtowc.c
43mbsinit.c 77mbsinit.c
44mbtowc-impl.h 78mbtowc-impl.h
79mbtowc-lock.c
80mbtowc-lock.h
45mbtowc.c 81mbtowc.c
46msvc-inval.c 82msvc-inval.c
47msvc-inval.h 83msvc-inval.h
@@ -50,6 +86,8 @@ msvc-nothrow.h
50nl_langinfo.c 86nl_langinfo.c
51obstack.c 87obstack.c
52obstack.h 88obstack.h
89open.c
90pathmax.h
53realloc.c 91realloc.c
54ref-add.sed 92ref-add.sed
55ref-add.sin 93ref-add.sin
@@ -62,6 +100,14 @@ regex_internal.c
62regex_internal.h 100regex_internal.h
63regexec.c 101regexec.c
64setenv.c 102setenv.c
103setlocale-lock.c
104setlocale_null.c
105setlocale_null.h
106stat-time.c
107stat-time.h
108stat-w32.c
109stat-w32.h
110stat.c
65stdbool.h 111stdbool.h
66stdbool.in.h 112stdbool.in.h
67stddef.h 113stddef.h
@@ -81,6 +127,7 @@ strerror-override.h
81strerror.c 127strerror.c
82string.h 128string.h
83string.in.h 129string.in.h
130stripslash.c
84sys 131sys
85sys_stat.h 132sys_stat.h
86sys_stat.in.h 133sys_stat.in.h
@@ -96,12 +143,22 @@ unistd.c
96unistd.h 143unistd.h
97unistd.in.h 144unistd.in.h
98verify.h 145verify.h
146warn-on-use.h
99wchar.h 147wchar.h
100wchar.in.h 148wchar.in.h
101wcrtomb.c 149wcrtomb.c
102wctype-h.c 150wctype-h.c
103wctype.h 151wctype.h
104wctype.in.h 152wctype.in.h
153windows-initguard.h
154windows-mutex.c
155windows-mutex.h
156windows-once.c
157windows-once.h
158windows-recmutex.c
159windows-recmutex.h
160windows-rwlock.c
161windows-rwlock.h
105xalloc-die.c 162xalloc-die.c
106xalloc-oversized.h 163xalloc-oversized.h
107xalloc.h 164xalloc.h
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5d86d5d..c29651d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,7 +2,7 @@
2## lib/Makefile.am 2## lib/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2003-2014 The Anubis Team. 5## Copyright (C) 2003-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/lib/keyword.c b/lib/keyword.c
index 77a517a..5009069 100644
--- a/lib/keyword.c
+++ b/lib/keyword.c
@@ -2,7 +2,7 @@
2 Simple keyword translation. 2 Simple keyword translation.
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2009-2014 The Anubis Team. 5 Copyright (C) 2009-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/lib/keyword.h b/lib/keyword.h
index b51c7a9..355548d 100644
--- a/lib/keyword.h
+++ b/lib/keyword.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNU Anubis. 2 This file is part of GNU Anubis.
3 Copyright (C) 2009-2014 The Anubis Team. 3 Copyright (C) 2009-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify it 5 GNU Anubis is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c45a35b..a6b34b4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
1# 1#
2# List of source files containing translatable strings. 2# List of source files containing translatable strings.
3# Copyright (C) 2001-2014 The Anubis Team. 3# Copyright (C) 2001-2020 The Anubis Team.
4# 4#
5 5
6src/authmode.c 6src/authmode.c
@@ -31,7 +31,6 @@ src/tls.c
31src/transmode.c 31src/transmode.c
32src/tunnel.c 32src/tunnel.c
33 33
34lib/getopt.c
35lib/obstack.c 34lib/obstack.c
36 35
37# EOF 36# EOF
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 43dc640..c7003a9 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -2,7 +2,7 @@
2## scripts/Makefile.am 2## scripts/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
diff --git a/src/Makefile.am b/src/Makefile.am
index ca4d108..f35350b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,7 @@
2## src/Makefile.am 2## src/Makefile.am
3## 3##
4## This file is part of GNU Anubis. 4## This file is part of GNU Anubis.
5## Copyright (C) 2001-2014 The Anubis Team. 5## Copyright (C) 2001-2020 The Anubis Team.
6## 6##
7## GNU Anubis is free software; you can redistribute it and/or modify it 7## GNU Anubis is free software; you can redistribute it and/or modify it
8## under the terms of the GNU General Public License as published by the 8## under the terms of the GNU General Public License as published by the
@@ -36,9 +36,6 @@ anubis_SOURCES = \
36 esmtp.c \ 36 esmtp.c \
37 exec.c \ 37 exec.c \
38 extern.h \ 38 extern.h \
39 gpg.c \
40 gsasl_srv.c \
41 guile.c \
42 headers.h \ 39 headers.h \
43 help.c \ 40 help.c \
44 ident.c \ 41 ident.c \
@@ -64,20 +61,26 @@ anubis_SOURCES = \
64 tunnel.c \ 61 tunnel.c \
65 xdatabase.c 62 xdatabase.c
66 63
64if GSASL_COND
65 anubis_SOURCES += gsasl_srv.c
66endif
67
68if GPG_COND
69 anubis_SOURCES += gpg.c
70endif
71
72if GUILE_COND
73 anubis_SOURCES += guile.c
74endif
75
67anubisadm_SOURCES = anubisadm.c anubisadm.h adm.c 76anubisadm_SOURCES = anubisadm.c anubisadm.h adm.c
68anubisadm_LDADD = ./libanubisdb.a $(top_builddir)/lib/libanubis.a @LIBINTL@ 77anubisadm_LDADD = ./libanubisdb.a $(top_builddir)/lib/libanubis.a @LIBINTL@
69anubisusr_SOURCES = anubisusr.c anubisusr.h usr.c 78anubisusr_SOURCES = anubisusr.c anubisusr.h usr.c
70anubisusr_LDADD = ./libanubisdb.a $(top_builddir)/lib/libanubis.a @LIBINTL@ @LIBGNUTLS_LIBS@ @GSASL_LIBS@ 79anubisusr_LDADD = ./libanubisdb.a $(top_builddir)/lib/libanubis.a @LIBINTL@ @LIBGNUTLS_LIBS@ @GSASL_LIBS@
71 80
72if TLS_COND
73 TLS_C=tls.c
74endif
75
76libanubisdb_a_SOURCES = \ 81libanubisdb_a_SOURCES = \
77 anubisdb.c \ 82 anubisdb.c \
78 dbtext.c \ 83 dbtext.c \
79 gdbm.c \
80 gsasl.c \
81 list.c \ 84 list.c \
82 list.h \ 85 list.h \
83 md5.c \ 86 md5.c \
@@ -91,6 +94,19 @@ libanubisdb_a_SOURCES = \
91 $(TLS_C) \ 94 $(TLS_C) \
92 url.c 95 url.c
93 96
97if TLS_COND
98 libanubisdb_a_SOURCES += tls.c
99endif
100
101if GSASL_COND
102 libanubisdb_a_SOURCES += gsasl.c
103endif
104
105if GDBM_COND
106 libanubisdb_a_SOURCES += gdbm.c
107endif
108
109
94AM_YFLAGS = -dtv 110AM_YFLAGS = -dtv
95AM_LFLAGS = -dvp 111AM_LFLAGS = -dvp
96EXTRA_DIST = getopt.m4 env.opt 112EXTRA_DIST = getopt.m4 env.opt
@@ -99,7 +115,7 @@ BUILT_SOURCES = env.c
99 115
100localedir = $(datadir)/locale 116localedir = $(datadir)/locale
101DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" 117DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
102AM_CPPFLAGS = @ADD_INCLUDES@ @LIBGNUTLS_INCLUDES@ -I$(top_srcdir)/lib 118AM_CPPFLAGS = @ADD_INCLUDES@ @GUILE_INCLUDES@ @LIBGNUTLS_INCLUDES@ -I$(top_srcdir)/lib
103SUFFIXES=.opt .c 119SUFFIXES=.opt .c
104 120
105.opt.c: 121.opt.c:
diff --git a/src/adm.opt b/src/adm.opt
index 643855f..3f2e948 100644
--- a/src/adm.opt
+++ b/src/adm.opt
@@ -1,6 +1,6 @@
1/* -*- c -*- 1/* -*- c -*-
2 This file is part of GNU Anubis. 2 This file is part of GNU Anubis.
3 Copyright (C) 2001-2014 The Anubis Team. 3 Copyright (C) 2001-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify 5 GNU Anubis is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
diff --git a/src/anubisadm.c b/src/anubisadm.c
index 1eff9cb..d197cbc 100644
--- a/src/anubisadm.c
+++ b/src/anubisadm.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNU Anubis 2 This file is part of GNU Anubis
3 Copyright (C) 2004-2014 The Anubis Team. 3 Copyright (C) 2004-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify it 5 GNU Anubis is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
@@ -353,7 +353,7 @@ main (int argc, char **argv)
353 353
354 dbtext_init (); 354 dbtext_init ();
355# ifdef HAVE_LIBGDBM 355# ifdef HAVE_LIBGDBM
356 gdbm_db_init (); 356 db_gdbm_init ();
357# endif 357# endif
358# ifdef WITH_MYSQL 358# ifdef WITH_MYSQL
359 mysql_db_init (); 359 mysql_db_init ();
diff --git a/src/anubisadm.h b/src/anubisadm.h
index ccc77e5..a1ea4a1 100644
--- a/src/anubisadm.h
+++ b/src/anubisadm.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNU Anubis 2 This file is part of GNU Anubis
3 Copyright (C) 2004-2014 The Anubis Team. 3 Copyright (C) 2004-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify it 5 GNU Anubis is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
diff --git a/src/anubisdb.c b/src/anubisdb.c
index 5e9bf83..94334db 100644
--- a/src/anubisdb.c
+++ b/src/anubisdb.c
@@ -2,7 +2,7 @@
2 anubisdb.c 2 anubisdb.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/anubisusr.c b/src/anubisusr.c
index 8cbbc71..8562880 100644
--- a/src/anubisusr.c
+++ b/src/anubisusr.c
@@ -1,7 +1,7 @@
1/* 1/*
2 anubisusr.c 2 anubisusr.c
3 3
4 Copyright (C) 2004-2014 The Anubis Team. 4 Copyright (C) 2004-2020 The Anubis Team.
5 5
6 GNU Anubis is free software; you can redistribute it and/or modify it 6 GNU Anubis is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 7 under the terms of the GNU General Public License as published by the
@@ -879,7 +879,8 @@ synch (void)
879 } 879 }
880 880
881 stream_create (&iostream); 881 stream_create (&iostream);
882 stream_set_io (iostream, (void *) fd, NULL, NULL, NULL, NULL, NULL); 882 stream_set_io (iostream, (void *) (ptrdiff_t) fd, NULL, NULL, NULL, NULL,
883 NULL);
883 884
884 repl = smtp_reply_new (); 885 repl = smtp_reply_new ();
885 smtp_get_reply (repl); 886 smtp_get_reply (repl);
@@ -890,7 +891,6 @@ synch (void)
890 smtp_reply_free (repl); 891 smtp_reply_free (repl);
891 return 1; 892 return 1;
892 } 893 }
893 smtp_reply_free (repl);
894 894
895 smtp_ehlo (1); 895 smtp_ehlo (1);
896 896
@@ -909,6 +909,7 @@ synch (void)
909 if (!smtp_reply_has_capa (smtp_capa, "XDATABASE", NULL)) 909 if (!smtp_reply_has_capa (smtp_capa, "XDATABASE", NULL))
910 { 910 {
911 error (_("Remote party does not reveal XDATABASE capability")); 911 error (_("Remote party does not reveal XDATABASE capability"));
912 smtp_reply_free (repl);
912 smtp_quit (); 913 smtp_quit ();
913 return 1; 914 return 1;
914 } 915 }
diff --git a/src/anubisusr.h b/src/anubisusr.h
index e94fee4..73b8b4e 100644
--- a/src/anubisusr.h
+++ b/src/anubisusr.h
@@ -1,7 +1,7 @@
1/* 1/*
2 anubisusr.h 2 anubisusr.h
3 3
4 Copyright (C) 2004-2014 The Anubis Team. 4 Copyright (C) 2004-2020 The Anubis Team.
5 5
6 GNU Anubis is free software; you can redistribute it and/or modify it 6 GNU Anubis is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 7 under the terms of the GNU General Public License as published by the
diff --git a/src/authmode.c b/src/authmode.c
index f81a0fe..4febfa2 100644
--- a/src/authmode.c
+++ b/src/authmode.c
@@ -2,7 +2,7 @@
2 authmode.c 2 authmode.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/daemon.c b/src/daemon.c
index 97e84a9..92e0d09 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -2,7 +2,7 @@
2 daemon.c 2 daemon.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -313,7 +313,7 @@ static int
313_stdio_write (void *sd, const char *data, size_t size, size_t * nbytes) 313_stdio_write (void *sd, const char *data, size_t size, size_t * nbytes)
314{ 314{
315 int rc; 315 int rc;
316 int fd = (int) sd; 316 int fd = (int) (ptrdiff_t) sd;
317 317
318 if (fd == 0) 318 if (fd == 0)
319 fd = 1; 319 fd = 1;
@@ -330,7 +330,7 @@ static int
330_stdio_read (void *sd, char *data, size_t size, size_t * nbytes) 330_stdio_read (void *sd, char *data, size_t size, size_t * nbytes)
331{ 331{
332 int n; 332 int n;
333 int fd = (int) sd; 333 int fd = (int) (ptrdiff_t) sd;
334 fd_set rds; 334 fd_set rds;
335 335
336 errno = 0; 336 errno = 0;
diff --git a/src/dbtext.c b/src/dbtext.c
index d0fc083..63586eb 100644
--- a/src/dbtext.c
+++ b/src/dbtext.c
@@ -2,7 +2,7 @@
2 dbtext.c 2 dbtext.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/env.opt b/src/env.opt
index 487cc85..d21ff3e 100644
--- a/src/env.opt
+++ b/src/env.opt
@@ -1,6 +1,6 @@
1/* -*- c -*- 1/* -*- c -*-
2 This file is part of GNU Anubis. 2 This file is part of GNU Anubis.
3 Copyright (C) 2001-2014 The Anubis Team. 3 Copyright (C) 2001-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify 5 GNU Anubis is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -94,6 +94,12 @@ BEGIN
94 topt |= T_STDINOUT; 94 topt |= T_STDINOUT;
95END 95END
96 96
97OPTION(,S,,
98 [<listen on file descriptor 3>])
99BEGIN
100 topt |= T_PASSFD;
101END
102
97GROUP(Output options) 103GROUP(Output options)
98 104
99OPTION(silent, s,, Work silently) 105OPTION(silent, s,, Work silently)
@@ -158,7 +164,6 @@ OPTION(pid-file,, FILE,
158 Store the PID of the running daemon in FILE) 164 Store the PID of the running daemon in FILE)
159BEGIN 165BEGIN
160 pidfile = optarg; 166 pidfile = optarg;
161 rc_disable_keyword (CF_INIT | CF_SUPERVISOR, "termlevel");
162END 167END
163 168
164OPTIONS_END 169OPTIONS_END
diff --git a/src/errs.c b/src/errs.c
index e18462f..87e6581 100644
--- a/src/errs.c
+++ b/src/errs.c
@@ -2,7 +2,7 @@
2 errs.c 2 errs.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/esmtp.c b/src/esmtp.c
index 02fda88..3b3ef6f 100644
--- a/src/esmtp.c
+++ b/src/esmtp.c
@@ -2,7 +2,7 @@
2 esmtp.c 2 esmtp.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/exec.c b/src/exec.c
index 3abfde5..43d7748 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -2,7 +2,7 @@
2 exec.c 2 exec.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/extern.h b/src/extern.h
index fb7afd7..23cc41e 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -2,7 +2,7 @@
2 extern.h 2 extern.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/gdbm.c b/src/gdbm.c
index 58153f8..9bd6193 100644
--- a/src/gdbm.c
+++ b/src/gdbm.c
@@ -2,7 +2,7 @@
2 gdbm.c 2 gdbm.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -33,7 +33,7 @@
33 The last two items are optional */ 33 The last two items are optional */
34 34
35static int 35static int
36gdbm_db_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode, 36db_gdbm_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode,
37 char const **errp) 37 char const **errp)
38{ 38{
39 GDBM_FILE dbf; 39 GDBM_FILE dbf;
@@ -67,7 +67,7 @@ gdbm_db_open (void **dp, ANUBIS_URL * url, enum anubis_db_mode mode,
67} 67}
68 68
69static int 69static int
70gdbm_db_close (void *d) 70db_gdbm_close (void *d)
71{ 71{
72 gdbm_close (d); 72 gdbm_close (d);
73 return ANUBIS_DB_SUCCESS; 73 return ANUBIS_DB_SUCCESS;
@@ -101,7 +101,7 @@ gdbm_content_to_record (char *keystr, datum content, ANUBIS_USER * rec)
101} 101}
102 102
103static int 103static int
104gdbm_db_get (void *d, const char *keystr, ANUBIS_USER * rec, int *errp) 104db_gdbm_get (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
105{ 105{
106 datum key, content; 106 datum key, content;
107 107
@@ -118,7 +118,7 @@ gdbm_db_get (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
118} 118}
119 119
120static int 120static int
121gdbm_db_list (void *d, ANUBIS_LIST list, int *ecode) 121db_gdbm_list (void *d, ANUBIS_LIST list, int *ecode)
122{ 122{
123 datum key, content; 123 datum key, content;
124 124
@@ -147,7 +147,7 @@ gdbm_db_list (void *d, ANUBIS_LIST list, int *ecode)
147} 147}
148 148
149static int 149static int
150gdbm_db_put (void *d, const char *keystr, ANUBIS_USER * rec, int *errp) 150db_gdbm_put (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
151{ 151{
152 size_t size, n; 152 size_t size, n;
153 char *text; 153 char *text;
@@ -191,7 +191,7 @@ gdbm_db_put (void *d, const char *keystr, ANUBIS_USER * rec, int *errp)
191} 191}
192 192
193static int 193static int
194gdbm_db_delete (void *d, const char *keystr, int *ecode) 194db_gdbm_delete (void *d, const char *keystr, int *ecode)
195{ 195{
196 int rc; 196 int rc;
197 datum key; 197 datum key;
@@ -208,21 +208,21 @@ gdbm_db_delete (void *d, const char *keystr, int *ecode)
208 return rc; 208 return rc;
209} 209}
210 210
211const char * 211static const char *
212gdbm_db_strerror (void *d, int rc) 212db_gdbm_strerror (void *d, int rc)
213{ 213{
214 return gdbm_strerror (rc); 214 return gdbm_strerror (rc);
215} 215}
216 216
217void 217void
218gdbm_db_init (void) 218db_gdbm_init (void)
219{ 219{
220 anubis_db_register ("gdbm", 220 anubis_db_register ("gdbm",
221 gdbm_db_open, 221 db_gdbm_open,
222 gdbm_db_close, 222 db_gdbm_close,
223 gdbm_db_get, 223 db_gdbm_get,
224 gdbm_db_put, 224 db_gdbm_put,
225 gdbm_db_delete, gdbm_db_list, gdbm_db_strerror); 225 db_gdbm_delete, db_gdbm_list, db_gdbm_strerror);
226} 226}
227 227
228#endif /* HAVE_LIBGDBM */ 228#endif /* HAVE_LIBGDBM */
diff --git a/src/getopt.m4 b/src/getopt.m4
index 88e3ba4..68c8f30 100644
--- a/src/getopt.m4
+++ b/src/getopt.m4
@@ -1,5 +1,5 @@
1dnl This file is part of GNU Anubis. 1dnl This file is part of GNU Anubis.
2dnl Copyright (C) 2007-2014 The Anubis Team. 2dnl Copyright (C) 2007-2020 The Anubis Team.
3dnl 3dnl
4dnl GNU Anubis is free software; you can redistribute it and/or modify it 4dnl GNU Anubis is free software; you can redistribute it and/or modify it
5dnl under the terms of the GNU General Public License as published by the 5dnl under the terms of the GNU General Public License as published by the
@@ -220,7 +220,7 @@ print_option_descr (const char *descr, size_t lmargin, size_t rmargin)
220{ 220{
221 while (*descr) 221 while (*descr)
222 { 222 {
223 size_t s = 0; 223 int s = 0;
224 size_t i; 224 size_t i;
225 size_t width = rmargin - lmargin; 225 size_t width = rmargin - lmargin;
226 226
diff --git a/src/gpg.c b/src/gpg.c
index 9ad3289..4eb4271 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -2,7 +2,7 @@
2 gpg.c 2 gpg.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -21,8 +21,6 @@
21#include "headers.h" 21#include "headers.h"
22#include "extern.h" 22#include "extern.h"
23#include "rcfile.h" 23#include "rcfile.h"
24
25#ifdef HAVE_GPG
26#include <gpgme.h> 24#include <gpgme.h>
27#define obstack_chunk_alloc malloc 25#define obstack_chunk_alloc malloc
28#define obstack_chunk_free free 26#define obstack_chunk_free free
@@ -237,7 +235,9 @@ create_key_array(gpgme_ctx_t ctx, struct obstack *stk)
237 if (err) 235 if (err)
238 break; 236 break;
239 237
240 gpgme_get_key (ctx, current_key, &tmpkey, 0); 238 err = gpgme_get_key (ctx, current_key, &tmpkey, 0);
239 if (err)
240 break;
241 obstack_grow (stk, &tmpkey, sizeof (tmpkey)); 241 obstack_grow (stk, &tmpkey, sizeof (tmpkey));
242 if (options.termlevel == DEBUG) 242 if (options.termlevel == DEBUG)
243 { 243 {
@@ -248,14 +248,23 @@ create_key_array(gpgme_ctx_t ctx, struct obstack *stk)
248 uid->uid, uid->name, uid->email); 248 uid->uid, uid->name, uid->email);
249 } 249 }
250 } 250 }
251 if (gpg_err_code (err) != GPG_ERR_EOF) 251
252 switch (gpg_err_code (err))
252 { 253 {
254 case GPG_ERR_EOF:
255 break;
256
257 case GPG_ERR_INV_VALUE:
258 fprintf (stderr, "key not found: %s\n", current_key);
259 exit (1);
260
261 default:
253 fprintf (stderr, "cannot list keys: %s\n", 262 fprintf (stderr, "cannot list keys: %s\n",
254 gpgme_strerror (err)); 263 gpgme_strerror (err));
255 exit (1); 264 exit (1);
256 } 265 }
257 266
258 memset (current_key, 0, sizeof (current_key)); 267 memset (current_key, 0, j);
259 j = 0; 268 j = 0;
260 } 269 }
261 else 270 else
@@ -571,6 +580,4 @@ gpg_section_init (void)
571 rc_secdef_add_child (sp, &gpg_sect_child); 580 rc_secdef_add_child (sp, &gpg_sect_child);
572} 581}
573 582
574#endif /* HAVE_GPG */
575
576/* EOF */ 583/* EOF */
diff --git a/src/gsasl.c b/src/gsasl.c
index b52bf3f..a0d5090 100644
--- a/src/gsasl.c
+++ b/src/gsasl.c
@@ -2,7 +2,7 @@
2 gsasl.c 2 gsasl.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -20,9 +20,6 @@
20 20
21#include "headers.h" 21#include "headers.h"
22#include "extern.h" 22#include "extern.h"
23
24#if defined(WITH_GSASL)
25
26#include "lbuf.h" 23#include "lbuf.h"
27 24
28 25
@@ -174,5 +171,3 @@ install_gsasl_stream (Gsasl_session *sess_ctx, NET_STREAM *stream)
174 _gsasl_read, _gsasl_write, 171 _gsasl_read, _gsasl_write,
175 _gsasl_close, _gsasl_destroy, _gsasl_strerror); 172 _gsasl_close, _gsasl_destroy, _gsasl_strerror);
176} 173}
177
178#endif
diff --git a/src/gsasl_srv.c b/src/gsasl_srv.c
index 4846fcd..4e18b01 100644
--- a/src/gsasl_srv.c
+++ b/src/gsasl_srv.c
@@ -2,7 +2,7 @@
2 gsasl_srv.c 2 gsasl_srv.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/guile.c b/src/guile.c
index 7c898d5..67e19fa 100644
--- a/src/guile.c
+++ b/src/guile.c
@@ -2,7 +2,7 @@
2 guile.c 2 guile.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -22,8 +22,6 @@
22#include "extern.h" 22#include "extern.h"
23#include "rcfile.h" 23#include "rcfile.h"
24 24
25#ifdef WITH_GUILE
26
27static void guile_ports_open (void); 25static void guile_ports_open (void);
28static void guile_ports_close (void); 26static void guile_ports_close (void);
29 27
@@ -83,8 +81,7 @@ init_guile ()
83{ 81{
84 scm_init_guile (); 82 scm_init_guile ();
85 scm_load_goops (); 83 scm_load_goops ();
86 guile_init_anubis_info_port (); 84 guile_init_anubis_log_port ();
87 guile_init_anubis_error_port ();
88} 85}
89 86
90 87
@@ -110,7 +107,7 @@ guile_ports_open ()
110 107
111 if (fd >= 0) 108 if (fd >= 0)
112 { 109 {
113 port = scm_fdes_to_port (fd, "a", scm_makfrom0str (name)); 110 port = scm_fdes_to_port (fd, "a", scm_from_locale_string (name));
114 guile_ports_close (); 111 guile_ports_close ();
115 scm_set_current_error_port (port); 112 scm_set_current_error_port (port);
116 scm_set_current_output_port (port); 113 scm_set_current_output_port (port);
@@ -157,7 +154,7 @@ guile_load_path_append_handler (void *data)
157 154
158 pscm = SCM_VARIABLE_LOC (scm_c_lookup ("%load-path")); 155 pscm = SCM_VARIABLE_LOC (scm_c_lookup ("%load-path"));
159 *pscm = scm_append (scm_list_3 (path_scm, 156 *pscm = scm_append (scm_list_3 (path_scm,
160 scm_list_1 (scm_makfrom0str (path)), 157 scm_list_1 (scm_from_locale_string (path)),
161 SCM_EOL)); 158 SCM_EOL));
162 return SCM_UNSPECIFIED; 159 return SCM_UNSPECIFIED;
163} 160}
@@ -267,7 +264,7 @@ list_to_args (ANUBIS_LIST arglist)
267 switch (p[1]) 264 switch (p[1])
268 { 265 {
269 case ':': 266 case ':':
270 val = scm_c_make_keyword (p + 2); 267 val = scm_from_locale_keyword (p + 2);
271 break; 268 break;
272 269
273 case 'f': 270 case 'f':
@@ -491,10 +488,12 @@ guile_parser (EVAL_ENV env, int key, ANUBIS_LIST arglist, void *inv_data)
491 } 488 }
492 489
493 if (setjmp (jmp_env) == 0) 490 if (setjmp (jmp_env) == 0)
494 scm_internal_lazy_catch (SCM_BOOL_T, 491 {
495 inner_catch_body, 492 scm_c_catch (SCM_BOOL_T,
496 &closure, 493 inner_catch_body, &closure,
497 eval_catch_handler, &jmp_env); 494 eval_catch_handler, &jmp_env,
495 NULL, NULL);
496 }
498} 497}
499 498
500static struct rc_secdef_child guile_secdef_child = { 499static struct rc_secdef_child guile_secdef_child = {
@@ -522,6 +521,4 @@ guile_section_init (void)
522 rc_secdef_add_child (sp, &guile_rule_secdef_child); 521 rc_secdef_add_child (sp, &guile_rule_secdef_child);
523} 522}
524 523
525#endif /* WITH_GUILE */
526
527/* EOF */ 524/* EOF */
diff --git a/src/headers.h b/src/headers.h
index 55665e2..9162ab6 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -2,7 +2,7 @@
2 headers.h 2 headers.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -239,6 +239,7 @@ ANUBIS_MODE;
239#define T_XELO 0x10000000 239#define T_XELO 0x10000000
240#define T_LOCATION_COLUMN 0x20000000 240#define T_LOCATION_COLUMN 0x20000000
241#define T_ESMTP_AUTH_DELAYED 0x40000000 241#define T_ESMTP_AUTH_DELAYED 0x40000000
242#define T_PASSFD 0x80000000
242 243
243/* Regexp modifiers */ 244/* Regexp modifiers */
244/* Basic types */ 245/* Basic types */
@@ -524,9 +525,8 @@ void gpg_section_init (void);
524void init_guile (void); 525void init_guile (void);
525void guile_debug (int); 526void guile_debug (int);
526void guile_section_init (void); 527void guile_section_init (void);
527void guile_init_anubis_error_port (void); 528void guile_init_anubis_log_port (void);
528SCM guile_make_anubis_error_port (int err); 529SCM guile_make_anubis_error_port (int err);
529void guile_init_anubis_info_port (void);
530SCM guile_make_anubis_info_port (void); 530SCM guile_make_anubis_info_port (void);
531#endif /* WITH_GUILE */ 531#endif /* WITH_GUILE */
532 532
@@ -604,7 +604,7 @@ void anubis_db_free_record (ANUBIS_USER * rec);
604void dbtext_init (void); 604void dbtext_init (void);
605 605
606/* gdbm.c */ 606/* gdbm.c */
607void gdbm_db_init (void); 607void db_gdbm_init (void);
608 608
609/* mysql.c */ 609/* mysql.c */
610void mysql_db_init (void); 610void mysql_db_init (void);
diff --git a/src/help.c b/src/help.c
index e22ba96..587b4c2 100644
--- a/src/help.c
+++ b/src/help.c
@@ -2,7 +2,7 @@
2 help.c 2 help.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -37,6 +37,9 @@ static char *config_opts[] = {
37#ifdef WITH_PGSQL 37#ifdef WITH_PGSQL
38 "POSTGRES", 38 "POSTGRES",
39 #endif /* WITH_PGSQL */ 39 #endif /* WITH_PGSQL */
40#ifdef HAVE_LIBGDBM
41 "GDBM",
42#endif
40#ifdef WITH_GUILE 43#ifdef WITH_GUILE
41 "GUILE", 44 "GUILE",
42 #endif /* WITH_GUILE */ 45 #endif /* WITH_GUILE */
diff --git a/src/ident.c b/src/ident.c
index 950f9a4..7144a99 100644
--- a/src/ident.c
+++ b/src/ident.c
@@ -2,7 +2,7 @@
2 ident.c 2 ident.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/list.c b/src/list.c
index fe980ba..0649422 100644
--- a/src/list.c
+++ b/src/list.c
@@ -2,7 +2,7 @@
2 list.c 2 list.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/list.h b/src/list.h
index 55f629e..0202a73 100644
--- a/src/list.h
+++ b/src/list.h
@@ -2,7 +2,7 @@
2 list.h 2 list.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/log.c b/src/log.c
index 164326d..0963749 100644
--- a/src/log.c
+++ b/src/log.c
@@ -2,7 +2,7 @@
2 log.c 2 log.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/logport.c b/src/logport.c
index d43d740..9e875c9 100644
--- a/src/logport.c
+++ b/src/logport.c
@@ -2,7 +2,7 @@
2 Log and info output ports for Guile. 2 Log and info output ports for Guile.
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -24,220 +24,80 @@
24 24
25#ifdef WITH_GUILE 25#ifdef WITH_GUILE
26 26
27#ifndef HAVE_SCM_T_OFF 27static scm_t_port_type *scm_anubis_log_port_type;
28typedef off_t scm_t_off;
29#endif
30 28
31static scm_t_bits scm_tc16_anubis_error_port; 29#define GET_LOG_PORT(x) ((struct anubis_log_port *) SCM_STREAM (x))
32static scm_t_bits scm_tc16_anubis_info_port;
33 30
34typedef void (*log_flush_fn) (int flag, char *, size_t); 31enum { PORT_LOG_INFO, PORT_LOG_ERROR };
35 32
36struct _anubis_error_port { 33struct anubis_log_port {
34 int type;
37 int flag; /* For error ports: -1 if error, >=0 if warning; 35 int flag; /* For error ports: -1 if error, >=0 if warning;
38 For info ports: verbosity level */ 36 For info ports: verbosity level */
39 log_flush_fn flush;
40}; 37};
41 38
42#define ANUBIS_ERROR_PORT_BUFSIZE 256 39static size_t
43 40log_port_write (SCM port, SCM src, size_t start, size_t count)
44static void
45log_flush (int flag, char *str, size_t size)
46{
47 if (flag == -1)
48 anubis_error (0, 0, "%*.*s", size, size, str);
49 else
50 anubis_warning (0, "%*.*s", size, size, str);
51}
52
53static void
54info_flush (int flag, char *str, size_t size)
55{
56 info (flag, "%*.*s", size, size, str);
57}
58
59SCM
60_make_anubis_log_port (long type, const char *descr, int flag,
61 log_flush_fn flush)
62{ 41{
63 struct _anubis_error_port *dp; 42 struct anubis_log_port *lp = GET_LOG_PORT (port);
64 SCM port; 43 signed char *str = SCM_BYTEVECTOR_CONTENTS (src) + start;
65 scm_port *pt; 44 int n = count;
66 45 if (str[n-1] == '\n')
67 dp = scm_gc_malloc (sizeof (struct _anubis_error_port), descr); 46 n--;
68 dp->flag = flag; 47 switch (lp->type)
69 dp->flush = flush;
70
71 port = scm_new_port_table_entry (type);
72 pt = SCM_PTAB_ENTRY(port);
73 pt->rw_random = 0;
74 pt->write_buf = scm_gc_malloc (ANUBIS_ERROR_PORT_BUFSIZE, "port buffer");
75 pt->write_pos = pt->write_buf;
76 pt->write_buf_size = ANUBIS_ERROR_PORT_BUFSIZE;
77 pt->write_end = pt->write_buf + pt->write_buf_size;
78
79 SCM_SET_CELL_TYPE (port, (type | SCM_OPN | SCM_WRTNG | SCM_BUFLINE));
80 SCM_SETSTREAM (port, dp);
81 return port;
82}
83
84SCM
85guile_make_anubis_error_port (int err)
86{
87 return _make_anubis_log_port (scm_tc16_anubis_error_port,
88 "anubis-error-port", err, log_flush);
89}
90
91SCM
92guile_make_anubis_info_port (void)
93{
94 return _make_anubis_log_port (scm_tc16_anubis_info_port,
95 "anubis-info-port", 0, info_flush);
96}
97
98#define ANUBIS_ERROR_PORT(x) ((struct _anubis_error_port *) SCM_STREAM (x))
99
100static SCM
101_anubis_error_port_mark (SCM port)
102{
103 return SCM_BOOL_F;
104}
105
106static void
107_anubis_error_port_flush (SCM port)
108{
109 struct _anubis_error_port *dp = ANUBIS_ERROR_PORT (port);
110 scm_port *pt = SCM_PTAB_ENTRY (port);
111 size_t size = pt->write_pos - pt->write_buf;
112 unsigned char *nl = memchr (pt->write_buf, '\n', size);
113 int wrsize;
114
115 if (!nl)
116 return;
117
118 wrsize = nl - pt->write_buf;
119
120 dp->flush (dp->flag, (char *) pt->write_buf, wrsize);
121
122 if (wrsize < size)
123 { 48 {
124 size_t write_start; 49 case PORT_LOG_INFO:
125 50 info (lp->flag, "%*.*s", n, n, str);
126 nl++; 51 break;
127 write_start = pt->write_pos - nl; 52
128 memmove (pt->write_buf, nl, write_start); 53 case PORT_LOG_ERROR:
129 pt->write_pos = pt->write_buf + write_start; 54 if (lp->flag == -1)
55 anubis_error (0, 0, "%*.*s", n, n, str);
56 else
57 anubis_warning (0, "%*.*s", n, n, str);
58 break;
130 } 59 }
131 else 60 return count;
132 pt->write_pos = pt->write_buf;
133} 61}
134 62
135static int 63static int
136_anubis_error_port_close (SCM port) 64log_port_print (SCM exp, SCM port, scm_print_state *pstate)
137{
138 struct _anubis_error_port *dp = ANUBIS_ERROR_PORT (port);
139
140 if (dp)
141 {
142 _anubis_error_port_flush (port);
143 SCM_SETSTREAM (port, NULL);
144 scm_gc_free (dp, sizeof(struct _anubis_error_port),
145 "anubis-error-port");
146 }
147 return 0;
148}
149
150static scm_sizet
151_anubis_error_port_free (SCM port)
152{ 65{
153 _anubis_error_port_close (port); 66 scm_puts ("#<Anubis log port>", port);
154 return 0; 67 return 1;
155} 68}
156 69
157static int 70void
158_anubis_error_port_fill_input (SCM port) 71guile_init_anubis_log_port (void)
159{ 72{
160 return EOF; 73 scm_anubis_log_port_type = scm_make_port_type ("anubis-log",
161} 74 NULL, log_port_write);
75 scm_set_port_print (scm_anubis_log_port_type, log_port_print);
76 scm_set_port_needs_close_on_gc (scm_anubis_log_port_type, 1);
77}
162 78
163static void 79static SCM
164_anubis_error_port_write (SCM port, const void *data, size_t size) 80_make_anubis_log_port (int type, int flag)
165{ 81{
166 scm_port *pt = SCM_PTAB_ENTRY (port); 82 struct anubis_log_port *lp;
167 size_t space = pt->write_end - pt->write_pos;
168 if (space < size)
169 {
170 size_t start = pt->write_pos - pt->write_buf;
171 size_t new_size = pt->write_buf_size;
172
173 do
174 {
175 /*FIXME*/
176 new_size *= 2;
177 }
178 while (new_size - start < size);
179
180 pt->write_buf = scm_gc_realloc (pt->write_buf,
181 pt->write_buf_size,
182 new_size, "write buffer");
183 pt->write_buf_size = new_size;
184 pt->write_end = pt->write_buf + pt->write_buf_size;
185 pt->write_pos = pt->write_buf + start;
186 }
187 memcpy (pt->write_pos, data, size);
188 pt->write_pos += size;
189 83
190 if (memchr (data, '\n', size)) 84 lp = scm_gc_typed_calloc (struct anubis_log_port);
191 _anubis_error_port_flush (port); 85 lp->type = type;
86 lp->flag = flag;
87 return scm_c_make_port (scm_anubis_log_port_type,
88 SCM_WRTNG | SCM_BUFLINE, (scm_t_bits) lp);
192} 89}
193 90
194static scm_t_off 91SCM
195_anubis_error_port_seek (SCM port, scm_t_off offset, int whence) 92guile_make_anubis_error_port (int err)
196{
197 return -1;
198}
199
200static int
201_anubis_error_port_print (SCM exp, SCM port, scm_print_state *pstate)
202{ 93{
203 scm_puts ("#<Anubis error port>", port); 94 return _make_anubis_log_port (PORT_LOG_ERROR, err);
204 return 1;
205} 95}
206 96
207static int 97SCM
208_anubis_info_port_print (SCM exp, SCM port, scm_print_state *pstate) 98guile_make_anubis_info_port (void)
209{ 99{
210 scm_puts ("#<Anubis info port>", port); 100 return _make_anubis_log_port (PORT_LOG_INFO, NORMAL);
211 return 1;
212} 101}
213 102
214void
215guile_init_anubis_error_port ()
216{
217 scm_tc16_anubis_error_port =
218 scm_make_port_type ("anubis-error-port",
219 _anubis_error_port_fill_input,
220 _anubis_error_port_write);
221 scm_set_port_mark (scm_tc16_anubis_error_port, _anubis_error_port_mark);
222 scm_set_port_free (scm_tc16_anubis_error_port, _anubis_error_port_free);
223 scm_set_port_print (scm_tc16_anubis_error_port, _anubis_error_port_print);
224 scm_set_port_flush (scm_tc16_anubis_error_port, _anubis_error_port_flush);
225 scm_set_port_close (scm_tc16_anubis_error_port, _anubis_error_port_close);
226 scm_set_port_seek (scm_tc16_anubis_error_port, _anubis_error_port_seek);
227}
228
229void
230guile_init_anubis_info_port ()
231{
232 scm_tc16_anubis_info_port =
233 scm_make_port_type ("anubis-info-port",
234 _anubis_error_port_fill_input,
235 _anubis_error_port_write);
236 scm_set_port_mark (scm_tc16_anubis_info_port, _anubis_error_port_mark);
237 scm_set_port_free (scm_tc16_anubis_info_port, _anubis_error_port_free);
238 scm_set_port_print (scm_tc16_anubis_info_port, _anubis_info_port_print);
239 scm_set_port_flush (scm_tc16_anubis_info_port, _anubis_error_port_flush);
240 scm_set_port_close (scm_tc16_anubis_info_port, _anubis_error_port_close);
241 scm_set_port_seek (scm_tc16_anubis_info_port, _anubis_error_port_seek);
242}
243#endif 103#endif
diff --git a/src/main.c b/src/main.c
index 708f859..d6aaa77 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,6 @@
1/* 1/*
2 GNU Anubis -- an SMTP message submission daemon. 2 GNU Anubis -- an SMTP message submission daemon.
3 Copyright (C) 2001-2014 The Anubis Team. 3 Copyright (C) 2001-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify it 5 GNU Anubis is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
@@ -98,7 +98,7 @@ main (int argc, char *argv[])
98#ifdef WITH_GSASL 98#ifdef WITH_GSASL
99 dbtext_init (); 99 dbtext_init ();
100# ifdef HAVE_LIBGDBM 100# ifdef HAVE_LIBGDBM
101 gdbm_db_init (); 101 db_gdbm_init ();
102# endif 102# endif
103# ifdef WITH_MYSQL 103# ifdef WITH_MYSQL
104 mysql_db_init (); 104 mysql_db_init ();
@@ -162,6 +162,14 @@ main (int argc, char *argv[])
162 162
163 if (anubis_mode == anubis_mda) /* Mail Delivery Agent */ 163 if (anubis_mode == anubis_mda) /* Mail Delivery Agent */
164 mda (); 164 mda ();
165 else if (topt & T_PASSFD)
166 {
167 int sd = 3;
168 if (listen (sd, 5))
169 anubis_error (EXIT_FAILURE, errno, _("listen(3) failed"));
170 kill (getppid (), SIGUSR1);
171 loop (sd);
172 }
165 else if (topt & T_STDINOUT) /* stdin/stdout */ 173 else if (topt & T_STDINOUT) /* stdin/stdout */
166 stdinout (); 174 stdinout ();
167 else 175 else
diff --git a/src/map.c b/src/map.c
index f9dde3c..2efed1f 100644
--- a/src/map.c
+++ b/src/map.c
@@ -2,7 +2,7 @@
2 map.c 2 map.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/mda.c b/src/mda.c
index e37dda0..ad0e5b6 100644
--- a/src/mda.c
+++ b/src/mda.c
@@ -2,7 +2,7 @@
2 mda.c 2 mda.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2005-2014 The Anubis Team. 5 Copyright (C) 2005-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/message.c b/src/message.c
index b6b70fe..003bef5 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2,7 +2,7 @@
2 message.c 2 message.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/mime.c b/src/mime.c
index 3fc1e3c..f71a4db 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -2,7 +2,7 @@
2 mime.c 2 mime.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -96,7 +96,7 @@ message_append_signature_file (MESSAGE msg)
96 96
97 n = strlen (homedir) + strlen (signature_file) + 2; 97 n = strlen (homedir) + strlen (signature_file) + 2;
98 signature_path = xmalloc (n); 98 signature_path = xmalloc (n);
99 snprintf (signature_path, n - 1, "%s/%s", homedir, signature_file); 99 snprintf (signature_path, n, "%s/%s", homedir, signature_file);
100 100
101 message_append_text_file (msg, signature_path, "-- \n"); 101 message_append_text_file (msg, signature_path, "-- \n");
102 free (signature_path); 102 free (signature_path);
diff --git a/src/misc.c b/src/misc.c
index 750ebe8..8444b85 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2,7 +2,7 @@
2 misc.c 2 misc.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/mysql.c b/src/mysql.c
index 5673aec..ebc0c01 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -2,7 +2,7 @@
2 mysql.c 2 mysql.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/net.c b/src/net.c
index 95fc021..d3248d6 100644
--- a/src/net.c
+++ b/src/net.c
@@ -2,7 +2,7 @@
2 net.c 2 net.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -341,7 +341,7 @@ void
341net_create_stream (NET_STREAM * str, int fd) 341net_create_stream (NET_STREAM * str, int fd)
342{ 342{
343 stream_create (str); 343 stream_create (str);
344 stream_set_io (*str, (void *) fd, NULL, NULL, NULL, NULL, NULL); 344 stream_set_io (*str, (void *) (ptrdiff_t) fd, NULL, NULL, NULL, NULL, NULL);
345} 345}
346 346
347 347
diff --git a/src/pgsql.c b/src/pgsql.c
index 0cb30fa..96b6408 100644
--- a/src/pgsql.c
+++ b/src/pgsql.c
@@ -2,7 +2,7 @@
2 pgsql.c 2 pgsql.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2004-2014 The Anubis Team. 5 Copyright (C) 2004-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/proclist.c b/src/proclist.c
index 55441ac..01c567f 100644
--- a/src/proclist.c
+++ b/src/proclist.c
@@ -2,7 +2,7 @@
2 proclist.c 2 proclist.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2005-2014 The Anubis Team. 5 Copyright (C) 2005-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/quit.c b/src/quit.c
index d6b2897..11690c4 100644
--- a/src/quit.c
+++ b/src/quit.c
@@ -2,7 +2,7 @@
2 quit.c 2 quit.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/rc-gram.y b/src/rc-gram.y
index d2aa080..dcf2595 100644
--- a/src/rc-gram.y
+++ b/src/rc-gram.y
@@ -3,7 +3,7 @@
3 rc-gram.y 3 rc-gram.y
4 4
5 This file is part of GNU Anubis. 5 This file is part of GNU Anubis.
6 Copyright (C) 2003-2014 The Anubis Team. 6 Copyright (C) 2003-2020 The Anubis Team.
7 7
8 GNU Anubis is free software; you can redistribute it and/or modify it 8 GNU Anubis is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
diff --git a/src/rc-lex.l b/src/rc-lex.l
index 308989b..1a6aedc 100644
--- a/src/rc-lex.l
+++ b/src/rc-lex.l
@@ -3,7 +3,7 @@
3 rcfile.l 3 rcfile.l
4 4
5 This file is part of GNU Anubis. 5 This file is part of GNU Anubis.
6 Copyright (C) 2003-2014 The Anubis Team. 6 Copyright (C) 2003-2020 The Anubis Team.
7 7
8 GNU Anubis is free software; you can redistribute it and/or modify it 8 GNU Anubis is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
diff --git a/src/rcfile.c b/src/rcfile.c
index 27033c3..c52eb3d 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -2,7 +2,7 @@
2 rcfile.c 2 rcfile.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -328,22 +328,6 @@ static volatile unsigned long _anubis_hang;
328/* List of users who are allowed to use HANG in their profiles */ 328/* List of users who are allowed to use HANG in their profiles */
329ANUBIS_LIST allow_hang_users; 329ANUBIS_LIST allow_hang_users;
330 330
331static struct rc_kwdef esmtp_kw[] = {
332 { "esmtp-auth", KW_ESMTP_AUTH, KWF_HIDDEN },
333 { "esmtp-anonymous-token", KW_ESMTP_ANONYMOUS_TOKEN, KWF_HIDDEN },
334 { "esmtp-auth-id", KW_ESMTP_AUTH_ID, KWF_HIDDEN },
335 { "esmtp-authz-id", KW_ESMTP_AUTHZ_ID, KWF_HIDDEN },
336 { "esmtp-password", KW_ESMTP_PASSWORD, KWF_HIDDEN },
337 { "esmtp-service", KW_ESMTP_SERVICE, KWF_HIDDEN },
338 { "esmtp-hostname", KW_ESMTP_HOSTNAME, KWF_HIDDEN },
339 { "esmtp-generic-service", KW_ESMTP_SERVICE, KWF_HIDDEN },
340 { "esmtp-passcode", KW_ESMTP_PASSCODE, KWF_HIDDEN },
341 { "esmtp-realm", KW_ESMTP_REALM, KWF_HIDDEN },
342 { "esmtp-allowed-mech", KW_ESMTP_ALLOWED_MECH },
343 { "esmtp-require-encryption", KW_ESMTP_REQUIRE_ENCRYPTION },
344 { NULL }
345};
346
347static int 331static int
348parse_esmtp_kv (int key, ANUBIS_LIST arglist) 332parse_esmtp_kv (int key, ANUBIS_LIST arglist)
349{ 333{
diff --git a/src/rcfile.h b/src/rcfile.h
index 99d3679..2f72560 100644
--- a/src/rcfile.h
+++ b/src/rcfile.h
@@ -2,7 +2,7 @@
2 rcfile.h 2 rcfile.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/regex.c b/src/regex.c
index 4151e0a..be9f72e 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2,7 +2,7 @@
2 regex.c 2 regex.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/smtprepl.c b/src/smtprepl.c
index d4b6ac4..46cbb53 100644
--- a/src/smtprepl.c
+++ b/src/smtprepl.c
@@ -1,5 +1,5 @@
1/* This file is part of GNU Anubis. 1/* This file is part of GNU Anubis.
2 Copyright (C) 2009-2014 The Anubis Team. 2 Copyright (C) 2009-2020 The Anubis Team.
3 3
4 GNU Anubis is free software; you can redistribute it and/or modify it 4 GNU Anubis is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the 5 under the terms of the GNU General Public License as published by the
diff --git a/src/smtprepl.h b/src/smtprepl.h
index 0b22bfc..1b4cc78 100644
--- a/src/smtprepl.h
+++ b/src/smtprepl.h
@@ -2,7 +2,7 @@
2 headers.h 2 headers.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/socks.c b/src/socks.c
index 9977c26..447d086 100644
--- a/src/socks.c
+++ b/src/socks.c
@@ -2,7 +2,7 @@
2 socks.c 2 socks.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/sql.c b/src/sql.c
index 2524ee5..398fce4 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -2,7 +2,7 @@
2 sql.c 2 sql.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/sql.h b/src/sql.h
index c6cfa76..19ecbaf 100644
--- a/src/sql.h
+++ b/src/sql.h
@@ -2,7 +2,7 @@
2 sql.h 2 sql.h
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2004-2014 The Anubis Team. 5 Copyright (C) 2004-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/stream.c b/src/stream.c
index 3211aea..700937d 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -2,7 +2,7 @@
2 stream.c 2 stream.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2004-2014 The Anubis Team. 5 Copyright (C) 2004-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -53,7 +53,7 @@ _def_strerror (void *data, int rc)
53static int 53static int
54_def_write (void *sd, const char *data, size_t size, size_t * nbytes) 54_def_write (void *sd, const char *data, size_t size, size_t * nbytes)
55{ 55{
56 int rc = send ((int) sd, data, size, 0); 56 int rc = send ((int) (ptrdiff_t) sd, data, size, 0);
57 if (rc >= 0) 57 if (rc >= 0)
58 { 58 {
59 *nbytes = rc; 59 *nbytes = rc;
@@ -65,7 +65,7 @@ _def_write (void *sd, const char *data, size_t size, size_t * nbytes)
65static int 65static int
66_def_read (void *sd, char *data, size_t size, size_t * nbytes) 66_def_read (void *sd, char *data, size_t size, size_t * nbytes)
67{ 67{
68 int rc = recv ((int) sd, data, size, 0); 68 int rc = recv ((int) (ptrdiff_t) sd, data, size, 0);
69 if (rc >= 0) 69 if (rc >= 0)
70 { 70 {
71 *nbytes = rc; 71 *nbytes = rc;
@@ -77,7 +77,7 @@ _def_read (void *sd, char *data, size_t size, size_t * nbytes)
77static int 77static int
78_def_close (void *sd) 78_def_close (void *sd)
79{ 79{
80 close ((int) sd); 80 close ((int) (ptrdiff_t) sd);
81 return 0; 81 return 0;
82} 82}
83 83
diff --git a/src/tls.c b/src/tls.c
index 59f4742..eea85e5 100644
--- a/src/tls.c
+++ b/src/tls.c
@@ -2,7 +2,7 @@
2 tls.c 2 tls.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -288,7 +288,8 @@ start_ssl_server (NET_STREAM sd_client, int verbose)
288static void 288static void
289verify_certificate (gnutls_session_t session) 289verify_certificate (gnutls_session_t session)
290{ 290{
291 int status, rc; 291 int rc;
292 unsigned status;
292 293
293 rc = gnutls_certificate_verify_peers2 (session, &status); 294 rc = gnutls_certificate_verify_peers2 (session, &status);
294 if (rc) 295 if (rc)
diff --git a/src/transmode.c b/src/transmode.c
index 0cf12f4..715cf94 100644
--- a/src/transmode.c
+++ b/src/transmode.c
@@ -2,7 +2,7 @@
2 transmode.c 2 transmode.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/tunnel.c b/src/tunnel.c
index 71495cc..7f94292 100644
--- a/src/tunnel.c
+++ b/src/tunnel.c
@@ -2,7 +2,7 @@
2 tunnel.c 2 tunnel.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -40,8 +40,6 @@ get_ehlo_domain (void)
40{ 40{
41 return smtp_ehlo_domain_name ? smtp_ehlo_domain_name : get_localname (); 41 return smtp_ehlo_domain_name ? smtp_ehlo_domain_name : get_localname ();
42} 42}
43
44
45 43
46 44
47/* Collect and send headers */ 45/* Collect and send headers */
diff --git a/src/url.c b/src/url.c
index 825b344..b3f7914 100644
--- a/src/url.c
+++ b/src/url.c
@@ -2,7 +2,7 @@
2 url.c 2 url.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2003-2014 The Anubis Team. 5 Copyright (C) 2003-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/src/usr.opt b/src/usr.opt
index fa9d859..d11ceb6 100644
--- a/src/usr.opt
+++ b/src/usr.opt
@@ -1,6 +1,6 @@
1/* -*- c -*- 1/* -*- c -*-
2 This file is part of GNU Anubis. 2 This file is part of GNU Anubis.
3 Copyright (C) 2001-2014 The Anubis Team. 3 Copyright (C) 2001-2020 The Anubis Team.
4 4
5 GNU Anubis is free software; you can redistribute it and/or modify 5 GNU Anubis is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
diff --git a/src/xdatabase.c b/src/xdatabase.c
index 0ebb54a..ec51f31 100644
--- a/src/xdatabase.c
+++ b/src/xdatabase.c
@@ -2,7 +2,7 @@
2 xdatabase.c 2 xdatabase.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2004-2014 The Anubis Team. 5 Copyright (C) 2004-2020 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..d01dc9d
--- a/dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,8 @@
1atconfig
2atlocal
3package.m4
4testsuite
5testsuite.dir
6testsuite.log
7anustart
8mta
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..5687c53
--- a/dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,91 @@
1# This file is part of GNU Anubis.
2# Copyright (C) 2020 The Anubis Team.
3#
4# Anubis is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with anubis. If not, see <http://www.gnu.org/licenses/>.
16
17EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
18DISTCLEANFILES = atconfig $(check_SCRIPTS)
19MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
20
21## ------------ ##
22## package.m4. ##
23## ------------ ##
24
25$(srcdir)/package.m4: $(top_srcdir)/configure.ac
26 $(AM_V_GEN){ \
27 echo '# Signature of the current package.'; \
28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
30 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
31 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
32 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
33 } >$(srcdir)/package.m4
34
35#
36
37## ------------ ##
38## Test suite. ##
39## ------------ ##
40
41TESTSUITE_AT = \
42 anubisusr.at\
43 bmod.at\
44 cond.at\
45 empty.at\
46 badd.at\
47 fadd.at\
48 hadd00.at\
49 hadd01.at\
50 hadd02.at\
51 hdel00.at\
52 hdel01.at\
53 hdel02.at\
54 hdel03.at\
55 hmod.at\
56 gpgcrypt.at\
57 gpgsign.at\
58 gpgse.at\
59 mime00.at\
60 mime01.at\
61 mult.at\
62 no-backref.at\
63 parse.at\
64 paolo.at\
65 remailer.at\
66 rot-13.at\
67 testsuite.at\
68 tlsoneway.at\
69 trigger.at
70
71TESTSUITE = $(srcdir)/testsuite
72M4=m4
73
74AUTOTEST = $(AUTOM4TE) --language=autotest
75$(TESTSUITE): package.m4 $(TESTSUITE_AT)
76 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
77 $(AM_V_at)mv $@.tmp $@
78
79atconfig: $(top_builddir)/config.status
80 cd $(top_builddir) && ./config.status tests/$@
81
82clean-local:
83 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
84
85check-local: atconfig atlocal $(TESTSUITE)
86 @$(SHELL) $(TESTSUITE)
87
88noinst_PROGRAMS=anustart mta
89mta_LDADD = @LIBGNUTLS_LIBS@
90AM_CPPFLAGS = @LIBGNUTLS_INCLUDES@
91
diff --git a/tests/anubisusr.at b/tests/anubisusr.at
new file mode 100644
index 0000000..657ce97
--- a/dev/null
+++ b/tests/anubisusr.at
@@ -0,0 +1,131 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Configuration upload])
17AT_KEYWORDS([anubisusr xdb00 upload])
18
19AT_CHECK([
20ANUBIS_PREREQ_GPG(GSASL)
21
22# First upload:
23# user.rc is missing, we upload one.rc
24# anubisusr should return 0. one.rc and user.rc should be identical
25# after this test
26
27mkdir etc
28
29
30echo "anubis:guessme:$(id -un):$PWD/etc/user.rc" > etc/user.db
31
32AT_DATA([etc/net.rc],
33[machine localhost login anubis password guessme
34])
35
36AT_ANUBIS_CONFIG([anubis.rc],
37[BEGIN CONTROL
38mode auth
39local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
40termlevel debug
41logfile $PWD/etc/anubis.log
42loglevel all
43tracefile yes
44END
45
46BEGIN AUTH
47sasl-password-db text://$PWD/etc/user.db
48sasl-allowed-mech CRAM-MD5
49smtp-greeting-message "Hej, sloneczko"
50smtp-help-message "Czlowieku, dopomoz sobie sam!"
51END
52])
53
54AT_DATA([one.rc],
55[[BEGIN CONTROL
56logfile "anubis.log"
57remote-mta "localhost:25"
58END
59BEGIN RULE
60if command["mail from"] = ".*<?root@localhost>?"
61 STOP
62fi
63END
64]])
65
66anustart --relax-perm-check --altrc etc/anubis.rc -- \
67 /bin/sh -c 'anubisusr -v -d --netrc etc/net.rc --file one.rc localhost:$ANUBIS_PORT'
68],
69[0],
70[ignore],
71[ignore])
72
73AT_CHECK([
74cmp etc/user.rc one.rc
75])
76
77AT_CHECK([
78# Second upload:
79# We upload the same file, running anubisusr in verbose mode.
80# Its output should contain string "File NOT changed",
81# otherwise we declare test failure.
82
83anustart --relax-perm-check --altrc etc/anubis.rc -- \
84 /bin/sh -c 'anubisusr -v -d --netrc etc/net.rc --file one.rc localhost:$ANUBIS_PORT'
85],
86[0],
87[stdout],
88[stderr])
89
90AT_CHECK([
91grep -q "File NOT changed" stdout
92])
93
94AT_CHECK([
95# Third upload:
96# Upload two.rc. After this test user.rc and add.rc must be identical.
97
98AT_DATA([two.rc],
99[BEGIN CONTROL
100logfile "anubis.log"
101remote-mta "localhost:25"
102END
103
104BEGIN RULE
105
106if header[[X-Command]] = "Complete"
107 add body <<-EOT
108 Text text text
109 EOT
110fi
111
112remove [[X-Command]]
113END
114])
115
116anustart --relax-perm-check --altrc etc/anubis.rc -- \
117 /bin/sh -c 'anubisusr -v -d --netrc etc/net.rc --file two.rc localhost:$ANUBIS_PORT'
118],
119[0],
120[stdout],
121[ignore])
122
123AT_CHECK([
124grep -q "File changed" stdout
125])
126
127AT_CHECK([
128cmp etc/user.rc two.rc
129])
130
131AT_CLEANUP
diff --git a/tests/anustart.c b/tests/anustart.c
new file mode 100644
index 0000000..f213f70
--- a/dev/null
+++ b/tests/anustart.c
@@ -0,0 +1,372 @@
1/*
2 NAME
3 anustart - test anubis in daemon mode
4
5 SYNOPSIS
6 anustart ANU_OPTIONS -- COMMAND ARGS ...
7
8 DESCRIPTION
9 Starts two programs: anubis -S -b PORT with additional options from
10 ANU_OPTIONS, and COMMAND with ARGS. PORT is selected as the first
11 unused TCP port in range 1025-65535. Environment variable ANUBIS_PORT
12 is set to the selected value. When anubis is up and running, it sends
13 the SIGUSR1 to anustart, which then starts COMMAND with ARGS and waits
14 for it to terminate. Then, it shuts down anubis and exits with the exit
15 code from COMMAND. If anubis fails to respond within 5 seconds, or
16 COMMAND fails to terminate within that amount of time, both are killed
17 and anustart exits with code 3.
18
19 EXIT STATUS
20 0
21 Success.
22 1
23 Failure.
24 2
25 Command line usage error.
26 3
27 Timeout waiting for anubis to respond.
28 4
29 Anubis terminated prematurely.
30
31 Another value means error code from COMMAND.
32
33 LICENSE
34 This file is part of GNU Anubis testsuite.
35 Copyright (C) 2003-2020 The Anubis Team.
36
37 GNU Anubis is free software; you can redistribute it and/or modify it
38 under the terms of the GNU General Public License as published by the
39 Free Software Foundation; either version 3 of the License, or (at your
40 option) any later version.
41
42 GNU Anubis is distributed in the hope that it will be useful,
43 but WITHOUT ANY WARRANTY; without even the implied warranty of
44 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 GNU General Public License for more details.
46
47 You should have received a copy of the GNU General Public License along
48 with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
49 */
50#ifdef HAVE_CONFIG_H
51# include <config.h>
52#endif
53
54#include <sys/types.h>
55#include <sys/time.h>
56#include <sys/stat.h>
57#include <sys/socket.h>
58#include <sys/wait.h>
59#include <netinet/in.h>
60#include <stdlib.h>
61#include <stdio.h>
62#include <string.h>
63#include <unistd.h>
64#include <fcntl.h>
65#include <errno.h>
66#include <limits.h>
67
68char const *progname;
69
70/* Exit codes */
71enum
72 {
73 EX_OK = 0,
74 EX_ERROR = 1,
75 EX_USAGE = 2,
76 EX_TIMEOUT = 3,
77 EX_ANUTERM = 4
78 };
79
80
81static int
82open_socket (int *p_local_port, int max_port)
83{
84 int fd;
85 int true = 1;
86 struct sockaddr_in sin;
87 int local_port;
88
89 memset (&sin, 0, sizeof (sin));
90 sin.sin_family = AF_INET;
91 sin.sin_addr.s_addr = INADDR_ANY;
92
93 fd = socket (AF_INET, SOCK_STREAM, 0);
94 if (fd < 0)
95 {
96 fprintf (stderr, "%s: can't open socket: %d\n", progname, errno);
97 return -1;
98 }
99
100 setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &true, sizeof (true));
101
102 local_port = *p_local_port;
103 while (++local_port < max_port)
104 {
105 sin.sin_port = htons((unsigned short)local_port);
106 if (bind (fd, (struct sockaddr *)&sin, sizeof (sin)) == 0)
107 {
108 *p_local_port = local_port;
109 return fd;
110 }
111 }
112
113 fprintf (stderr, "%s: no free port\n", progname);
114 close (fd);
115 fd = -1;
116 return fd;
117}
118
119pid_t
120runcom (char *prog, char **argv, char *out, char *err)
121{
122 pid_t pid;
123 int fd_out, fd_err;
124
125 if (out)
126 {
127 fd_out = open (out, O_WRONLY|O_CREAT|O_TRUNC, 0666);
128 if (!fd_out)
129 {
130 fprintf (stderr, "%s: can't open %s: %s\n",
131 progname, out, strerror(errno));
132 exit (EX_ERROR);
133 }
134 }
135 else
136 fd_out = -1;
137 if (err)
138 {
139 fd_err = open (err, O_WRONLY|O_CREAT|O_TRUNC, 0666);
140 if (!fd_err)
141 {
142 fprintf (stderr, "%s: can't open %s: %s\n",
143 progname, err, strerror(errno));
144 exit (EX_ERROR);
145 }
146 }
147 else
148 fd_err = -1;
149
150 pid = fork ();
151 if (pid == -1)
152 {
153 perror ("fork");
154 exit (EX_ERROR);
155 }
156
157 if (pid > 0)
158 return pid;
159
160 /* Child */
161 switch (fd_out)
162 {
163 case -1:
164 case 1:
165 break;
166
167 default:
168 if (dup2 (fd_out, 1) == -1)
169 {
170 perror ("dup2");
171 exit (EX_ERROR);
172 }
173 close (fd_out);
174 }
175
176 switch (fd_err)
177 {
178 case -1:
179 case 1:
180 break;
181
182 default:
183 if (dup2 (fd_err, 2) == -1)
184 {
185 perror ("dup2");
186 exit (EX_ERROR);
187 }
188 close (fd_err);
189 }
190
191 execvp (prog ? prog : argv[0], argv);
192 perror (argv[0]);
193 _exit (127);
194}
195
196int volatile signum;
197
198void
199sighan (int sig)
200{
201 signum = sig;
202}
203
204int
205main (int argc, char **argv)
206{
207 int i, j;
208 int fd;
209 char **argv_buf;
210 char **anu_argv;
211 char **com_argv;
212 int local_port = 1024;
213 int max_port = USHRT_MAX;
214 struct sigaction act;
215 sigset_t sigs, oldsigs;
216 int timeout = 5;
217 enum
218 {
219 ASTATE_INITIAL,
220 ASTATE_RUNNING,
221 ASTATE_CHLDEXIT,
222 ASTATE_STOP
223 } state = ASTATE_INITIAL;
224 int exit_code;
225 pid_t anu_pid, com_pid;
226 char portbuf[sizeof("localhost:65535")];
227
228 progname = argv[0];
229
230 /* Split command line */
231 anu_argv = argv;
232
233 for (i = 0; i < argc; i++)
234 if (strcmp (argv[i], "--") == 0)
235 break;
236
237 if (i == argc)
238 {
239 fprintf (stderr, "%s: no command given\n", progname);
240 return EX_USAGE;
241 }
242
243 /*
244 * . 1 extra slots for the -S option in anubis command line.
245 * . 1 slot for the terminating NULL in the user command.
246 */
247 argv_buf = calloc (argc + 3, sizeof (argv_buf[0]));
248 argv_buf[0] = "anubis";
249 for (j = 1; j < i; j++)
250 argv_buf[j] = argv[j];
251 argv_buf[i++] = "-S";
252 argv_buf[i++] = NULL;
253
254 anu_argv = argv_buf;
255 com_argv = argv_buf + i;
256
257 /* Now, j points to "--" */
258 while (++j < argc)
259 {
260 argv_buf[i++] = argv[j];
261 }
262 argv_buf[i] = NULL;
263
264 fd = open_socket (&local_port, max_port);
265 if (fd == -1)
266 return EX_ERROR;
267
268 if (fd != 3)
269 {
270 if (dup2 (fd, 3))
271 {
272 fprintf (stderr, "%s: can't open socket at fd 3\n", progname);
273 return EX_ERROR;
274 }
275 }
276
277 snprintf (portbuf, sizeof (portbuf), "%d", local_port);
278 setenv ("ANUBIS_PORT", portbuf, 1);
279
280 /* Install signals */
281 act.sa_flags = 0;
282 sigemptyset (&act.sa_mask);
283 act.sa_handler = sighan;
284
285 sigaction (SIGCHLD, &act, NULL);
286 sigaction (SIGALRM, &act, NULL);
287 sigaction (SIGUSR1, &act, NULL);
288
289 sigemptyset (&sigs);
290 sigaddset (&sigs, SIGCHLD);
291 sigaddset (&sigs, SIGALRM);
292 sigaddset (&sigs, SIGUSR1);
293 sigprocmask (SIG_BLOCK, &sigs, &oldsigs);
294
295 anu_pid = runcom (anu_argv[0], anu_argv, NULL, NULL);
296
297 /* Set timeout */
298 alarm (timeout);
299
300 state = ASTATE_INITIAL;
301 while (state != ASTATE_STOP)
302 {
303 pid_t pid;
304 int status;
305
306 sigsuspend (&oldsigs);
307 switch (signum)
308 {
309 case SIGUSR1:
310 /* Start command */
311 com_pid = runcom (NULL, com_argv, NULL, NULL);
312 state = ASTATE_RUNNING;
313 break;
314
315 case SIGCHLD:
316 while ((pid = waitpid ((pid_t)-1, &status, WNOHANG)) > 0)
317 {
318 if (pid == anu_pid)
319 {
320 anu_pid = -1;
321 switch (state)
322 {
323 case ASTATE_INITIAL:
324 exit_code = EX_ANUTERM;
325 state = ASTATE_STOP;
326 break;
327
328 case ASTATE_RUNNING:
329 kill (com_pid, SIGTERM);
330 exit_code = EX_ANUTERM;
331 state = ASTATE_CHLDEXIT;
332 break;
333
334 case ASTATE_CHLDEXIT:
335 state = ASTATE_STOP;
336 break;
337
338 default:
339 abort ();
340 }
341 }
342 else if (pid == com_pid)
343 {
344 com_pid = -1;
345 switch (state)
346 {
347 case ASTATE_RUNNING:
348 kill (anu_pid, SIGTERM);
349 exit_code = WEXITSTATUS (status);
350 state = ASTATE_CHLDEXIT;
351 break;
352
353 case ASTATE_CHLDEXIT:
354 state = ASTATE_STOP;
355 break;
356
357 default:
358 abort ();
359 }
360 }
361 }
362 break;
363
364 case SIGALRM:
365 state = ASTATE_STOP;
366 exit_code = EX_TIMEOUT;
367 }
368 }
369
370 return exit_code;
371}
372
diff --git a/tests/atlocal.in b/tests/atlocal.in
new file mode 100644
index 0000000..1bfeff6
--- a/dev/null
+++ b/tests/atlocal.in
@@ -0,0 +1,14 @@
1# @configure_input@ -*- shell-script -*-
2# Configurable variable values for Anubis test suite.
3# Copyright (C) 2020 Free Software Foundation, Inc.
4
5PATH=@abs_top_builddir@/src:$top_srcdir:$srcdir:$PATH
6GPG=@GPG@
7CERTTOOL=@CERTTOOL@
8@TLS_COND_TRUE@GNUTLS_SED='s/%TLS%//'
9@TLS_COND_FALSE@GNUTLS_SED='/%TLS%/d'
10@GPG_COND_TRUE@GPG_SED='s/%GPG%//'
11@GPG_COND_FALSE@GPG_SED='/%GPG%/d'
12@GUILE_COND_TRUE@GUILE_SED='s/%GUILE%//'
13@GUILE_COND_FALSE@GUILE_SED='/%GUILE%/d'
14
diff --git a/tests/badd.at b/tests/badd.at
new file mode 100644
index 0000000..cb5290c
--- a/dev/null
+++ b/tests/badd.at
@@ -0,0 +1,82 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Append a text to the message body])
17AT_KEYWORDS([add body])
18
19AT_ANUBIS_CONFIG([anubis.rc],
20[BEGIN CONTROL
21logfile $PWD/etc/anubis.log
22local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
23END
24
25BEGIN RULE
26if header[[X-Command]] = "Complete"
27# NOTE: The text below up to and including EOT is indented with tabs.
28 add body <<-EOT
29 How cheerfully he seems to grin,
30 How neatly spread his claws,
31 And welcome little fishes in
32 With gently smiling jaws!
33 EOT
34fi
35
36remove [[X-Command]]
37END
38])
39
40AT_DATA([input],
41 [HELO localhost
42MAIL FROM:<gray@gnu.org>
43RCPT TO:<polak@gnu.org>
44DATA
45From: <gray@gnu.org>
46To: <polak@gnu.org>
47Subject: The Crocodile
48X-Command: Complete
49
50How doth the little crocodile
51Improve his shining tail,
52And pour the waters of the Nile
53On every golden scale!
54
55.
56QUIT
57])
58AT_CHECK([
59anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r'
60],
61[0],
62[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
63250 pleased to meet you
64250 Sender OK
65250 Recipient OK
66354 Enter mail, end with "." on a line by itself
67250 Mail accepted for delivery
68221 Done
69],
70[ignore])
71AT_CHECK([diff input etc/mta.log],
72[1],
73[8d7
74< X-Command: Complete
7514a14,17
76> How cheerfully he seems to grin,
77> How neatly spread his claws,
78> And welcome little fishes in
79> With gently smiling jaws!
80])
81AT_CLEANUP
82
diff --git a/tests/bmod.at b/tests/bmod.at
new file mode 100644
index 0000000..da8a532
--- a/dev/null
+++ b/tests/bmod.at
@@ -0,0 +1,84 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Modify the message body])
17AT_KEYWORDS([body modify])
18AT_ANUBIS_CONFIG([anubis.rc],
19[BEGIN CONTROL
20logfile $PWD/etc/anubis.log
21local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
22END
23
24BEGIN RULE
25modify body :re [["a very \(old\)"]] "the new"
26modify body :re [["Xanadu"]] "/users3"
27modify body :re [["\(Alph\)"]] "/bin"
28modify body :re [["caverns"]] "Test Suites"
29modify body :re [["\(sea\)"]] "C"
30---END---
31])
32AT_DATA([input],
33 [HELO localhost
34MAIL FROM:<gray@gnu.org>
35RCPT TO:<polak@gnu.org>
36DATA
37From: <gray@gnu.org>
38To: <polak@gnu.org>
39Subject: The Ancient Mariner Anew
40
41This is a very old text:
42
43In Xanadu did Kubla Khan
44A stately pleasure dome decree
45Where Alph, the sacred river ran
46Through caverns measureless to Man
47Down to a sunless sea.
48.
49QUIT
50])
51AT_DATA([expout],
52[HELO localhost
53MAIL FROM:<gray@gnu.org>
54RCPT TO:<polak@gnu.org>
55DATA
56From: <gray@gnu.org>
57To: <polak@gnu.org>
58Subject: The Ancient Mariner Anew
59
60This is the new text:
61
62In /users3 did Kubla Khan
63A stately pleasure dome decree
64Where /bin, the sacred river ran
65Through Test Suites measureless to Man
66Down to a sunless C.
67.
68QUIT
69])
70AT_CHECK([
71anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r'
72],
73[0],
74[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
75250 pleased to meet you
76250 Sender OK
77250 Recipient OK
78354 Enter mail, end with "." on a line by itself
79250 Mail accepted for delivery
80221 Done
81],
82[ignore])
83AT_CHECK([cat etc/mta.log],[0],[expout])
84AT_CLEANUP
diff --git a/tests/cond.at b/tests/cond.at
new file mode 100644
index 0000000..f0695df
--- a/dev/null
+++ b/tests/cond.at
@@ -0,0 +1,89 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([conditional statements])
17AT_KEYWORDS([cond])
18
19AT_ANUBIS_CONFIG([anubis.rc],
20[BEGIN CONTROL
21logfile $PWD/etc/anubis.log
22local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
23END
24
25BEGIN RULE
26add header[[X-Processed-By]] "Anubis"
27
28if header[[Subject]] "Be like water"
29 add header[[X-Comment1]] "Rule1 OK"
30fi
31
32if command[["mail from:"]] ".*<?.*@gnu\.org>?"
33 add header[[X-Comment2]] "Rule2 OK"
34fi
35
36if header[["mail from" ]] ".*<?.*@fsf\.org>?"
37 add header[[X-Comment]] "False"
38fi
39
40if command[["rcpt to:"]] ".*<?.*@fsf\.org>?"
41 add header[[X-Comment]] "False"
42else
43 add header[[X-Comment3]] "Rule3 OK"
44fi
45
46END
47])
48
49AT_DATA([input],
50 [HELO localhost
51MAIL FROM:<polak@gnu.org>
52RCPT TO:<gray@gnu.org>
53DATA
54From: <polak@gnu.org>
55To: <gray@gnu.org>
56Subject: Be like water
57
58"Empty your mind, be formless. Shapeless, like water.
59If you put water into a cup, it becomes the cup.
60You put water into a bottle and it becomes the bottle.
61You put it in a teapot it becomes the teapot.
62Now, water can flow or it can crash. Be water my friend."
63
64 -- Bruce Lee
65.
66QUIT
67])
68AT_CHECK([
69anubis --norc --relax-perm-check --altrc etc/anubis.rc --stdio < input | tr -d '\r'
70],
71[0],
72[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
73250 pleased to meet you
74250 Sender OK
75250 Recipient OK
76354 Enter mail, end with "." on a line by itself
77250 Mail accepted for delivery
78221 Done
79],
80[ignore])
81AT_CHECK([diff input etc/mta.log],
82[1],
83[7a8,11
84> X-Processed-By: Anubis
85> X-Comment1: Rule1 OK
86> X-Comment2: Rule2 OK
87> X-Comment3: Rule3 OK
88])
89AT_CLEANUP
diff --git a/tests/empty.at b/tests/empty.at
new file mode 100644
index 0000000..5e41ccc
--- a/dev/null
+++ b/tests/empty.at
@@ -0,0 +1,50 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Send a message unchanged])
17AT_KEYWORDS([send])
18AT_DATA([input],
19 [HELO localhost
20MAIL FROM:<gray@gnu.org>
21RCPT TO:<polak@gnu.org>
22DATA
23From: <gray@gnu.org>
24To: <polak@gnu.org>
25Subject: Testing unmodified message
26
27This message should go through Anubis unmodified.
28.
29QUIT
30])
31AT_ANUBIS_CONFIG([empty.rc],[
32BEGIN CONTROL
33logfile $PWD/etc/anubis.log
34local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
35END
36])
37AT_CHECK([
38anubis --norc --relax-perm-check --altrc etc/empty.rc --stdio < input | tr -d '\r'
39],
40[0],
41[220 localhost ([GNU Anubis v]AT_PACKAGE_VERSION) bitbucket ready
42250 pleased to meet you
43250 Sender OK
44250 Recipient OK
45354 Enter mail, end with "." on a line by itself
46250 Mail accepted for delivery
47221 Done
48],
49[ignore])
50AT_CLEANUP
diff --git a/tests/fadd.at b/tests/fadd.at
new file mode 100644
index 0000000..ef1764c
--- a/dev/null
+++ b/tests/fadd.at
@@ -0,0 +1,78 @@
1# This file is part of GNU Anubis testsuite. -*- autotest -*-
2# Copyright (C) 2003-2020 The Anubis Team.
3#
4# GNU Anubis is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 3 of the License, or (at your option)
7# any later version.
8#
9# GNU Anubis is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with GNU Anubis. If not, see <http://www.gnu.org/licenses/>.
16AT_SETUP([Add a text file to the message body])
17AT_KEYWORDS([add body file])
18
19AT_DATA([append.txt],
20[Behind the curtain, in the pantomime
21Hold the line, does anybody want to take it anymore
22The show must go on,
23The show must go on...
24])
25
26AT_ANUBIS_CONFIG([anubis.rc],
27[BEGIN CONTROL
28logfile $PWD/etc/anubis.log
29local-mta $abs_builddir/mta -bs -d $PWD/etc/mta.log
30END
31
32BEGIN RULE
33if header[[X-Order]] = "Append file"
34 body-append "$PWD/append.txt"
35fi
36remove [[X-Command]]
37END
38])
39
40AT_DATA([input],
41[HELO localhost
42MAIL FROM:<polak@gnu.org>
43RCPT TO:<gray@gnu.org>
44DATA
45From: <polak@gnu.org>
46To: <gray@gnu.org>
47Subject: The Show Must Go On
48X-Order: Append file
49
50Empty spaces -- what are we living for
51Abandoned places -- I guess we know the score
52On and on, does anybody know what we are looking for...