add generalized database mapping (using the K config line and
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 26 May 1992 04:13:45 +0000 (20:13 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 26 May 1992 04:13:45 +0000 (20:13 -0800)
$( ... $) syntaxes); $[ ... $] is now a special case

SCCS-vsn: usr.sbin/sendmail/src/main.c 5.49
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 5.18
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.98
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 5.31
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 5.44
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.37
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.36
SCCS-vsn: usr.sbin/sendmail/src/udb.c 5.18

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/daemon.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/readcf.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/udb.c
usr/src/usr.sbin/sendmail/src/version.c

index a0c5a00..713fc36 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     5.35 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     5.36 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
@@ -146,6 +146,7 @@ setdefaults()
        ErrorMode = EM_PRINT;
        EightBit = FALSE;
        setdefuser();
        ErrorMode = EM_PRINT;
        EightBit = FALSE;
        setdefuser();
+       setupmaps();
 }
 
 
 }
 
 
@@ -164,9 +165,82 @@ setdefuser()
        else
                DefUser = newstr("nobody");
 }
        else
                DefUser = newstr("nobody");
 }
+\f/*
+**  SETUPMAPS -- set up map classes
+**
+**     Since these are compiled in, they cannot be in the config file.
+**
+*/
 
 
+setupmaps()
+{
+       register STAB *s;
+       MAPCLASS *hostmapclass;
+       extern char *maphostname();
 
 
-/*
+       /* set up host name lookup map */
+       s = stab("host", ST_MAPCLASS, ST_ENTER);
+       s->s_mapclass.map_init = NULL;
+       s->s_mapclass.map_lookup = maphostname;
+       hostmapclass = &s->s_mapclass;
+
+       s = stab("host", ST_MAP, ST_ENTER);
+       s->s_map.map_class = hostmapclass;
+       s->s_map.map_flags = MF_VALID;
+
+       /*
+       **  Set up other map classes.
+       */
+
+# ifdef DBM_MAP
+       /* dbm file access */
+       {
+               extern void dbm_map_init();
+               extern char *dbm_map_lookup();
+
+               s = stab("dbm", ST_MAPCLASS, ST_ENTER);
+               s->s_mapclass.map_init = dbm_map_init;
+               s->s_mapclass.map_lookup = dbm_map_lookup;
+       }
+# endif
+
+# ifdef BTREE_MAP
+       /* new database file access -- btree files */
+       {
+               extern void bt_map_init();
+               extern char *bt_map_lookup();
+
+               s = stab("btree", ST_MAPCLASS, ST_ENTER);
+               s->s_mapclass.map_init = bt_map_init;
+               s->s_mapclass.map_lookup = bt_map_lookup;
+       }
+# endif
+
+# ifdef HASH_MAP
+       /* new database file access -- hash files */
+       {
+               extern void hash_map_init();
+               extern char *hash_map_lookup();
+
+               s = stab("hash", ST_MAPCLASS, ST_ENTER);
+               s->s_mapclass.map_init = hash_map_init;
+               s->s_mapclass.map_lookup = hash_map_lookup;
+       }
+# endif
+
+# ifdef USERDB_MAP
+       /* user database */
+       {
+               extern void udb_map_init();
+               extern char *udb_map_lookup();
+
+               s = stab("udb", ST_MAPCLASS, ST_ENTER);
+               s->s_mapclass.map_init = udb_map_init;
+               s->s_mapclass.map_lookup = udb_map_lookup;
+       }
+# endif
+}
+\f/*
 **  GETRUID -- get real user id (V7)
 */
 
 **  GETRUID -- get real user id (V7)
 */
 
@@ -190,8 +264,7 @@ getrgid()
        else
                return (getgid());
 }
        else
                return (getgid());
 }
