summaryrefslogtreecommitdiff
path: root/makemap
diff options
context:
space:
mode:
Diffstat (limited to 'makemap')
-rwxr-xr-xmakemap/Build13
-rw-r--r--makemap/makemap.090
-rw-r--r--makemap/makemap.87
-rw-r--r--makemap/makemap.c7
4 files changed, 111 insertions, 6 deletions
diff --git a/makemap/Build b/makemap/Build
new file mode 100755
index 000000000000..3bb6e8539529
--- /dev/null
+++ b/makemap/Build
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Copyright (c) 1999 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+# $Id: Build,v 8.4 1999/03/02 02:33:50 peterh Exp $
+
+exec ../devtools/bin/Build $*
diff --git a/makemap/makemap.0 b/makemap/makemap.0
new file mode 100644
index 000000000000..5e30b72014e8
--- /dev/null
+++ b/makemap/makemap.0
@@ -0,0 +1,90 @@
+MAKEMAP(8) MAKEMAP(8)
+
+
+
+NNAAMMEE
+ makemap - create database maps for sendmail
+
+SSYYNNOOPPSSIISS
+ mmaakkeemmaapp [--CC _f_i_l_e] [--NN] [--cc _c_a_c_h_e_s_i_z_e] [--dd] [--DD _c_o_m_m_e_n_t_c_h_a_r] [--ee] [--ff]
+ [--ll] [--oo] [--rr] [--ss] [--tt _d_e_l_i_m] [--uu] [--vv] _m_a_p_t_y_p_e _m_a_p_n_a_m
+
+DDEESSCCRRIIPPTTIIOONN
+ MMaakkeemmaapp creates the database maps used by the keyed map lookups in
+ sendmail(8). It reads input from the standard input and outputs them
+ to the indicated _m_a_p_n_a_m_e_.
+
+ Depending on how it is compiled, mmaakkeemmaapp handles up to three different
+ database formats, selected using the _m_a_p_t_y_p_e parameter. They may be
+
+ dbm DBM format maps. This requires the ndbm(3) library.
+
+ btree B-Tree format maps. This requires the new Berkeley DB library.
+
+ hash Hash format maps. This also requires the Berkeley DB library.
+
+ In all cases, mmaakkeemmaapp reads lines from the standard input consisting of
+ two words separated by white space. The first is the database key, the
+ second is the value. The value may contain ``%_n'' strings to indicate
+ parameter substitution. Literal percents should be doubled (``%%'').
+ Blank lines and lines beginning with ``#'' are ignored.
+
+ Notice: do nnoott use mmaakkeemmaapp to create the aliases data base, but
+ nneewwaalliiaasseess which puts a special token into the data base that is
+ required by sseennddmmaaiill..
+
+ If the _T_r_u_s_t_e_d_U_s_e_r option is set in the sendmail configuration file and
+ mmaakkeemmaapp is invoked as root, the generated files will be owned by the
+ specified _T_r_u_s_t_e_d_U_s_e_r_.
+
+ FFllaaggss
+ --CC Use the specified sseennddmmaaiill configuration file for looking up the
+ TrustedUser option.
+
+ --NN Include the null byte that terminates strings in the map. This
+ must match the -N flag in the sendmail.cf ``K'' line.
+
+ --cc Use the specified hash and B-Tree cache size.
+
+ --DD Use to specify the character to use to indicate a comment (which
+ is ignored) instead of the default of '#'.
+
+ --dd Allow duplicate keys in the map. This is only allowed on B-Tree
+ format maps. If two identical keys are read, they will both be
+ inserted into the map.
+
+ --ee Allow empty value (right hand side).
+
+ --ff Normally all upper case letters in the key are folded to lower
+ case. This flag disables that behaviour. This is intended to
+ mesh with the -f flag in the KK line in sendmail.cf. The value
+ is never case folded.
+
+ --ll List supported map types.
+
+ --oo Append to an old file. This allows you to augment an existing
+ file.
+
+ --rr Allow replacement of existing keys. Normally mmaakkeemmaapp complains
+ if you repeat a key, and does not do the insert.
+
+ --ss Ignore safety checks on maps being created. This includes
+ checking for hard or symbolic links in world writable directo-
+ ries.
+
+ --tt Use the specified delimiter instead of white space (also for
+ dumping a map).
+
+ --uu dump (unmap) the content of the database to standard output.
+
+ --vv Verbosely print what it is doing.
+
+SSEEEE AALLSSOO
+ sendmail(8), newaliases(1)
+
+HHIISSTTOORRYY
+ The mmaakkeemmaapp command appeared in 4.4BSD.
+
+
+
+ $Date: 2008/05/02 23:07:48 $ MAKEMAP(8)
diff --git a/makemap/makemap.8 b/makemap/makemap.8
index 96338e79cb0f..ca8a949de863 100644
--- a/makemap/makemap.8
+++ b/makemap/makemap.8
@@ -8,9 +8,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: makemap.8,v 8.30 2002/06/27 23:41:04 gshapiro Exp $
+.\" $Id: makemap.8,v 8.31 2008/05/02 23:07:48 ca Exp $
.\"
-.TH MAKEMAP 8 "$Date: 2002/06/27 23:41:04 $"
+.TH MAKEMAP 8 "$Date: 2008/05/02 23:07:48 $"
.SH NAME
makemap
\- create database maps for sendmail
@@ -156,7 +156,8 @@ This includes checking for hard or symbolic
links in world writable directories.
.TP
.B \-t
-Use the specified delimiter instead of white space.
+Use the specified delimiter instead of white space
+(also for dumping a map).
.TP
.B \-u
dump (unmap) the content of the database to standard output.
diff --git a/makemap/makemap.c b/makemap/makemap.c
index 730274848a7b..cacec001e768 100644
--- a/makemap/makemap.c
+++ b/makemap/makemap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2002, 2004, 2008 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1992 Eric P. Allman. All rights reserved.
* Copyright (c) 1992, 1993
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.178 2007/05/11 18:45:39 ca Exp $")
+SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.179 2008/04/14 02:06:16 ca Exp $")
#include <sys/types.h>
@@ -378,9 +378,10 @@ main(argc, argv)
break;
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
- "%.*s\t%.*s\n",
+ "%.*s%c%.*s\n",
(int) db_key.size,
(char *) db_key.data,
+ (sep != '\0') ? sep : '\t',
(int) db_val.size,
(char *)db_val.data);