summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/map.c
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-05-13 21:20:56 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-05-13 21:20:56 +0000
commite9d3913b8e8939eb82d3476ea06ef58adea70da5 (patch)
tree6b5658c977aa7811d42bca65c85aeca35baaeabc /usr.sbin/smtpd/map.c
parent87b7d7c228a4305751170cba8b48bb727e7332c9 (diff)
log dbopen and db->get errors; based on diff from Daniel Ouellet.
looks ok to gilles@
Diffstat (limited to 'usr.sbin/smtpd/map.c')
-rw-r--r--usr.sbin/smtpd/map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/map.c b/usr.sbin/smtpd/map.c
index f9db97397d5..28466c02462 100644
--- a/usr.sbin/smtpd/map.c
+++ b/usr.sbin/smtpd/map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: map.c,v 1.5 2009/03/06 23:38:18 gilles Exp $ */
+/* $OpenBSD: map.c,v 1.6 2009/05/13 21:20:55 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -76,13 +76,16 @@ map_dblookup(struct smtpd *env, char *mapname, char *keyname)
}
db = dbopen(map->m_config, O_RDONLY, 0600, DB_HASH, NULL);
- if (db == NULL)
+ if (db == NULL) {
+ log_warn("map_dblookup: can't open %s", map->m_config);
return NULL;
+ }
key.data = keyname;
key.size = strlen(key.data) + 1;
if ((ret = db->get(db, &key, &val, 0)) == -1) {
+ log_warn("map_dblookup: map '%s'", mapname);
db->close(db);
return NULL;
}