-
-/*
+\f/*
 **  USERNAME -- return the user id of the logged in user.
 **
 **     Parameters:
 **  USERNAME -- return the user id of the logged in user.
 **
 **     Parameters:
index 28a834a..c7c386c 100644 (file)
@@ -12,9 +12,9 @@
 
 #ifndef lint
 #ifdef DAEMON
 
 #ifndef lint
 #ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c   5.43 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c   5.44 (Berkeley) %G% (with daemon mode)";
 #else
 #else
-static char sccsid[] = "@(#)daemon.c   5.43 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c   5.44 (Berkeley) %G% (without daemon mode)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -393,52 +393,71 @@ myhostname(hostbuf, size)
                return (NULL);
 }
 \f/*
                return (NULL);
 }
 \f/*
- *  MAPHOSTNAME -- turn a hostname into canonical form
- *
- *     Parameters:
- *             hbuf -- a buffer containing a hostname.
- *             hbsize -- the size of hbuf.
- *
- *     Returns:
- *             TRUE if the host name was mapped.
- *             FALSE otherwise.
- *
- *     Side Effects:
- *             Looks up the host specified in hbuf.  If it is not
- *             the canonical name for that host, replace it with
- *             the canonical name.  If the name is unknown, or it
- *             is already the canonical name, leave it unchanged.
- */
+**  MAPHOSTNAME -- turn a hostname into canonical form
+**
+**     Parameters:
+**             hbuf -- a buffer containing a hostname.
+**             hbsize -- the size of hbuf.
+**
+**     Returns:
+**             The mapping, if found.
+**             NULL if no mapping found.
+**
+**     Side Effects:
+**             Looks up the host specified in hbuf.  If it is not
+**             the canonical name for that host, return the canonical
+**             name.
+*/
 
 
-bool
-maphostname(hbuf, hbsize)
+char *
+maphostname(hbuf, hbsize, avp)
        char *hbuf;
        int hbsize;
        char *hbuf;
        int hbsize;
+       char **avp;
 {
        register struct hostent *hp;
        u_long in_addr;
        char ptr[256], *cp;
        struct hostent *gethostbyaddr();
 
 {
        register struct hostent *hp;
        u_long in_addr;
        char ptr[256], *cp;
        struct hostent *gethostbyaddr();
 
+       /* allow room for trailing dot on correct match */
+       if (ConfigLevel >= 2)
+               hbsize--;
+
        /*
         * If first character is a bracket, then it is an address
         * lookup.  Address is copied into a temporary buffer to
         * strip the brackets and to preserve hbuf if address is
         * unknown.
         */
        /*
         * If first character is a bracket, then it is an address
         * lookup.  Address is copied into a temporary buffer to
         * strip the brackets and to preserve hbuf if address is
         * unknown.
         */
+
        if (*hbuf != '[')
        if (*hbuf != '[')
-               return (getcanonname(hbuf, hbsize));
+       {
+               if (getcanonname(hbuf, hbsize))
+               {
+                       /* found a match -- add the trailing dot */
+                       if (ConfigLevel >= 2)
+                               (void) strcat(hbuf, ".");
+                       return hbuf;
+               }
+               else
+                       return NULL;
+       }
        if ((cp = index(strcpy(ptr, hbuf), ']')) == NULL)
        if ((cp = index(strcpy(ptr, hbuf), ']')) == NULL)
-               return (FALSE);
+               return (NULL);
        *cp = '\0';
        in_addr = inet_addr(&ptr[1]);
        hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
        if (hp == NULL)
        *cp = '\0';
        in_addr = inet_addr(&ptr[1]);
        hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
        if (hp == NULL)
-               return (FALSE);
+               return (NULL);
+
+       /* found a match -- copy and dot terminate */
        if (strlen(hp->h_name) >= hbsize)
                hp->h_name[hbsize - 1] = '\0';
        if (strlen(hp->h_name) >= hbsize)
                hp->h_name[hbsize - 1] = '\0';
-       (void)strcpy(hbuf, hp->h_name);
-       return (TRUE);
+       (void) strcpy(hbuf, hp->h_name);
+       if (ConfigLevel >= 2)
+               (void) strcat(hbuf, ".");
+       return hbuf;
 }
 
 # else DAEMON
 }
 
 # else DAEMON
