Bugfix? Avoid surprises with source routed destinations
and OK entries in SMTPD access maps. File: smtpd/smtpd_access.c.
- Security: "postfix check" now looks for common stupidity
- such as "chown -R postfix /var/spool/postfix" which makes
- chrooted Postfix less secure than non-chrooted. These extra
- tests are bound to raise a stink with third-party patches
- such as TLS that introduce their own files into the jail.
+ Security: "postfix check" looks for damage by well-intended
+ but misguided use of "chown -R postfix /var/spool/postfix".
+ That would make chrooted Postfix less secure than non-chrooted
+ Postfix. These extra tests may cause complaints with
+ third-party patches such as TLS that introduce their own
+ files into the jail.
-Open problems:
+ Feature: disable the PIX workaround for mail that is queued
+ for less than $minimal_backoff_time seconds.
+
+ Feature: static map type that always returns the map name
+ as lookup value, regardless of lookup key value. Contributed
+ Jeff Miller (jeffm at ghostgun.com)
- Low: log queue ID when enabling PIX workaround.
+Open problems:
- Low: disable PIX workaround for mail < configurable age.
+ Low: after reorganizing configuration parameters, add flags
+ to all parameters whose value can be read from file.
Low: replace null sender address internal representation
by <> so that it can be looked up reliably in maps. Must
This code was created by Andrew McNamara <andrew@connect.com.au>
-and adapted to snapshot 20001121 by Xavier Beaudouin. It was merged
+and adapted to snapshot 50001121 by Xavier Beaudouin. It was merged
with mainstream Postfix for 20010128 by Wietse.
Purpose of this software
For security reasons, regexp maps are not allowed here, because
their $1 etc. substitutions would open a security hole.
+ Specify a static map if all mailboxes should be owned by the same
+ UID. For example, to specify that all mailboxes are owned by the
+ UID 5000, specify:
+
+ virtual_uid_maps = static:5000
+
virtual_gid_maps
Recipients are looked up in this map to determine the GID (group
For security reasons, regexp maps are not allowed here, because
their $1 etc. substitutions would open a security hole.
+ Specify a static map if all mailboxes should be owned by the same
+ GID. For example, to specify that all mailboxes are owned by the
+ GID 5000, specify:
+
+ virtual_gid_maps = static:5000
+
virtual_mailbox_lock
This setting is ignored in case of maildir delivery.
In this example, the default Postfix local delivery agent handles
the mail for non-virtual recipients; the virtual delivery agent
-handles virtual recipients.
+handles virtual recipients, and all virtual mailboxes are owned
+by user ID 5000, group ID 5000.
Instead of "hash" specify "dbm" or "btree", depending on your system
type. The command "postconf -m" displays possible lookup table
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
- virtual_uid_maps = hash:/etc/postfix/vuid
- virtual_gid_maps = hash:/etc/postfix/vgid
+ virtual_uid_maps = static:5000
+ virtual_gid_maps = static:5000
transport_maps = hash:/etc/postfix/transport
# All domains that have final delivery on this machine
test1@virtual1.domain test1
test2@virtual2.domain test2/
- /etc/postfix/vuid:
- test1@virtual1.domain 5001
- test2@virtual2.domain 5002
-
- /etc/postfix/vgid:
- test1@virtual1.domain 5001
- test2@virtual2.domain 5002
-
Execute something like the following commands for each mailbox recipient:
# touch /var/mail/vhosts/test1
- # chown 5001:5001 /var/mail/vhosts/test1
+ # chown 5000:5000 /var/mail/vhosts/test1
Execute something like the following commands for each maildir recipient:
# mkdir /var/mail/vhosts/test2
- # chown 5002:5002 /var/mail/vhosts/test2
+ # chown 5000:5000 /var/mail/vhosts/test2
Remember that each domain is required to have a postmaster contact
address.
! \( -type p -o -type s \) ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: {} \;
- find `ls -d $queue_directory/* | \
- egrep -v '/(incoming|active|defer|deferred|bounce|saved|corrupt|public|private|flush|pid|maildrop)$'` \
- ! -user root \
- -exec $WARN not owned by root: {} \;
+ for name in `ls -d $queue_directory/* | \
+ egrep '/(bin|etc|lib|usr)$'` ; \
+ do \
+ find $name ! -user root \
+ -exec $WARN not owned by root: {} \; ; \
+ done
for dir in $queue_directory/maildrop
do
! \( -type p -o -type s \) ! -user $mail_owner \
-exec $WARN not owned by $mail_owner: {} \;
- find `ls -d $queue_directory/* | \
- egrep -v '/(incoming|active|defer|deferred|bounce|saved|corrupt|public|private|flush|pid|maildrop)$'` \
- ! -user root \
- -exec $WARN not owned by root: {} \;
+ for name in `ls -d $queue_directory/* | \
+ egrep '/(bin|etc|lib|usr)$'` ; \
+ do \
+ find $name ! -user root \
+ -exec $WARN not owned by root: {} \; ; \
+ done
for dir in $queue_directory/maildrop
do
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20011208"
+#define DEF_MAIL_VERSION "Snapshot-20011209"
extern char *var_mail_version;
/* LICENSE
msg_warn("-f option specified malformed sender: %s", sender);
} else {
if ((sender = username()) == 0)
- msg_fatal("unable to find out your login name");
+ fatal_error(EX_OSERR, "unable to find out your login name");
saved_sender = mystrdup(sender);
}
* queue file.
*/
if (stat(MAIL_QUEUE_MAILDROP, &st) < 0)
- msg_fatal("No maildrop directory %s: %m", MAIL_QUEUE_MAILDROP);
+ fatal_error(EX_UNAVAILABLE, "No maildrop directory %s: %m",
+ MAIL_QUEUE_MAILDROP);
if (st.st_mode & S_IWOTH) {
handle = mail_stream_file(MAIL_QUEUE_MAILDROP,
MAIL_CLASS_PUBLIC, MAIL_SERVICE_PICKUP);
postdrop_command = concatenate(var_command_dir, "/postdrop",
msg_verbose ? " -v" : (char *) 0, (char *) 0);
if ((handle = mail_stream_command(postdrop_command)) == 0)
- msg_fatal("%s(%ld): unable to execute %s: %m",
- saved_sender, (long) uid, postdrop_command);
+ fatal_error(EX_UNAVAILABLE, "%s(%ld): unable to execute %s: %m",
+ saved_sender, (long) uid, postdrop_command);
myfree(postdrop_command);
}
dst = handle->stream;
if (tp->type == TOK822_ADDR) {
tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
if (REC_PUT_BUF(dst, REC_TYPE_RCPT, buf) < 0)
- msg_fatal("%s(%ld): error writing queue file: %m",
- saved_sender, (long) uid);
+ fatal_error(EX_TEMPFAIL,
+ "%s(%ld): error writing queue file: %m",
+ saved_sender, (long) uid);
}
}
tok822_free_tree(tree);
if ((flags & SM_FLAG_AEOF) && VSTRING_LEN(buf) == 1 && *STR(buf) == '.')
break;
if (REC_PUT_BUF(dst, type, buf) < 0)
- fatal_error(EX_CANTCREAT, "%s(%ld): error writing queue file: %m",
+ fatal_error(EX_TEMPFAIL, "%s(%ld): error writing queue file: %m",
saved_sender, (long) uid);
}
fatal_error(EX_DATAERR, "%s(%ld): error reading input: %m",
saved_sender, (long) uid);
if ((status = mail_stream_finish(handle, (VSTRING *) 0)) != 0)
- fatal_error(EX_CANTCREAT, "%s(%ld): %s", saved_sender,
+ fatal_error((status & CLEANUP_STAT_BAD) ? EX_SOFTWARE :
+ (status & CLEANUP_STAT_WRITE) ? EX_TEMPFAIL :
+ EX_UNAVAILABLE, "%s(%ld): %s", saved_sender,
(long) uid, cleanup_strerror(status));
if (sendmail_path) {
myfree(sendmail_path);
char *var_smtp_bind_addr;
bool var_smtp_rand_addr;
bool var_smtp_break_lines;
+int var_min_backoff_time;
/*
* Global variables. smtp_errno is set by the address lookup routines and by
VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 1, 0,
VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 1, 0,
VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 1, 0,
+ VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
0,
};
static CONFIG_INT_TABLE int_table[] = {
* does not span a packet boundary. This hurts performance so it is not
* on by default.
*/
- if (resp->str[strspn(resp->str, "20 *\t\n")] == 0) {
- msg_info("enabling PIX <CRLF>.<CRLF> workaround for %s",
- session->namaddr);
+ if (resp->str[strspn(resp->str, "20 *\t\n")] == 0)
state->features |= SMTP_FEATURE_MAYBEPIX;
- }
/*
* See if we are talking to ourself. This should not be possible with the
if (prev_type == REC_TYPE_CONT) /* missing newline at end */
smtp_fputs("", 0, session->stream);
- if ((state->features & SMTP_FEATURE_MAYBEPIX) != 0) {
+ if ((state->features & SMTP_FEATURE_MAYBEPIX) != 0
+ && request->arrival_time < vstream_ftime(session->stream)
+ - var_min_backoff_time) {
+ msg_info("%s: enabling PIX <CRLF>.<CRLF> workaround for %s",
+ request->queue_id, session->namaddr);
vstream_fflush(session->stream);/* hurts performance */
sleep(10); /* not to mention this */
}
msg_warn("%s: no @domain in address: %s", myname, CONST_STR(reply->recipient));
return (0);
}
- if (var_allow_untrust_route == 0 && (reply->flags & RESOLVE_FLAG_ROUTED))
+
+ /*
+ * Avoid surprise matches with source-routed, non-local addresses.
+ */
+ if (!resolve_local(ratsign + 1) && (reply->flags & RESOLVE_FLAG_ROUTED))
return (SMTPD_CHECK_DUNNO);
/*
SHELL = /bin/sh
-SRCS = argv.c argv_split.c basename.c binhash.c chroot_uid.c \
- close_on_exec.c concatenate.c dict.c dict_db.c dict_dbm.c \
- dict_env.c dict_ht.c dict_ldap.c dict_mysql.c dict_ni.c dict_nis.c \
- dict_nisplus.c dict_open.c dir_forest.c doze.c environ.c \
- events.c exec_command.c fifo_listen.c fifo_trigger.c file_limit.c \
- find_inet.c fsspace.c fullname.c get_domainname.c get_hostname.c \
- htable.c inet_addr_host.c inet_addr_list.c inet_addr_local.c \
- inet_connect.c inet_listen.c inet_trigger.c inet_util.c \
- line_wrap.c lowercase.c lstat_as.c mac_parse.c make_dirs.c \
- match_list.c match_ops.c msg.c msg_output.c msg_syslog.c \
- msg_vstream.c mvect.c myflock.c mymalloc.c mystrtok.c name_mask.c \
- non_blocking.c open_as.c open_limit.c open_lock.c peekfd.c \
- percentm.c posix_signals.c printable.c read_wait.c readable.c \
- readlline.c ring.c safe_getenv.c safe_open.c sane_accept.c \
- scan_dir.c set_eugid.c set_ugid.c sigdelay.c skipblanks.c \
- split_at.c stat_as.c sys_compat.c timed_connect.c timed_wait.c \
- translit.c trimblanks.c unix_connect.c unix_listen.c unix_trigger.c \
- unsafe.c username.c valid_hostname.c vbuf.c vbuf_print.c \
- vstream.c vstream_popen.c vstring.c vstring_vstream.c writable.c \
- write_buf.c write_wait.c dict_unix.c dict_pcre.c stream_listen.c \
- stream_connect.c stream_trigger.c dict_regexp.c mac_expand.c \
- clean_env.c watchdog.c spawn_command.c duplex_pipe.c sane_rename.c \
- sane_link.c unescape.c timed_read.c timed_write.c dict_tcp.c \
- hex_quote.c dict_alloc.c rand_sleep.c sane_time.c dict_debug.c \
- sane_socketpair.c myrand.c netstring.c ctable.c attr_print64.c intv.c \
- attr_scan64.c base64_code.c sock_empty_wait.c attr_print0.c attr_scan0.c
-OBJS = argv.o argv_split.o basename.o binhash.o chroot_uid.o \
- close_on_exec.o concatenate.o dict.o dict_db.o dict_dbm.o \
- dict_env.o dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \
- dict_nisplus.o dict_open.o dir_forest.o doze.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 \
- htable.o inet_addr_host.o inet_addr_list.o inet_addr_local.o \
- inet_connect.o inet_listen.o inet_trigger.o inet_util.o \
- line_wrap.o lowercase.o lstat_as.o mac_parse.o make_dirs.o \
- match_list.o match_ops.o msg.o msg_output.o msg_syslog.o \
- msg_vstream.o mvect.o myflock.o mymalloc.o mystrtok.o name_mask.o \
- non_blocking.o open_as.o open_limit.o open_lock.o peekfd.o \
- percentm.o posix_signals.o printable.o read_wait.o readable.o \
- readlline.o ring.o safe_getenv.o safe_open.o sane_accept.o \
- scan_dir.o set_eugid.o set_ugid.o sigdelay.o skipblanks.o \
- split_at.o stat_as.o sys_compat.o timed_connect.o timed_wait.o \
- translit.o trimblanks.o unix_connect.o unix_listen.o unix_trigger.o \
- unsafe.o username.o valid_hostname.o vbuf.o vbuf_print.o \
- vstream.o vstream_popen.o vstring.o vstring_vstream.o writable.o \
- write_buf.o write_wait.o dict_unix.o dict_pcre.o stream_listen.o \
- stream_connect.o stream_trigger.o dict_regexp.o mac_expand.o \
- clean_env.o watchdog.o spawn_command.o duplex_pipe.o sane_rename.o \
- sane_link.o unescape.o timed_read.o timed_write.o dict_tcp.o \
- hex_quote.o dict_alloc.o rand_sleep.o sane_time.o dict_debug.o \
- sane_socketpair.o myrand.o netstring.o ctable.o attr_print64.o intv.o \
- attr_scan64.o base64_code.o sock_empty_wait.o attr_print0.o attr_scan0.o
-HDRS = argv.h attr.h binhash.h chroot_uid.h connect.h dict.h dict_db.h \
- dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_mysql.h \
- dict_ni.h dict_nis.h dict_nisplus.h dir_forest.h events.h \
- exec_command.h find_inet.h fsspace.h fullname.h get_domainname.h \
- get_hostname.h htable.h inet_addr_host.h inet_addr_list.h \
- inet_addr_local.h inet_util.h iostuff.h line_wrap.h listen.h lstat_as.h \
- mac_parse.h make_dirs.h match_list.h match_ops.h msg.h msg_output.h \
- msg_syslog.h msg_vstream.h mvect.h myflock.h mymalloc.h name_mask.h \
- open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \
- safe.h safe_open.h sane_accept.h scan_dir.h set_eugid.h set_ugid.h \
- sigdelay.h split_at.h stat_as.h stringops.h sys_defs.h \
- timed_connect.h timed_wait.h trigger.h username.h valid_hostname.h \
- vbuf.h vbuf_print.h vstream.h vstring.h vstring_vstream.h \
- dict_unix.h dict_pcre.h dict_regexp.h mac_expand.h clean_env.h \
- watchdog.h spawn_command.h sane_fsops.h dict_tcp.h hex_quote.h \
- sane_time.h sane_socketpair.h myrand.h netstring.h ctable.h \
- intv.h base64_code.h
+SRCS = argv.c argv_split.c attr_print0.c attr_print64.c attr_scan0.c \
+ attr_scan64.c base64_code.c basename.c binhash.c chroot_uid.c \
+ clean_env.c close_on_exec.c concatenate.c ctable.c dict.c \
+ dict_alloc.c dict_db.c dict_dbm.c dict_debug.c dict_env.c \
+ dict_ht.c dict_ldap.c dict_mysql.c dict_ni.c dict_nis.c \
+ dict_nisplus.c dict_open.c dict_pcre.c dict_regexp.c dict_static.c \
+ dict_tcp.c dict_unix.c dir_forest.c doze.c duplex_pipe.c \
+ environ.c events.c exec_command.c fifo_listen.c fifo_trigger.c \
+ file_limit.c find_inet.c fsspace.c fullname.c get_domainname.c \
+ get_hostname.c hex_quote.c htable.c inet_addr_host.c \
+ inet_addr_list.c inet_addr_local.c inet_connect.c inet_listen.c \
+ inet_trigger.c inet_util.c intv.c line_wrap.c lowercase.c \
+ lstat_as.c mac_expand.c mac_parse.c make_dirs.c match_list.c \
+ match_ops.c msg.c msg_output.c msg_syslog.c msg_vstream.c \
+ mvect.c myflock.c mymalloc.c myrand.c mystrtok.c name_mask.c \
+ netstring.c non_blocking.c open_as.c open_limit.c open_lock.c \
+ peekfd.c percentm.c posix_signals.c printable.c rand_sleep.c \
+ read_wait.c readable.c readlline.c ring.c safe_getenv.c \
+ safe_open.c sane_accept.c sane_link.c sane_rename.c \
+ sane_socketpair.c sane_time.c scan_dir.c set_eugid.c set_ugid.c \
+ sigdelay.c skipblanks.c sock_empty_wait.c spawn_command.c \
+ split_at.c stat_as.c stream_connect.c stream_listen.c \
+ stream_trigger.c sys_compat.c timed_connect.c timed_read.c \
+ timed_wait.c timed_write.c translit.c trimblanks.c unescape.c \
+ unix_connect.c unix_listen.c unix_trigger.c unsafe.c username.c \
+ valid_hostname.c vbuf.c vbuf_print.c vstream.c vstream_popen.c \
+ vstring.c vstring_vstream.c watchdog.c writable.c write_buf.c \
+ write_wait.c
+OBJS = argv.o argv_split.o attr_print0.o attr_print64.o attr_scan0.o \
+ attr_scan64.o base64_code.o basename.o binhash.o chroot_uid.o \
+ clean_env.o close_on_exec.o concatenate.o ctable.o dict.o \
+ dict_alloc.o dict_db.o dict_dbm.o dict_debug.o dict_env.o \
+ dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \
+ dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_static.o \
+ dict_tcp.o dict_unix.o dir_forest.o doze.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_quote.o htable.o inet_addr_host.o \
+ inet_addr_list.o inet_addr_local.o inet_connect.o inet_listen.o \
+ inet_trigger.o inet_util.o intv.o line_wrap.o lowercase.o \
+ lstat_as.o mac_expand.o mac_parse.o make_dirs.o match_list.o \
+ match_ops.o msg.o msg_output.o msg_syslog.o msg_vstream.o \
+ mvect.o myflock.o mymalloc.o myrand.o mystrtok.o name_mask.o \
+ netstring.o non_blocking.o open_as.o open_limit.o open_lock.o \
+ peekfd.o percentm.o posix_signals.o printable.o rand_sleep.o \
+ read_wait.o readable.o readlline.o ring.o safe_getenv.o \
+ safe_open.o sane_accept.o sane_link.o sane_rename.o \
+ sane_socketpair.o sane_time.o scan_dir.o set_eugid.o set_ugid.o \
+ sigdelay.o skipblanks.o sock_empty_wait.o spawn_command.o \
+ split_at.o stat_as.o stream_connect.o stream_listen.o \
+ stream_trigger.o sys_compat.o timed_connect.o timed_read.o \
+ timed_wait.o timed_write.o translit.o trimblanks.o unescape.o \
+ unix_connect.o unix_listen.o unix_trigger.o unsafe.o username.o \
+ valid_hostname.o vbuf.o vbuf_print.o vstream.o vstream_popen.o \
+ vstring.o vstring_vstream.o watchdog.o writable.o write_buf.o \
+ write_wait.o
+HDRS = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.h \
+ connect.h ctable.h dict.h dict_db.h dict_dbm.h dict_env.h \
+ dict_ht.h dict_ldap.h dict_mysql.h dict_ni.h dict_nis.h \
+ dict_nisplus.h dict_pcre.h dict_regexp.h dict_static.h dict_tcp.h \
+ dict_unix.h dir_forest.h events.h exec_command.h find_inet.h \
+ fsspace.h fullname.h get_domainname.h get_hostname.h hex_quote.h \
+ htable.h inet_addr_host.h inet_addr_list.h inet_addr_local.h \
+ inet_util.h intv.h iostuff.h line_wrap.h listen.h lstat_as.h \
+ mac_expand.h mac_parse.h make_dirs.h match_list.h match_ops.h \
+ msg.h msg_output.h msg_syslog.h msg_vstream.h mvect.h myflock.h \
+ mymalloc.h myrand.h name_mask.h netstring.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_fsops.h sane_socketpair.h sane_time.h \
+ scan_dir.h set_eugid.h set_ugid.h sigdelay.h spawn_command.h \
+ split_at.h stat_as.h stringops.h sys_defs.h timed_connect.h \
+ timed_wait.h trigger.h username.h valid_hostname.h vbuf.h \
+ vbuf_print.h vstream.h vstring.h vstring_vstream.h watchdog.h
TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
stream_test.c dup2_pass_on_exec.c
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
dict_open.o: dict_mysql.h
dict_open.o: dict_pcre.h
dict_open.o: dict_regexp.h
+dict_open.o: dict_static.h
dict_open.o: stringops.h
dict_open.o: vstring.h
dict_open.o: split_at.h
dict_regexp.o: argv.h
dict_regexp.o: dict_regexp.h
dict_regexp.o: mac_parse.h
+dict_static.o: dict_static.c
+dict_static.o: sys_defs.h
+dict_static.o: mymalloc.h
+dict_static.o: msg.h
+dict_static.o: dict.h
+dict_static.o: vstream.h
+dict_static.o: vbuf.h
+dict_static.o: argv.h
+dict_static.o: dict_static.h
dict_tcp.o: dict_tcp.c
dict_tcp.o: sys_defs.h
dict_tcp.o: msg.h
#include <dict_mysql.h>
#include <dict_pcre.h>
#include <dict_regexp.h>
+#include <dict_static.h>
#include <stringops.h>
#include <split_at.h>
#include <htable.h>
#ifdef HAS_POSIX_REGEXP
DICT_TYPE_REGEXP, dict_regexp_open,
#endif
+ DICT_TYPE_STATIC, dict_static_open,
0,
};
--- /dev/null
+/*++
+/* NAME
+/* dict_static 3
+/* SUMMARY
+/* dictionary manager interface to static variables
+/* SYNOPSIS
+/* #include <dict_static.h>
+/*
+/* DICT *dict_static_open(name, dummy, dict_flags)
+/* const char *name;
+/* int dummy;
+/* int dict_flags;
+/* DESCRIPTION
+/* dict_static_open() implements a dummy dictionary that returns
+/* as lookup result the dictionary name, regardless of the lookup
+/* key value.
+/*
+/* The \fIdummy\fR argument is ignored.
+/* SEE ALSO
+/* dict(3) generic dictionary manager
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* jeffm
+/* ghostgun.com
+/*--*/
+
+/* System library. */
+
+#include "sys_defs.h"
+#include <stdio.h> /* sprintf() prototype */
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+/* Utility library. */
+
+#include "mymalloc.h"
+#include "msg.h"
+#include "dict.h"
+#include "dict_static.h"
+
+/* dict_static_lookup - access static value*/
+
+static const char *dict_static_lookup(DICT *dict, const char *name)
+{
+ dict_errno = 0;
+
+ return (dict->name);
+}
+
+/* dict_static_close - close static dictionary */
+
+static void dict_static_close(DICT *dict)
+{
+ dict_free(dict);
+}
+
+/* dict_static_open - make association with static variable */
+
+DICT *dict_static_open(const char *name, int unused_flags, int dict_flags)
+{
+ DICT *dict;
+
+ dict = dict_alloc(DICT_TYPE_STATIC, name, sizeof(*dict));
+ dict->lookup = dict_static_lookup;
+ dict->close = dict_static_close;
+ dict->flags = dict_flags | DICT_FLAG_FIXED;
+ return (DICT_DEBUG (dict));
+}
--- /dev/null
+#ifndef _DICT_STATIC_H_INCLUDED_
+#define _DICT_STATIC_H_INCLUDED_
+
+/*++
+/* NAME
+/* dict_static 3h
+/* SUMMARY
+/* dictionary manager interface to static settings
+/* SYNOPSIS
+/* #include <dict_static.h>
+/* DESCRIPTION
+/* .nf
+
+ /*
+ * Utility library.
+ */
+#include <dict.h>
+
+ /*
+ * External interface.
+ */
+#define DICT_TYPE_STATIC "static"
+
+extern DICT *dict_static_open(const char *, int, int);
+
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* jeffm
+/* ghostgun.com
+/*--*/
+
+#endif
* doubles.
*/
#ifndef ALIGN_TYPE
-#define ALIGN_TYPE double
+# ifdef __ia64__
+# define ALIGN_TYPE long double
+# else
+# define ALIGN_TYPE double
+# endif
#endif
/*