[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 15/15] qga: unlink just created guest-file if fchmo
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 15/15] qga: unlink just created guest-file if fchmod() or fdopen() fails on it |
Date: |
Tue, 14 May 2013 16:53:12 -0500 |
From: Laszlo Ersek <address@hidden>
We shouldn't allow guest filesystem pollution on error paths.
Suggested-by: Eric Blake <address@hidden>
Signed-off-by: Laszlo Ersek <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
Signed-off-by: Michael Roth <address@hidden>
(cherry picked from commit 2b720018060179b394f8ce736983373ab80dd37c)
Signed-off-by: Michael Roth <address@hidden>
---
qga/commands-posix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 933c700..e439851 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -277,6 +277,9 @@ safe_open_or_create(const char *path, const char *mode,
Error **err)
}
close(fd);
+ if (oflag & O_CREAT) {
+ unlink(path);
+ }
}
}
--
1.7.9.5
- [Qemu-stable] [PATCH 05/15] virtio-ccw: Check indicators location., (continued)
- [Qemu-stable] [PATCH 05/15] virtio-ccw: Check indicators location., Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 06/15] configure: Pick up libseccomp include path, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 07/15] target-mips: Fix accumulator arguments to gen_helper_dmult(u), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 08/15] tcg/optimize: fix setcond2 optimization, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 09/15] qga: set umask 0077 when daemonizing (CVE-2013-2007), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 10/15] tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 11/15] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 13/15] translate-all.c: Remove cpu_unlink_tb(), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 12/15] Handle CPU interrupts by inline checking of a flag, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 14/15] qga: distinguish binary modes in "guest_file_open_modes" map, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 15/15] qga: unlink just created guest-file if fchmod() or fdopen() fails on it,
Michael Roth <=
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Michael Tokarev, 2013/05/15
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Brad Smith, 2013/05/15
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Cole Robinson, 2013/05/15
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Luiz Capitulino, 2013/05/17
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Doug Goldstein, 2013/05/17