@@ -475,9 +494,10 @@ myhostname(hostbuf, size)
 **     Parameters:
 **             hbuf -- a buffer containing a hostname.
 **             hbsize -- the size of hbuf.
 **     Parameters:
 **             hbuf -- a buffer containing a hostname.
 **             hbsize -- the size of hbuf.
+**             avp -- a pointer to a (cf file defined) argument vector.
 **
 **     Returns:
 **
 **     Returns:
-**             TRUE if the hostname was mapped.
+**             mapped host name
 **             FALSE otherwise.
 **
 **     Side Effects:
 **             FALSE otherwise.
 **
 **     Side Effects:
@@ -488,12 +508,13 @@ myhostname(hostbuf, size)
 */
 
 /*ARGSUSED*/
 */
 
 /*ARGSUSED*/
-bool
-maphostname(hbuf, hbsize)
+char *
+maphostname(hbuf, hbsize, avp)
        char *hbuf;
        int hbsize;
        char *hbuf;
        int hbsize;
+       char **avp;
 {
 {
-       return (FALSE);
+       return NULL;
 }
 
 #endif DAEMON
 }
 
 #endif DAEMON
index a707167..74f0626 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.48 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.49 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -878,18 +878,20 @@ intsig()
 struct metamac MetaMacros[] =
 {
        /* LHS pattern matching characters */
 struct metamac MetaMacros[] =
 {
        /* LHS pattern matching characters */
-       '*', MATCHZANY, '+', MATCHANY,  '-', MATCHONE,  '=', MATCHCLASS,
-       '~', MATCHNCLASS,
+       '*', MATCHZANY,         '+', MATCHANY,          '-', MATCHONE,
+       '=', MATCHCLASS,        '~', MATCHNCLASS,
 
        /* these are RHS metasymbols */
 
        /* these are RHS metasymbols */
-       '#', CANONNET,  '@', CANONHOST, ':', CANONUSER, '>', CALLSUBR,
+       '#', CANONNET,          '@', CANONHOST,         ':', CANONUSER,
+       '>', CALLSUBR,
        '{', MATCHLOOKUP,               '}', MATCHELOOKUP,
 
        /* the conditional operations */
        '{', MATCHLOOKUP,               '}', MATCHELOOKUP,
 
        /* the conditional operations */
-       '?', CONDIF,    '|', CONDELSE,  '.', CONDFI,
+       '?', CONDIF,            '|', CONDELSE,          '.', CONDFI,
 
        /* and finally the hostname lookup characters */
 
        /* and finally the hostname lookup characters */
-       '[', HOSTBEGIN, ']', HOSTEND,
+       '[', HOSTBEGIN,         ']', HOSTEND,
+       '(', LOOKUPBEGIN,       ')', LOOKUPEND,
 
        '\0'
 };
 
        '\0'
 };
index 94c3955..878beb9 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parseaddr.c        5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)parseaddr.c        5.18 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -755,7 +755,7 @@ rewrite(pvp, ruleset)
                *avp++ = NULL;
 
                /*
                *avp++ = NULL;
 
                /*
-               **  Check for any hostname lookups.
+               **  Check for any hostname/keyword lookups.
                */
 
                for (rvp = npvp; *rvp != NULL; rvp++)
                */
 
                for (rvp = npvp; *rvp != NULL; rvp++)
@@ -764,25 +764,64 @@ rewrite(pvp, ruleset)
                        char **xpvp;
                        int trsize;
                        char *olddelimchar;
                        char **xpvp;
                        int trsize;
                        char *olddelimchar;
+                       char *replac;
+                       int endtoken;
+                       STAB *map;
+                       char *mapname;
+                       char **key_rvp;
+                       char **arg_rvp;
+                       char **default_rvp;
                        char buf[MAXNAME + 1];
                        char *pvpb1[MAXATOM + 1];
                        char pvpbuf[PSBUFSIZE];
                        extern char *DelimChar;
 
                        char buf[MAXNAME + 1];
                        char *pvpb1[MAXATOM + 1];
                        char pvpbuf[PSBUFSIZE];
                        extern char *DelimChar;
 
