diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-11-19 13:38:36 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-11-19 13:38:36 +0000 |
commit | b1a3e134c1e3127cf3f31cdfa24d784858c9873d (patch) | |
tree | 1058a6d8b4a5e9a328ed5356ec94c69f0be72732 | |
parent | 4b9defbcfe01fb05acf9ecd74a683390d6110872 (diff) | |
download | mailfromd-b1a3e134c1e3127cf3f31cdfa24d784858c9873d.tar.gz mailfromd-b1a3e134c1e3127cf3f31cdfa24d784858c9873d.tar.bz2 |
* src/mu_dbm.c [WITH_GDBM]: do not bail out if the database does
not exist.
* src/mailfromd.h: Add argp.h
* src/bi_sa.m4: Minor fixes.
* src/main.c: Support for Mailutils CVS HEAD.
* configure.ac: Likewise.
git-svn-id: file:///svnroot/mailfromd/trunk@1527 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | src/bi_sa.m4 | 8 | ||||
-rw-r--r-- | src/mailfromd.h | 1 | ||||
-rw-r--r-- | src/main.c | 25 | ||||
-rw-r--r-- | src/mu_dbm.c | 5 |
6 files changed, 49 insertions, 24 deletions
@@ -1,3 +1,12 @@ | |||
1 | 2007-11-19 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * src/mu_dbm.c [WITH_GDBM]: do not bail out if the database does | ||
4 | not exist. | ||
5 | * src/mailfromd.h: Add argp.h | ||
6 | * src/bi_sa.m4: Minor fixes. | ||
7 | * src/main.c: Support for Mailutils CVS HEAD. | ||
8 | * configure.ac: Likewise. | ||
9 | |||
1 | 2007-11-11 Sergey Poznyakoff <gray@gnu.org.ua> | 10 | 2007-11-11 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 11 | ||
3 | * src/engine.c (check_on_host): Wait for an answer to QUIT. | 12 | * src/engine.c (check_on_host): Wait for an answer to QUIT. |
diff --git a/configure.ac b/configure.ac index e49a654a..d25011e1 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -94,24 +94,25 @@ AC_SUBST(MAILUTILS_VERSION) | |||
94 | AC_SUBST(MAILUTILS_INCLUDES) | 94 | AC_SUBST(MAILUTILS_INCLUDES) |
95 | AC_SUBST(MAILUTILS_LIBS) | 95 | AC_SUBST(MAILUTILS_LIBS) |
96 | MAILUTILS_VERSION=`$MU_CONFIG --info version|sed 's/VERSION=//'` | 96 | MAILUTILS_VERSION=`$MU_CONFIG --info version|sed 's/VERSION=//'` |
97 | VEX=`echo $MAILUTILS_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'` | ||
98 | MAILUTILS_VERSION_NUMBER=`eval expr "$VEX"` | ||
99 | AC_SUBST(MAILUTILS_VERSION_NUMBER) | ||
100 | AC_DEFINE_UNQUOTED(MAILUTILS_VERSION_NUMBER, $MAILUTILS_VERSION_NUMBER, | ||
101 | [Packed Mailutils version number]) | ||
97 | case $MAILUTILS_VERSION in | 102 | case $MAILUTILS_VERSION in |
98 | 0.*) AC_MSG_ERROR([Mailutils version too old; at least 1.0 is required]);; | 103 | 0.*) AC_MSG_ERROR([Mailutils version too old; at least 1.0 is required]);; |
99 | 1.1*) MAILUTILS_LIBS=`$MU_CONFIG --link auth`;; | 104 | 1.1|1.1.*) MAILUTILS_LIBS=`$MU_CONFIG --link auth`;; |
100 | *) MAILUTILS_LIBS=`$MU_CONFIG --link auth mailer`;; | 105 | 1.2|1.2.[[1-9]]) MAILUTILS_LIBS=`$MU_CONFIG --link auth mailer`;; |
106 | [[0-9]]*) MAILUTILS_LIBS=`$MU_CONFIG --link auth mailer cfg argp`;; | ||
107 | *) AC_MSG_ERROR([Unrecognized mailutils version: "$MAILUTILS_VERSION"]);; | ||
101 | esac | 108 | esac |
102 | MAILUTILS_INCLUDES=`$MU_CONFIG --compile` | 109 | MAILUTILS_INCLUDES=`$MU_CONFIG --compile` |
103 | 110 | ||
104 | save_LIBS=$LIBS | 111 | save_LIBS=$LIBS |
105 | LIBS="$LIBS $MAILUTILS_LIBS" | 112 | LIBS="$LIBS $MAILUTILS_LIBS" |
106 | AC_CHECK_FUNCS([argcv_unescape_char mu_get_auth]) | 113 | AC_CHECK_FUNCS([mu_get_auth]) |
107 | LIBS=$save_LIBS | 114 | LIBS=$save_LIBS |
108 | 115 | ||
109 | AH_BOTTOM([#ifndef HAVE_ARGCV_UNESCAPE_CHAR | ||
110 | # define argcv_unescape_char argcv_unquote_char | ||
111 | # define argcv_escape_char argcv_quote_char | ||
112 | #endif | ||
113 | ]) | ||
114 | |||
115 | ### Check for Emacs site-lisp directory | 116 | ### Check for Emacs site-lisp directory |
116 | AM_PATH_LISPDIR | 117 | AM_PATH_LISPDIR |
117 | 118 | ||
@@ -565,6 +566,7 @@ cat <<EOF | |||
565 | ******************************************************************* | 566 | ******************************************************************* |
566 | Mailfromd configured with the following settings: | 567 | Mailfromd configured with the following settings: |
567 | 568 | ||
569 | Mailutils version......................... $mu_version | ||
568 | External preprocessor..................... $ext_pp | 570 | External preprocessor..................... $ext_pp |
569 | DBM version............................... $status_dbm | 571 | DBM version............................... $status_dbm |
570 | Default user.............................. $user | 572 | Default user.............................. $user |
@@ -580,7 +582,8 @@ Documentation rendition type.............. $rendition | |||
580 | 582 | ||
581 | EOF | 583 | EOF |
582 | ], | 584 | ], |
583 | [if test -z "$DEFAULT_PREPROCESSOR"; then | 585 | [mu_version=$MAILUTILS_VERSION |
586 | if test -z "$DEFAULT_PREPROCESSOR"; then | ||
584 | ext_pp=no | 587 | ext_pp=no |
585 | else | 588 | else |
586 | ext_pp="$DEFAULT_PREPROCESSOR" | 589 | ext_pp="$DEFAULT_PREPROCESSOR" |
diff --git a/src/bi_sa.m4 b/src/bi_sa.m4 index 0ed7472b..3f14adbc 100644 --- a/src/bi_sa.m4 +++ b/src/bi_sa.m4 | |||
@@ -275,8 +275,8 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) | |||
275 | } else if (strcmp(buffer, "tcp") == 0) { | 275 | } else if (strcmp(buffer, "tcp") == 0) { |
276 | size_t size; | 276 | size_t size; |
277 | long n; | 277 | long n; |
278 | 278 | ||
279 | if (mu_url_get_port(url, &n)) { | 279 | if (rc = mu_url_get_port(url, &n)) { |
280 | mu_url_destroy(&url); | 280 | mu_url_destroy(&url); |
281 | MF_THROW(mf_url, | 281 | MF_THROW(mf_url, |
282 | _("%s: cannot get port: %s"), | 282 | _("%s: cannot get port: %s"), |
@@ -286,8 +286,8 @@ open_connection(eval_environ_t env, char *urlstr, int *isfile, char **phost) | |||
286 | if (n == 0 || (port = n) != n) { | 286 | if (n == 0 || (port = n) != n) { |
287 | mu_url_destroy(&url); | 287 | mu_url_destroy(&url); |
288 | MF_THROW(mf_range, | 288 | MF_THROW(mf_range, |
289 | _("Port out of range: %s"), | 289 | _("Port out of range: %ld"), |
290 | mu_strerror(rc)); | 290 | n); |
291 | } | 291 | } |
292 | 292 | ||
293 | if (rc = mu_url_get_host(url, NULL, 0, &size)) { | 293 | if (rc = mu_url_get_host(url, NULL, 0, &size)) { |
diff --git a/src/mailfromd.h b/src/mailfromd.h index faf96d25..97faceea 100644 --- a/src/mailfromd.h +++ b/src/mailfromd.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <mfapi.h> | 21 | #include <mfapi.h> |
22 | #include <dns.h> | 22 | #include <dns.h> |
23 | #include <xalloc.h> | 23 | #include <xalloc.h> |
24 | #include <argp.h> | ||
24 | 25 | ||
25 | /* Common error codes */ | 26 | /* Common error codes */ |
26 | #ifdef HAVE_SYSEXITS_H | 27 | #ifdef HAVE_SYSEXITS_H |
@@ -35,8 +35,11 @@ | |||
35 | #include <netdb.h> | 35 | #include <netdb.h> |
36 | 36 | ||
37 | #include <mailutils/mailutils.h> | 37 | #include <mailutils/mailutils.h> |
38 | #include <mailutils/argp.h> | 38 | #if MAILUTILS_VERSION_NUMBER < 1290 |
39 | 39 | # include <mailutils/argp.h> | |
40 | #else | ||
41 | # include <mailutils/libargp.h> | ||
42 | #endif | ||
40 | #include "mailfromd.h" | 43 | #include "mailfromd.h" |
41 | 44 | ||
42 | #include "syslog_async.h" | 45 | #include "syslog_async.h" |
@@ -404,7 +407,7 @@ set_mailfrom(void *value) | |||
404 | rc = mu_address_create(&addr, value); | 407 | rc = mu_address_create(&addr, value); |
405 | if (rc) { | 408 | if (rc) { |
406 | mu_error(_("Cannot create address `%s': %s"), | 409 | mu_error(_("Cannot create address `%s': %s"), |
407 | value, mu_strerror(rc)); | 410 | (char*)value, mu_strerror(rc)); |
408 | return; | 411 | return; |
409 | } | 412 | } |
410 | mu_address_destroy(&addr); | 413 | mu_address_destroy(&addr); |
@@ -1443,13 +1446,13 @@ switch_to_privs(uid_t uid, gid_t gid) | |||
1443 | #if defined(HAVE_SETREUID) | 1446 | #if defined(HAVE_SETREUID) |
1444 | if (geteuid() != uid) { | 1447 | if (geteuid() != uid) { |
1445 | if (setreuid(uid, -1) < 0) { | 1448 | if (setreuid(uid, -1) < 0) { |
1446 | mu_error(_("setreuid(%lu,-1) failed"), | 1449 | mu_error(_("setreuid(%lu,-1) failed: %s"), |
1447 | (unsigned long) uid, | 1450 | (unsigned long) uid, |
1448 | mu_strerror(errno)); | 1451 | mu_strerror(errno)); |
1449 | rc = 1; | 1452 | rc = 1; |
1450 | } | 1453 | } |
1451 | if (setuid(uid) < 0) { | 1454 | if (setuid(uid) < 0) { |
1452 | mu_error(_("second setuid(%lu) failed"), | 1455 | mu_error(_("second setuid(%lu) failed: %s"), |
1453 | (unsigned long) uid, | 1456 | (unsigned long) uid, |
1454 | mu_strerror(errno)); | 1457 | mu_strerror(errno)); |
1455 | rc = 1; | 1458 | rc = 1; |
@@ -1457,7 +1460,7 @@ switch_to_privs(uid_t uid, gid_t gid) | |||
1457 | } else | 1460 | } else |
1458 | #endif | 1461 | #endif |
1459 | { | 1462 | { |
1460 | mu_error(_("setuid(%lu) failed"), | 1463 | mu_error(_("setuid(%lu) failed: %s"), |
1461 | (unsigned long) uid, | 1464 | (unsigned long) uid, |
1462 | mu_strerror(errno)); | 1465 | mu_strerror(errno)); |
1463 | rc = 1; | 1466 | rc = 1; |
@@ -1756,6 +1759,7 @@ version(FILE *stream, struct argp_state *state) | |||
1756 | int | 1759 | int |
1757 | main(int argc, char **argv) | 1760 | main(int argc, char **argv) |
1758 | { | 1761 | { |
1762 | int rc; | ||
1759 | int index; | 1763 | int index; |
1760 | 1764 | ||
1761 | #ifdef ENABLE_NLS | 1765 | #ifdef ENABLE_NLS |
@@ -1782,8 +1786,15 @@ main(int argc, char **argv) | |||
1782 | db_format_setup(); | 1786 | db_format_setup(); |
1783 | include_path_setup(); | 1787 | include_path_setup(); |
1784 | save_cmdline(argc, argv); | 1788 | save_cmdline(argc, argv); |
1789 | |||
1785 | mu_argp_init(program_version, "<" PACKAGE_BUGREPORT ">"); | 1790 | mu_argp_init(program_version, "<" PACKAGE_BUGREPORT ">"); |
1786 | mu_argp_parse(&argp, &argc, &argv, 0, capa, &index, NULL); | 1791 | #if MAILUTILS_VERSION_NUMBER < 1290 |
1792 | rc = mu_argp_parse(&argp, &argc, &argv, 0, capa, &index, NULL); | ||
1793 | #else | ||
1794 | rc = mu_app_init(&argp, capa, NULL, argc, argv, 0, &index, NULL); | ||
1795 | #endif | ||
1796 | if (rc) | ||
1797 | exit (EX_CONFIG); | ||
1787 | 1798 | ||
1788 | log_setup(log_to_stderr); | 1799 | log_setup(log_to_stderr); |
1789 | 1800 | ||
diff --git a/src/mu_dbm.c b/src/mu_dbm.c index f736bc94..81656743 100644 --- a/src/mu_dbm.c +++ b/src/mu_dbm.c | |||
@@ -85,8 +85,9 @@ mu_dbm_open (char *name, DBM_FILE *db, int flags, int mode, int *ro) | |||
85 | int f; | 85 | int f; |
86 | size_t i; |