as local; rest of A options after switched lookup
SCCS-vsn: usr.sbin/sendmail/src/alias.c 8.48
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.183
# include "sendmail.h"
#ifndef lint
# include "sendmail.h"
#ifndef lint
-static char sccsid[] = "@(#)alias.c 8.47 (Berkeley) %G%";
+static char sccsid[] = "@(#)alias.c 8.48 (Berkeley) %G%";
#endif /* not lint */
MAP *AliasDB[MAXALIASDB + 1]; /* actual database list */
#endif /* not lint */
MAP *AliasDB[MAXALIASDB + 1]; /* actual database list */
-int NAliasDBs; /* number of alias databases */
+int NAliasDBs = 1; /* number of alias databases */
\f/*
** ALIAS -- Compute aliases.
**
\f/*
** ALIAS -- Compute aliases.
**
for (dbno = 0; dbno < NAliasDBs; dbno++)
{
map = AliasDB[dbno];
for (dbno = 0; dbno < NAliasDBs; dbno++)
{
map = AliasDB[dbno];
- if (!bitset(MF_OPEN, map->map_mflags))
+ if (map == NULL || !bitset(MF_OPEN, map->map_mflags))
continue;
p = (*map->map_class->map_lookup)(map, name, NULL, pstat);
if (p != NULL)
continue;
p = (*map->map_class->map_lookup)(map, name, NULL, pstat);
if (p != NULL)
-static char sccsid[] = "@(#)conf.c 8.182 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 8.183 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
{
register int i;
int nmaps;
{
register int i;
int nmaps;
char *maptype[MAXMAPSTACK];
short mapreturn[MAXMAPACTIONS];
char buf[MAXLINE];
char *maptype[MAXMAPSTACK];
short mapreturn[MAXMAPACTIONS];
char buf[MAXLINE];
- if (stab("aliases", ST_MAP, ST_FIND) == NULL)
+ s = stab("aliases", ST_MAP, ST_FIND);
+ if (s == NULL)
{
strcpy(buf, "aliases switch aliases");
makemapentry(buf);
{
strcpy(buf, "aliases switch aliases");
makemapentry(buf);
+ s = stab("aliases", ST_MAP, ST_FIND);
+ }
+ if (s == NULL)
+ syserr("inithostmaps: cannot initialize default aliases map");
+ else
+ {
+ extern MAP *AliasDB[MAXALIASDB + 1];
+
+ AliasDB[0] = &s->s_map;
- strcpy(buf, "switch:aliases");
- setalias(buf);
#if 0 /* "user" map class is a better choice */
/*
#if 0 /* "user" map class is a better choice */
/*