From ba2f9d8b1f9ac3ecc46229d128d45efbb3862fd584d3911ecc948fe27c2e95ef Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 1 Jul 2014 15:33:06 +0000 Subject: [PATCH] - fix file overwriting of hv_fcopy_daemon OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=96 --- hyper-v.changes | 5 +++++ hyper-v.tools.hv.hv_fcopy_daemon.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hyper-v.changes b/hyper-v.changes index d5faa2d..274c4a7 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 1 17:32:30 CEST 2014 - ohering@suse.de + +- fix file overwriting of hv_fcopy_daemon + ------------------------------------------------------------------- Mon May 26 15:50:21 CEST 2014 - ohering@suse.de diff --git a/hyper-v.tools.hv.hv_fcopy_daemon.c b/hyper-v.tools.hv.hv_fcopy_daemon.c index 22234b6..853e696 100644 --- a/hyper-v.tools.hv.hv_fcopy_daemon.c +++ b/hyper-v.tools.hv.hv_fcopy_daemon.c @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg) } } - target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744); + target_fd = open(target_fname, + O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744); if (target_fd == -1) { syslog(LOG_INFO, "Open Failed: %s", strerror(errno)); goto done;