-                       if (**rvp != HOSTBEGIN)
+                       if (**rvp != HOSTBEGIN && **rvp != LOOKUPBEGIN)
                                continue;
 
                        /*
                                continue;
 
                        /*
-                       **  Got a hostname lookup.
+                       **  Got a hostname/keyword lookup.
                        **
                        **      This could be optimized fairly easily.
                        */
 
                        hbrvp = rvp;
                        **
                        **      This could be optimized fairly easily.
                        */
 
                        hbrvp = rvp;
+                       arg_rvp = default_rvp = NULL;
+                       if (**rvp == HOSTBEGIN)
+                       {
+                               endtoken = HOSTEND;
+                               mapname = "host";
+                       }
+                       else
+                       {
+                               endtoken = LOOKUPEND;
+                               mapname = *++rvp;
+                       }
+                       map = stab(mapname, ST_MAP, ST_FIND);
+                       if (map == NULL)
+                               syserr("rewrite: map %s not found", mapname);
 
                        /* extract the match part */
 
                        /* extract the match part */
-                       while (*++rvp != NULL && **rvp != HOSTEND)
-                               continue;
+                       key_rvp = ++rvp;
+                       while (*rvp != NULL && **rvp != endtoken)
+                       {
+                               switch (**rvp)
+                               {
+                                 case CANONHOST:
+                                       *rvp++ = NULL;
+                                       arg_rvp = rvp;
+                                       break;
+
+                                 case CANONUSER:
+                                       *rvp++ = NULL;
+                                       default_rvp = rvp;
+                                       break;
+
+                                 default:
+                                       rvp++;
+                                       break;
+                               }
+                       }
                        if (*rvp != NULL)
                                *rvp++ = NULL;
 
                        if (*rvp != NULL)
                                *rvp++ = NULL;
 
@@ -791,32 +830,36 @@ rewrite(pvp, ruleset)
                        bcopy((char *) rvp, (char *) pvpb1, trsize);
 
                        /* look it up */
                        bcopy((char *) rvp, (char *) pvpb1, trsize);
 
                        /* look it up */
-                       cataddr(++hbrvp, buf, sizeof buf);
-                       if (maphostname(buf, sizeof buf - 1) && ConfigLevel >= 2)
-                       {
-                               register int i;
+                       cataddr(key_rvp, buf, sizeof buf);
+                       if (map != NULL && bitset(MF_VALID, map->s_map.map_flags))
+                               replac = (*map->s_map.map_class->map_lookup)(buf,
+                                               sizeof buf - 1, arg_rvp);
+                       else
+                               replac = NULL;
 
 
-                               /* it mapped -- mark it with a trailing dot */
-                               i = strlen(buf);
-                               if (i > 0 && buf[i - 1] != '.')
-                               {
-                                       buf[i++] = '.';
-                                       buf[i] = '\0';
-                               }
+                       /* if no replacement, use default */
+                       if (replac == NULL)
+                       {
+                               if (default_rvp != NULL)
+                                       xpvp = default_rvp;
+                               else
+                                       xpvp = key_rvp;
                        }
                        }
-
-                       /* scan the new host name */
-                       olddelimchar = DelimChar;
-                       xpvp = prescan(buf, '\0', pvpbuf);
-                       DelimChar = olddelimchar;
-                       if (xpvp == NULL)
+                       else
                        {
                        {
-                               syserr("rewrite: cannot prescan canonical hostname: %s", buf);
-                               return;
+                               /* scan the new replacement */
+                               olddelimchar = DelimChar;
+                               xpvp = prescan(replac, '\0', pvpbuf);
+                               DelimChar = olddelimchar;
+                               if (xpvp == NULL)
+                               {
+                                       syserr("rewrite: cannot prescan map value: %s", replac);
+                                       return;
+                               }
                        }
 
                        /* append it to the token list */
                        }
 
                        /* append it to the token list */
