Commit c7c45e5b authored by Natanael Copa's avatar Natanael Copa

extra/postfix: support for dynamic maps: ldap mysql pcre pgsql

parent 1701a043
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.5.6
pkgrel=2
pkgrel=4
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
url="http://www.postfix.org/"
license="IPL-1"
depends="db pcre openssl"
makedepends="db-dev pcre-dev openssl-dev"
makedepends="db-dev pcre-dev openssl-dev postgresql-dev mysql-dev openldap-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc"
subpackages="$pkgname-doc $pkgname-ldap $pkgname-mysql $pkgname-pcre
$pkgname-pgsql"
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
$pkgname.initd
$install
postfix-2.5.5-dynamicmaps.patch
dynamicmaps.cf
postfix-ldap.post-install
postfix-mysql.post-install
postfix-pcre.post-install
postfix-pgsql.post-install
"
# the dynamic maps patch is taken from mandriva
# http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/postfix/current/SOURCES
build () {
cd "$srcdir/$pkgname-$pkgver"
for i in ../*.patch; do
msg "Applying $i..."
patch -p1 < $i || return 1
done
cp ../dynamicmaps.cf conf/
sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
-e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/postfix/aliases|" \
src/util/sys_defs.h || return 1
sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || return 1
# needed for dynamic maps.
local ccargs="-DHAS_DLOPEN -DHAS_SHL_LOAD"
local auxlibs="$LDFLAGS -lpthread -lcrypt"
# pcre
ccargs="$ccargs -DHAS_PCRE"
#auxlibs="$auxlibs -lpcre"
# ssl
ccargs="$ccargs -DUSE_TLS"
auxlibs="$auxlibs -lssl -lcrypto"
# dovecot-sasl
ccargs="$ccargs -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
# postgresql
ccargs="$ccargs -DHAS_PGSQL -I$(pg_config --includedir)"
#auxlibs="$auxlibs -lpq -L$(pg_config --libdir)"
# mysql
ccargs="$ccargs -DHAS_MYSQL $(mysql_config --include)"
#auxlibs="$auxlibs -lmysqlclient -lm -lz"
# compile
make DEBUG="" \
OPT="$CFLAGS" \
CCARGS="-DHAS_PCRE -DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" \
AUXLIBS="$LDFLAGS -lpcre -lcrypt -lpthread -lssl -lcrypto" \
CCARGS="$ccargs" \
AUXLIBS="$auxlibs" \
makefiles || return 1
make OPT="$CFLAGS" || return 1
sh postfix-install \
-non-interactive \
for i in lib/*.a; do
j=${i#lib/lib}
ln -s ${i#lib/} lib/libpostfix-${j%.a}.so.1
done
# install to pkgdir
LD_LIBRARY_PATH=$PWD/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} make \
non-interactive-package \
install_root="$pkgdir" \
config_directory=/usr/share/doc/$pkgname/defaults \
readme_directory=/usr/share/doc/$pkgname/readme \
manpage_directory=/usr/share/man \
|| return 1
install -d "$pkgdir"/usr/lib
for i in lib/*.a; do
j=${i#lib/lib}
install $i "$pkgdir"/usr/lib/libpostfix-${j%.a}.so.1 || return 1
done
# fix permissions
for i in postdrop postqueue; do
chgrp postdrop "$pkgdir"/usr/sbin/$i
chmod g+s "$pkgdir"/usr/sbin/$i
......@@ -51,7 +105,30 @@ build () {
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
}
_mv_dict() {
local m=$1
shift
pkgdesc="$m map support for postfix"
depends="postfix uclibc $@"
install="postfix-${m}.post-install"
mkdir -p "$subpkgdir"/usr/lib/postfix
mv "$pkgdir"/usr/libexec/postfix/dict_${m}.so \
"$subpkgdir"/usr/lib/postfix/
}
ldap() { _mv_dict ldap libldap; }
mysql() { _mv_dict mysql libmysqlclient;}
pcre() { _mv_dict pcre pcre; }
pgsql() { _mv_dict pgsql libpq; }
md5sums="ec2cb63b53f5f36c3ca91da8f3bc9407 postfix-2.5.6.tar.gz
8416354d402f3be288fa98b60af86240 postfix.initd
2bfc3864183694e5484ac073bb0cb7ef postfix.pre-install
0064d45c2c8a46c374b55c4abc46cfb2 postfix.post-install"
0064d45c2c8a46c374b55c4abc46cfb2 postfix.post-install
e71b0c501150cba4d30aef52a6fb542c postfix-2.5.5-dynamicmaps.patch
0efff9b4bb493ad2ff0b9915cb244d14 dynamicmaps.cf
2ebe51a882eb9d6d7866583eb6af3969 postfix-ldap.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-mysql.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-pcre.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-pgsql.post-install"
# Postfix dynamic maps configuration file.
#
# The first match found is the one that is used. Wildcards are not
# supported.
#
#type location of .so file name of open function
#==== ============================= =====================
#ldap /usr/lib/postfix/dict_ldap.so dict_ldap_open
#mysql /usr/lib/postfix/dict_mysql.so dict_mysql_open
#pcre /usr/lib/postfix/dict_pcre.so dict_pcre_open
#pgsq /usr/lib/postfix/dict_pgsql.so dict_pgsql_open
# apk tools will manage the lines below
## AUTO BEGIN ##
## AUTO END ##
This patch is taken from mandriva:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/postfix/current/SOURCES/
diff -Naurp postfix-2.5.5/conf/postfix-files postfix-2.5.5.oden/conf/postfix-files
--- postfix-2.5.5/conf/postfix-files 2008-01-24 01:13:49.000000000 +0100
+++ postfix-2.5.5.oden/conf/postfix-files 2008-12-17 18:17:11.000000000 +0100
@@ -64,6 +64,10 @@ $queue_directory/saved:d:$mail_owner:-:7
$queue_directory/trace:d:$mail_owner:-:700:ucr
$daemon_directory/anvil:f:root:-:755
$daemon_directory/bounce:f:root:-:755
+$daemon_directory/dict_ldap.so:f:root:-:755
+$daemon_directory/dict_pcre.so:f:root:-:755
+$daemon_directory/dict_mysql.so:f:root:-:755
+$daemon_directory/dict_pgsql.so:f:root:-:755
$daemon_directory/cleanup:f:root:-:755
$daemon_directory/discard:f:root:-:755
$daemon_directory/error:f:root:-:755
@@ -86,6 +90,11 @@ $daemon_directory/tlsmgr:f:root:-:755
$daemon_directory/trivial-rewrite:f:root:-:755
$daemon_directory/verify:f:root:-:755
$daemon_directory/virtual:f:root:-:755
+/usr/lib/libpostfix-dns.so.1:f:root:-:755
+/usr/lib/libpostfix-global.so.1:f:root:-:755
+/usr/lib/libpostfix-tls.so.1:f:root:-:755
+/usr/lib/libpostfix-master.so.1:f:root:-:755
+/usr/lib/libpostfix-util.so.1:f:root:-:755
$daemon_directory/nqmgr:h:$daemon_directory/qmgr
$daemon_directory/lmtp:h:$daemon_directory/smtp
$command_directory/postalias:f:root:-:755
@@ -108,6 +117,7 @@ $config_directory/access:f:root:-:644:p
$config_directory/aliases:f:root:-:644:p
$config_directory/bounce.cf.default:f:root:-:644
$config_directory/canonical:f:root:-:644:p
+$config_directory/dynamicmaps.cf:f:root:-:644:p
$config_directory/cidr_table:f:root:-:644:o
$config_directory/generic:f:root:-:644:p
$config_directory/generics:f:root:-:644:o
diff -Naurp postfix-2.5.5/src/dns/Makefile.in postfix-2.5.5.oden/src/dns/Makefile.in
--- postfix-2.5.5/src/dns/Makefile.in 2007-03-17 18:51:37.000000000 +0100
+++ postfix-2.5.5.oden/src/dns/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -14,7 +14,7 @@ LIBS = ../../lib/libutil.a
LIB_DIR = ../../lib
INC_DIR = ../../include
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
all: $(LIB)
@@ -31,12 +31,10 @@ tests: test dns_rr_to_pa_test dns_rr_to_
root_tests:
$(LIB): $(OBJS)
- $(AR) $(ARFL) $(LIB) $?
- $(RANLIB) $(LIB)
+ gcc -shared -Wl,-soname,libpostfix-dns.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS)
$(LIB_DIR)/$(LIB): $(LIB)
cp $(LIB) $(LIB_DIR)
- $(RANLIB) $(LIB_DIR)/$(LIB)
update: $(LIB_DIR)/$(LIB) $(HDRS)
-for i in $(HDRS); \
diff -Naurp postfix-2.5.5/src/global/Makefile.in postfix-2.5.5.oden/src/global/Makefile.in
--- postfix-2.5.5/src/global/Makefile.in 2007-12-06 14:49:03.000000000 +0100
+++ postfix-2.5.5.oden/src/global/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -33,7 +33,7 @@ OBJS = abounce.o anvil_clnt.o been_here.
canon_addr.o cfg_parser.o cleanup_strerror.o cleanup_strflags.o \
clnt_stream.o conv_time.o db_common.o debug_peer.o debug_process.o \
defer.o deliver_completed.o deliver_flock.o deliver_pass.o \
- deliver_request.o dict_ldap.o dict_mysql.o dict_pgsql.o \
+ deliver_request.o \
dict_proxy.o domain_list.o dot_lockfile.o dot_lockfile_as.o \
dsb_scan.o dsn.o dsn_buf.o dsn_mask.o dsn_print.o dsn_util.o \
ehlo_mask.o ext_prop.o file_id.o flush_clnt.o header_opts.o \
@@ -101,10 +101,13 @@ LIBS = ../../lib/libutil.a
LIB_DIR = ../../lib
INC_DIR = ../../include
MAKES =
+LDAPSO = dict_ldap.so
+MYSQLSO = dict_mysql.so
+PGSQLSO = dict_pgsql.so
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
-all: $(LIB)
+all: $(LIB) $(LDAPSO) $(MYSQLSO) $(PGSQLSO)
$(OBJS): ../../conf/makedefs.out
@@ -114,14 +117,30 @@ Makefile: Makefile.in
test: $(TESTPROG)
$(LIB): $(OBJS)
- $(AR) $(ARFL) $(LIB) $?
- $(RANLIB) $(LIB)
+ gcc -shared -Wl,-soname,libpostfix-global.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS)
+
+$(LDAPSO): dict_ldap.o $(LIB)
+ gcc -shared -Wl,-soname,dict_ldap.so -o $@ $? -lldap -llber -L../../lib -lutil -L. -lglobal
+
+$(MYSQLSO): dict_mysql.o $(LIB)
+ gcc -shared -Wl,-soname,dict_mysql.so -o $@ $? -lmysqlclient -L. -lutil -lglobal
+
+$(PGSQLSO): dict_pgsql.o $(LIB)
+ gcc -shared -Wl,-soname,dict_pgsql.so -o $@ $? -lpq -L. -lutil -lglobal
$(LIB_DIR)/$(LIB): $(LIB)
cp $(LIB) $(LIB_DIR)
- $(RANLIB) $(LIB_DIR)/$(LIB)
-update: $(LIB_DIR)/$(LIB) $(HDRS)
+../../libexec/$(LDAPSO): $(LDAPSO)
+ cp $(LDAPSO) ../../libexec
+
+../../libexec/$(MYSQLSO): $(MYSQLSO)
+ cp $(MYSQLSO) ../../libexec
+
+../../libexec/$(PGSQLSO): $(PGSQLSO)
+ cp $(PGSQLSO) ../../libexec
+
+update: $(LIB_DIR)/$(LIB) ../../libexec/$(LDAPSO) ../../libexec/$(MYSQLSO) ../../libexec/$(PGSQLSO) $(HDRS)
-for i in $(HDRS); \
do \
cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
@@ -489,7 +508,7 @@ lint:
lint $(DEFS) $(SRCS) $(LINTFIX)
clean:
- rm -f *.o $(LIB) *core $(TESTPROG) junk
+ rm -f *.o $(LIB) $(LDAPSO) $(MYSQLSO) $(PGSQLSO) *core $(TESTPROG) junk
rm -rf printfck
tidy: clean
diff -Naurp postfix-2.5.5/src/global/mail_conf.c postfix-2.5.5.oden/src/global/mail_conf.c
--- postfix-2.5.5/src/global/mail_conf.c 2004-04-10 16:52:51.000000000 +0200
+++ postfix-2.5.5.oden/src/global/mail_conf.c 2008-12-17 18:17:11.000000000 +0100
@@ -175,6 +175,13 @@ void mail_conf_suck(void)
path = concatenate(var_config_dir, "/", "main.cf", (char *) 0);
dict_load_file(CONFIG_DICT, path);
myfree(path);
+
+#ifndef NO_DYNAMIC_MAPS
+ path = concatenate(var_config_dir, "/", "dynamicmaps.cf", (char *) 0);
+ dict_open_dlinfo(path);
+ myfree(path);
+#endif
+
}
/* mail_conf_eval - expand macros in string */
diff -Naurp postfix-2.5.5/src/global/mail_dict.c postfix-2.5.5.oden/src/global/mail_dict.c
--- postfix-2.5.5/src/global/mail_dict.c 2008-01-08 22:07:47.000000000 +0100
+++ postfix-2.5.5.oden/src/global/mail_dict.c 2008-12-17 18:17:11.000000000 +0100
@@ -45,6 +45,7 @@ typedef struct {
static const DICT_OPEN_INFO dict_open_info[] = {
DICT_TYPE_PROXY, dict_proxy_open,
+#ifdef NO_DYNAMIC_MAPS
#ifdef HAS_LDAP
DICT_TYPE_LDAP, dict_ldap_open,
#endif
@@ -54,6 +55,7 @@ static const DICT_OPEN_INFO dict_open_in
#ifdef HAS_PGSQL
DICT_TYPE_PGSQL, dict_pgsql_open,
#endif
+#endif /* NO_DYNAMIC_MAPS */
0,
};
diff -Naurp postfix-2.5.5/src/global/mail_params.c postfix-2.5.5.oden/src/global/mail_params.c
--- postfix-2.5.5/src/global/mail_params.c 2008-01-08 21:35:08.000000000 +0100
+++ postfix-2.5.5.oden/src/global/mail_params.c 2008-12-17 18:17:11.000000000 +0100
@@ -78,6 +78,7 @@
/* char *var_export_environ;
/* char *var_debug_peer_list;
/* int var_debug_peer_level;
+/* int var_command_maxtime;
/* int var_in_flow_delay;
/* int var_fault_inj_code;
/* char *var_bounce_service;
@@ -254,6 +255,7 @@ char *var_import_environ;
char *var_export_environ;
char *var_debug_peer_list;
int var_debug_peer_level;
+int var_command_maxtime;
int var_fault_inj_code;
char *var_bounce_service;
char *var_cleanup_service;
@@ -265,6 +267,7 @@ char *var_showq_service;
char *var_error_service;
char *var_flush_service;
char *var_verify_service;
+char *var_scache_service;
char *var_trace_service;
int var_db_create_buf;
int var_db_read_buf;
diff -Naurp postfix-2.5.5/src/global/mkmap_open.c postfix-2.5.5.oden/src/global/mkmap_open.c
--- postfix-2.5.5/src/global/mkmap_open.c 2008-01-08 23:08:45.000000000 +0100
+++ postfix-2.5.5.oden/src/global/mkmap_open.c 2008-12-17 18:17:11.000000000 +0100
@@ -81,7 +81,7 @@
* We use a different table (in dict_open.c) when querying maps.
*/
typedef struct {
- char *type;
+ const char *type;
MKMAP *(*before_open) (const char *);
} MKMAP_OPEN_INFO;
@@ -156,7 +156,16 @@ MKMAP *mkmap_open(const char *type, con
*/
for (mp = mkmap_types; /* void */ ; mp++) {
if (mp->type == 0)
+#ifndef NO_DYNAMIC_MAPS
+ {
+ static MKMAP_OPEN_INFO oi;
+ oi.before_open=(MKMAP*(*)(const char*))dict_mkmap_func(type);
+ oi.type=type;
+ mp=&oi;
+ }
+#else
msg_fatal("unsupported map type: %s", type);
+#endif
if (strcmp(type, mp->type) == 0)
break;
}
diff -Naurp postfix-2.5.5/src/master/Makefile.in postfix-2.5.5.oden/src/master/Makefile.in
--- postfix-2.5.5/src/master/Makefile.in 2007-09-03 19:51:46.000000000 +0200
+++ postfix-2.5.5.oden/src/master/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -20,7 +20,7 @@ LIB_DIR = ../../lib
INC_DIR = ../../include
BIN_DIR = ../../libexec
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) `for i in $(LIB_OBJ); do [ $$i = $@ ] && echo -fPIC; done` $(CFLAGS) -c $*.c
all: $(PROG) $(LIB)
@@ -39,12 +39,10 @@ tests:
root_tests:
$(LIB): $(LIB_OBJ)
- $(AR) $(ARFL) $(LIB) $?
- $(RANLIB) $(LIB)
+ gcc -shared -Wl,-soname,libpostfix-master.so.1 -o $(LIB) $(LIB_OBJ) $(LIBS) $(SYSLIBS)
$(LIB_DIR)/$(LIB): $(LIB)
cp $(LIB) $(LIB_DIR)/$(LIB)
- $(RANLIB) $(LIB_DIR)/$(LIB)
$(BIN_DIR)/$(PROG): $(PROG)
cp $(PROG) $(BIN_DIR)
diff -Naurp postfix-2.5.5/src/milter/Makefile.in postfix-2.5.5.oden/src/milter/Makefile.in
--- postfix-2.5.5/src/milter/Makefile.in 2007-12-23 22:22:58.000000000 +0100
+++ postfix-2.5.5.oden/src/milter/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -14,7 +14,7 @@ LIB_DIR = ../../lib
INC_DIR = ../../include
MAKES =
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
all: $(LIB)
@@ -30,12 +30,10 @@ tests:
root_tests:
$(LIB): $(OBJS)
- $(AR) $(ARFL) $(LIB) $?
- $(RANLIB) $(LIB)
+ gcc -shared -Wl,-soname,libpostfix-milter.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS)
$(LIB_DIR)/$(LIB): $(LIB)
cp $(LIB) $(LIB_DIR)
- $(RANLIB) $(LIB_DIR)/$(LIB)
update: $(LIB_DIR)/$(LIB) $(HDRS)
-for i in $(HDRS); \
diff -Naurp postfix-2.5.5/src/postconf/postconf.c postfix-2.5.5.oden/src/postconf/postconf.c
--- postfix-2.5.5/src/postconf/postconf.c 2008-01-08 21:48:38.000000000 +0100
+++ postfix-2.5.5.oden/src/postconf/postconf.c 2008-12-17 18:17:11.000000000 +0100
@@ -893,6 +893,16 @@ static void show_maps(void)
{
ARGV *maps_argv;
int i;
+#ifndef NO_DYNAMIC_MAPS
+ char *path;
+ char *config_dir;
+
+ var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ?
+ config_dir : DEF_CONFIG_DIR); /* XXX */
+ path = concatenate(var_config_dir, "/", "dynamicmaps.cf", (char *) 0);
+ dict_open_dlinfo(path);
+ myfree(path);
+#endif
maps_argv = dict_mapnames();
for (i = 0; i < maps_argv->argc; i++)
diff -Naurp postfix-2.5.5/src/postmap/postmap.c postfix-2.5.5.oden/src/postmap/postmap.c
--- postfix-2.5.5/src/postmap/postmap.c 2007-12-04 17:25:13.000000000 +0100
+++ postfix-2.5.5.oden/src/postmap/postmap.c 2008-12-17 18:17:11.000000000 +0100
@@ -5,7 +5,7 @@
/* Postfix lookup table management
/* SYNOPSIS
/* .fi
-/* \fBpostmap\fR [\fB-Nfinoprsvw\fR] [\fB-c \fIconfig_dir\fR]
+/* \fBpostmap\fR [\fB-Nfinoprsuvw\fR] [\fB-c \fIconfig_dir\fR]
/* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR]
/* [\fIfile_type\fR:]\fIfile_name\fR ...
/* DESCRIPTION
@@ -115,6 +115,8 @@
/* as the original input order.
/* This feature is available in Postfix version 2.2 and later,
/* and is not available for all database types.
+/* .IP \fB-u\fR
+/* Upgrade the database to the current version.
/* .IP \fB-v\fR
/* Enable verbose logging for debugging purposes. Multiple \fB-v\fR
/* options make the software increasingly verbose.
@@ -555,6 +557,18 @@ static void postmap_seq(const char *map_
dict_close(dict);
}
+/* postmap_upgrade - upgrade a map */
+
+static int postmap_upgrade(const char *map_type, const char *map_name)
+{
+ DICT *dict;
+
+ dict = dict_open3(map_type, map_name, O_RDWR,
+ DICT_FLAG_LOCK|DICT_FLAG_UPGRADE);
+ dict_close(dict);
+ return (dict != 0);
+}
+
/* usage - explain */
static NORETURN usage(char *myname)
@@ -575,6 +589,7 @@ int main(int argc, char **argv)
int postmap_flags = POSTMAP_FLAG_AS_OWNER | POSTMAP_FLAG_SAVE_PERM;
int open_flags = O_RDWR | O_CREAT | O_TRUNC;
int dict_flags = DICT_FLAG_DUP_WARN | DICT_FLAG_FOLD_FIX;
+ int upgrade = 0;
char *query = 0;
char *delkey = 0;
int sequence = 0;
@@ -619,7 +634,7 @@ int main(int argc, char **argv)
/*
* Parse JCL.
*/
- while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rsvw")) > 0) {
+ while ((ch = GETOPT(argc, argv, "Nc:d:finopq:rsuvw")) > 0) {
switch (ch) {
default:
usage(argv[0]);
@@ -633,8 +648,8 @@ int main(int argc, char **argv)
msg_fatal("out of memory");
break;
case 'd':
- if (sequence || query || delkey)
- msg_fatal("specify only one of -s -q or -d");
+ if (sequence || query || delkey || upgrade)
+ msg_fatal("specify only one of -s -q -u or -d");
delkey = optarg;
break;
case 'f':
@@ -654,8 +669,8 @@ int main(int argc, char **argv)
postmap_flags &= ~POSTMAP_FLAG_SAVE_PERM;
break;
case 'q':
- if (sequence || query || delkey)
- msg_fatal("specify only one of -s -q or -d");
+ if (sequence || query || delkey || upgrade)
+ msg_fatal("specify only one of -s -q -u or -d");
query = optarg;
break;
case 'r':
@@ -663,10 +678,15 @@ int main(int argc, char **argv)
dict_flags |= DICT_FLAG_DUP_REPLACE;
break;
case 's':
- if (query || delkey)
- msg_fatal("specify only one of -s or -q or -d");
+ if (query || delkey || upgrade)
+ msg_fatal("specify only one of -s or -q -u or -d");
sequence = 1;
break;
+ case 'u':
+ if (sequence || query || delkey || upgrade)
+ msg_fatal("specify only one of -s -q -u or -d");
+ upgrade=1;
+ break;
case 'v':
msg_verbose++;
break;
@@ -734,6 +754,21 @@ int main(int argc, char **argv)
exit(0);
}
exit(1);
+ } else if (upgrade) { /* Upgrade the map(s) */
+ int success = 1;
+ if (optind + 1 > argc)
+ usage(argv[0]);
+ while (optind < argc) {
+ if ((path_name = split_at(argv[optind], ':')) != 0) {
+ success &= postmap_upgrade(argv[optind], path_name);
+ } else {
+ success &= postmap_upgrade(var_db_type, path_name);
+ }
+ if (!success)
+ exit(1);
+ optind++;
+ }
+ exit(0);
} else { /* create/update map(s) */
if (optind + 1 > argc)
usage(argv[0]);
diff -Naurp postfix-2.5.5/src/tls/Makefile.in postfix-2.5.5.oden/src/tls/Makefile.in
--- postfix-2.5.5/src/tls/Makefile.in 2008-01-08 02:42:47.000000000 +0100
+++ postfix-2.5.5.oden/src/tls/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -22,7 +22,7 @@ LIB_DIR = ../../lib
INC_DIR = ../../include
MAKES =
-.c.o:; $(CC) $(CFLAGS) -c $*.c
+.c.o:; $(CC) -fPIC $(CFLAGS) -c $*.c
all: $(LIB)
@@ -38,12 +38,10 @@ tests:
root_tests:
$(LIB): $(OBJS)
- $(AR) $(ARFL) $(LIB) $?
- $(RANLIB) $(LIB)
+ gcc -shared -Wl,-soname,libpostfix-tls.so.1 -o $(LIB) $(OBJS) $(LIBS) $(SYSLIBS)
$(LIB_DIR)/$(LIB): $(LIB)
cp $(LIB) $(LIB_DIR)
- $(RANLIB) $(LIB_DIR)/$(LIB)
update: $(LIB_DIR)/$(LIB) $(HDRS)
-for i in $(HDRS); \
diff -Naurp postfix-2.5.5/src/util/Makefile.in postfix-2.5.5.oden/src/util/Makefile.in
--- postfix-2.5.5/src/util/Makefile.in 2008-01-07 17:22:02.000000000 +0100
+++ postfix-2.5.5.oden/src/util/Makefile.in 2008-12-17 18:17:11.000000000 +0100
@@ -31,21 +31,21 @@ SRCS = alldig.c allprint.c argv.c argv_s
vstream_popen.c vstring.c vstring_vstream.c watchdog.c writable.c \
write_buf.c write_wait.c sane_basename.c format_tv.c allspace.c \
allascii.c load_file.c killme_after.c vstream_tweak.c upass_connect.c \
- upass_listen.c upass_trigger.c
+ upass_listen.c upass_trigger.c load_lib.c
OBJS = alldig.o allprint.o argv.o argv_split.o attr_clnt.o attr_print0.o \
attr_print64.o attr_print_plain.o attr_scan0.o attr_scan64.o \
attr_scan_plain.o auto_clnt.o base64_code.o basename.o binhash.o \
chroot_uid.o cidr_match.o clean_env.o close_on_exec.o concatenate.o \
ctable.o dict.o dict_alloc.o dict_cdb.o dict_cidr.o dict_db.o \
dict_dbm.o dict_debug.o dict_env.o dict_ht.o dict_ni.o dict_nis.o \
- dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_sdbm.o \
- dict_static.o dict_tcp.o dict_unix.o dir_forest.o doze.o dummy_read.o \
+ dict_nisplus.o dict_open.o dict_regexp.o \
+ dict_static.o dict_unix.o dir_forest.o doze.o dummy_read.o \
dummy_write.o duplex_pipe.o environ.o events.o exec_command.o \
fifo_listen.o fifo_trigger.o file_limit.o find_inet.o fsspace.o \
fullname.o get_domainname.o get_hostname.o hex_code.o hex_quote.o \
host_port.o htable.o inet_addr_host.o inet_addr_list.o \
inet_addr_local.o inet_connect.o inet_listen.o inet_proto.o \
- inet_trigger.o line_wrap.o lowercase.o lstat_as.o mac_expand.o \
+ inet_trigger.o line_wrap.o lowercase.o lstat_as.o mac_expand.o load_lib.o \
mac_parse.o make_dirs.o mask_addr.o match_list.o match_ops.o msg.o \
msg_output.o msg_syslog.o msg_vstream.o mvect.o myaddrinfo.o myflock.o \
mymalloc.o myrand.o mystrtok.o name_code.o name_mask.o netstring.o \
@@ -78,7 +78,7 @@ HDRS = argv.h attr.h attr_clnt.h auto_cl
msg_output.h msg_syslog.h msg_vstream.h mvect.h myaddrinfo.h myflock.h \
mymalloc.h myrand.h name_code.h name_mask.h netstring.h nvtable.h \
open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \
- safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h \
+ safe.h safe_open.h sane_accept.h sane_connect.h sane_fsops.h load_lib.h \
sane_socketpair.h sane_time.h scan_dir.h set_eugid.h set_ugid.h \
sigdelay.h sock_addr.h spawn_command.h split_at.h stat_as.h \
stringops.h sys_defs.h timed_connect.h timed_wait.h trigger.h \
@@ -90,6 +90,7 @@ DEFS = -I. -D$(SYSTYPE)
CFLAGS = $(DEBUG) $(OPT) $(DEFS)