summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2016-02-10 09:23:53 +0000
committergilles <gilles@openbsd.org>2016-02-10 09:23:53 +0000
commit6a328ef6d58663dfc8c3a518f011b7c8c38ad56f (patch)
treeb6ad08d4c849792be9c84d2c92fd7d07e66bfdb0
parentPermit negative x and y coordinates in mouse.scale for uts and ums. (diff)
downloadwireguard-openbsd-6a328ef6d58663dfc8c3a518f011b7c8c38ad56f.tar.xz
wireguard-openbsd-6a328ef6d58663dfc8c3a518f011b7c8c38ad56f.zip
when creating a db map, we use a temporary file to work on and atomically
move to destination when done. this causes dbopen() to be called with an empty file which happens to... not work with other db libraries. adding O_TRUNC is noop for us, fixes the issue for other libraries and lets us reduce delta between us and portable. ok sunil@, ok eric@
-rw-r--r--usr.sbin/smtpd/makemap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c
index da0718c5590..c1c39d20ad2 100644
--- a/usr.sbin/smtpd/makemap.c
+++ b/usr.sbin/smtpd/makemap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: makemap.c,v 1.61 2015/12/28 22:08:30 jung Exp $ */
+/* $OpenBSD: makemap.c,v 1.62 2016/02/10 09:23:53 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -191,7 +191,7 @@ makemap(int argc, char *argv[])
if ((fd = mkstemp(dbname)) == -1)
err(1, "mkstemp");
- db = dbopen(dbname, O_RDWR, 0644, dbtype, NULL);
+ db = dbopen(dbname, O_TRUNC|O_RDWR, 0644, dbtype, NULL);
if (db == NULL) {
warn("dbopen: %s", dbname);
goto bad;