-                       for (avp = --hbrvp; *xpvp != NULL; xpvp++)
+                       for (avp = hbrvp; *xpvp != NULL; xpvp++)
                        {
                                *avp++ = newstr(*xpvp);
                                if (avp >= &npvp[MAXATOM])
                        {
                                *avp++ = newstr(*xpvp);
                                if (avp >= &npvp[MAXATOM])
index 08d0dfd..2565217 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   5.36 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   5.37 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -40,6 +40,9 @@ static char sccsid[] = "@(#)readcf.c  5.36 (Berkeley) %G%";
 **             Oxvalue         Set option x to value.
 **             Pname=value     Set precedence name to value.
 **             Vversioncode    Version level of configuration syntax.
 **             Oxvalue         Set option x to value.
 **             Pname=value     Set precedence name to value.
 **             Vversioncode    Version level of configuration syntax.
+**             Kmapname mapclass arguments....
+**                             Define keyed lookup of a given class.
+**                             Arguments are class dependent.
 **
 **     Parameters:
 **             cfname -- control file name.
 **
 **     Parameters:
 **             cfname -- control file name.
@@ -68,6 +71,7 @@ readcf(cfname)
        char pvpbuf[PSBUFSIZE];
        extern char *fgetfolded();
        extern char *munchstring();
        char pvpbuf[PSBUFSIZE];
        extern char *fgetfolded();
        extern char *munchstring();
+       extern void makemapentry();
 
        FileName = cfname;
        LineNumber = 0;
 
        FileName = cfname;
        LineNumber = 0;
@@ -314,6 +318,10 @@ readcf(cfname)
                        ConfigLevel = atoi(&buf[1]);
                        break;
 
                        ConfigLevel = atoi(&buf[1]);
                        break;
 
+                 case 'K':
+                       makemapentry(&buf[1]);
+                       break;
+
                  default:
                  badline:
                        syserr("unknown control line \"%s\"", buf);
                  default:
                  badline:
                        syserr("unknown control line \"%s\"", buf);
@@ -998,3 +1006,70 @@ setclass(class, word)
        s = stab(word, ST_CLASS, ST_ENTER);
        setbitn(class, s->s_class);
 }
        s = stab(word, ST_CLASS, ST_ENTER);
        setbitn(class, s->s_class);
 }
