summaryrefslogtreecommitdiff
path: root/usr.sbin/sendmail/src/map.c
diff options
context:
space:
mode:
authorglass <glass@NetBSD.org>1994-03-16 02:11:31 +0000
committerglass <glass@NetBSD.org>1994-03-16 02:11:31 +0000
commit3fb497653d34cde8706b0e446e52182df5bc4ae7 (patch)
tree378207336652cf6132b6412b0e6c3f105621d985 /usr.sbin/sendmail/src/map.c
parentc0ae496079e5f8f6af13afb704a68b285f4d14b4 (diff)
sendmail 8.6.7. fixes recently discovered security hole
Diffstat (limited to 'usr.sbin/sendmail/src/map.c')
-rw-r--r--usr.sbin/sendmail/src/map.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c
index 7a3bdc0c002..7444cdab737 100644
--- a/usr.sbin/sendmail/src/map.c
+++ b/usr.sbin/sendmail/src/map.c
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)map.c 8.20 (Berkeley) 12/11/93";
+static char sccsid[] = "@(#)map.c 8.22 (Berkeley) 2/18/94";
#endif /* not lint */
#include "sendmail.h"
@@ -638,7 +638,7 @@ bt_map_open(map, mode)
if (omode == O_RDWR)
{
omode |= O_CREAT|O_TRUNC;
-#if defined(O_EXLOCK) && defined(HASFLOCK)
+#if defined(O_EXLOCK) && HASFLOCK
omode |= O_EXLOCK;
# if !defined(OLD_NEWDB)
}
@@ -664,7 +664,7 @@ bt_map_open(map, mode)
syserr("Cannot open BTREE database %s", map->map_file);
return FALSE;
}
-#if !defined(OLD_NEWDB) && defined(HASFLOCK)
+#if !defined(OLD_NEWDB) && HASFLOCK
fd = db->fd(db);
# if !defined(O_EXLOCK)
if (mode == O_RDWR && fd >= 0)
@@ -722,7 +722,7 @@ hash_map_open(map, mode)
if (omode == O_RDWR)
{
omode |= O_CREAT|O_TRUNC;
-#if defined(O_EXLOCK) && defined(HASFLOCK)
+#if defined(O_EXLOCK) && HASFLOCK
omode |= O_EXLOCK;
# if !defined(OLD_NEWDB)
}
@@ -748,7 +748,7 @@ hash_map_open(map, mode)
syserr("Cannot open HASH database %s", map->map_file);
return FALSE;
}
-#if !defined(OLD_NEWDB) && defined(HASFLOCK)
+#if !defined(OLD_NEWDB) && HASFLOCK
fd = db->fd(db);
# if !defined(O_EXLOCK)
if (mode == O_RDWR && fd >= 0)
@@ -965,12 +965,20 @@ nis_map_open(map, mode)
map->map_domain = p;
}
- if (map->map_domain == NULL)
- yp_get_default_domain(&map->map_domain);
-
if (*map->map_file == '\0')
map->map_file = "mail.aliases";
+ if (map->map_domain == NULL)
+ {
+ yperr = yp_get_default_domain(&map->map_domain);
+ if (yperr != 0)
+ {
+ syserr("NIS map %s specified, but NIS not running\n",
+ map->map_file);
+ return FALSE;
+ }
+ }
+
/* check to see if this map actually exists */
yperr = yp_match(map->map_domain, map->map_file, "@", 1,
&vp, &vsize);