From bb96f3c3dbd312cd82ed6248b81bede86eca90b4 Mon Sep 17 00:00:00 2001 From: tedu Date: Thu, 9 Jan 2014 19:05:21 +0000 Subject: [PATCH] change O_EXCL to O_TRUNC before deraadt kills me. --- usr.bin/signify/signify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 7395ca34b68..bf0fd3ebb22 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.18 2014/01/09 18:59:35 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.19 2014/01/09 19:05:21 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -214,7 +214,7 @@ writeb64file(const char *filename, const char *comment, const void *buf, char b64[1024]; int fd, rv; - fd = xopen(filename, O_CREAT|O_EXCL|O_NOFOLLOW|O_RDWR, mode); + fd = xopen(filename, O_CREAT|O_TRUNC|O_NOFOLLOW|O_RDWR, mode); snprintf(header, sizeof(header), "%ssignify %s\n", COMMENTHDR, comment); writeall(fd, header, strlen(header), filename); @@ -389,7 +389,7 @@ verify(const char *pubkeyfile, const char *msgfile, const char *sigfile, verifymsg(pubkey.pubkey, msg, msglen, sig.sig); if (embedded) { - fd = xopen(msgfile, O_CREAT|O_EXCL|O_NOFOLLOW|O_RDWR, 0666); + fd = xopen(msgfile, O_CREAT|O_TRUNC|O_NOFOLLOW|O_RDWR, 0666); writeall(fd, msg, msglen, msgfile); close(fd); } -- 2.20.1