+\f/*
+**  MAKEMAPENTRY -- create a map entry
+**
+**     Parameters:
+**             line -- the config file line
+**
+**     Returns:
+**             TRUE if it successfully entered the map entry.
+**             FALSE otherwise (usually syntax error).
+**
+**     Side Effects:
+**             Enters the map into the dictionary.
+*/
+
+void
+makemapentry(line)
+       char *line;
+{
+       register char *p;
+       char *mapname;
+       char *classname;
+       register STAB *map;
+       STAB *class;
+
+       for (p = line; isspace(*p); p++)
+               continue;
+       if (!isalnum(*p))
+       {
+               syserr("readcf: config K line: no map name");
+               return;
+       }
+
+       mapname = p;
+       while (isalnum(*++p))
+               continue;
+       if (*p != '\0')
+               *p++ = '\0';
+       while (isspace(*p))
+               p++;
+       if (!isalnum(*p))
+       {
+               syserr("readcf: config K line, map %s: no map class", mapname);
+               return;
+       }
+       classname = p;
+       while (isalnum(*++p))
+               continue;
+       if (*p != '\0')
+               *p++ = '\0';
+       while (isspace(*p))
+               p++;
+
+       /* look up the class */
+       class = stab(classname, ST_MAPCLASS, ST_FIND);
+       if (class == NULL)
+       {
+               syserr("readcf: map %s: class %s not available", mapname, classname);
+               return;
+       }
+
+       /* enter the map */
+       map = stab(mapname, ST_MAP, ST_ENTER);
+       map->s_map.map_class = &class->s_mapclass;
+
+       if ((*class->s_mapclass.map_init)(&map->s_map, p))
+               map->s_map.map_flags |= MF_VALID;
+}
index feec367..88a3f2b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  5.30.1.1 (Berkeley) %G%
+ *     @(#)sendmail.h  5.31 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 5.30.1.1                %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 5.31            %G%";
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
@@ -345,6 +345,10 @@ EXTERN struct rewrite      *RewriteRules[MAXRWSETS];
 # define HOSTBEGIN     '\035'  /* hostname lookup begin */
 # define HOSTEND       '\036'  /* hostname lookup end */
 
 # define HOSTBEGIN     '\035'  /* hostname lookup begin */
 # define HOSTEND       '\036'  /* hostname lookup end */
 
+/* bracket characters for generalized lookup */
+# define LOOKUPBEGIN   '\005'  /* generalized lookup begin */
+# define LOOKUPEND     '\006'  /* generalized lookup end */
+
 /* \001 is also reserved as the macro expansion character */
 
 /* external <==> internal mapping table */
 /* \001 is also reserved as the macro expansion character */
 
 /* external <==> internal mapping table */
@@ -375,6 +379,42 @@ MCONINFO
 /* flag bits */
 #define MCIF_VALID     00001           /* this entry is valid */
 \f/*
 /* flag bits */
 #define MCIF_VALID     00001           /* this entry is valid */
 \f/*
+**  Mapping functions
+**
+**     These allow arbitrary mappings in the config file.  The idea
+**     (albeit not the implementation) comes from IDA sendmail.
+*/
+
+
+/*
+**  The class of a map -- essentially the functions to call
+*/
+
+# define MAPCLASS      struct _mapclass
+
+MAPCLASS
+{
+       bool    (*map_init)();          /* initialization function */
+       char    *(*map_lookup)();       /* lookup function */
+};
+
+
+/*
+**  An actual map.
+*/
+
+# define MAP           struct _map
+
+MAP
+{
+       MAPCLASS        *map_class;     /* the class of this map */
+       int             map_flags;      /* flags, see below */
+       char            *map_file;      /* the (nominal) filename */
+};
+
+/* bit values for map_flags */
+# define MF_VALID      00001           /* this entry is valid */
+\f/*
 **  Symbol table definitions
 */
 
 **  Symbol table definitions
 */
 
@@ -389,6 +429,8 @@ struct symtab
                ADDRESS         *sv_addr;       /* pointer to address header */
                MAILER          *sv_mailer;     /* pointer to mailer */
                char            *sv_alias;      /* alias */
                ADDRESS         *sv_addr;       /* pointer to address header */
                MAILER          *sv_mailer;     /* pointer to mailer */
                char            *sv_alias;      /* alias */
+               MAPCLASS        sv_mapclass;    /* mapping function class */
+               MAP             sv_map;         /* mapping function */
                MCONINFO        sv_mci;         /* mailer connection info */
        }       s_value;
 };
                MCONINFO        sv_mci;         /* mailer connection info */
        }       s_value;
 };
index 5efb2af..6d4ce1c 100644 (file)
@@ -8,9 +8,9 @@
 
 #ifndef lint
 #ifdef USERDB
 
 #ifndef lint
 #ifdef USERDB
-static char sccsid [] = "@(#)udb.c     5.17 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c     5.18 (Berkeley) %G% (with USERDB)";
 #else
 #else
-static char sccsid [] = "@(#)udb.c     5.17 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c     5.18 (Berkeley) %G% (without USERDB)";
 #endif
 #endif
 
 #endif
 #endif
 
@@ -26,7 +26,7 @@ static char sccsid [] = "@(#)udb.c    5.17 (Berkeley) %G% (without USERDB)";
 #include <db.h>
 
 /*
 #include <db.h>
 
 /*
-**  UDBEXPAND.C -- interface between sendmail and Berkeley User Data Base.
+**  UDB.C -- interface between sendmail and Berkeley User Data Base.
 **
 **     This depends on the 4.4BSD db package.
 */
 **
 **     This depends on the 4.4BSD db package.
 */
index c5a798a..513ad60 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  5.97 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  5.98 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "5.97";
+char   Version[] = "5.98";