OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8fe6bbc
)
qga: unlink just created guest-file if fchmod() or fdopen() fails on it
author
Laszlo Ersek
<lersek@redhat.com>
Wed, 8 May 2013 15:31:36 +0000
(17:31 +0200)
committer
Michael Roth
<mdroth@linux.vnet.ibm.com>
Mon, 13 May 2013 14:45:49 +0000
(09:45 -0500)
We shouldn't allow guest filesystem pollution on error paths.
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-posix.c
patch
|
blob
|
history
diff --git
a/qga/commands-posix.c
b/qga/commands-posix.c
index
2eec712
..
e199738
100644
(file)
--- a/
qga/commands-posix.c
+++ b/
qga/commands-posix.c
@@
-355,6
+355,9
@@
safe_open_or_create(const char *path, const char *mode, Error **err)
}
close(fd);
+ if (oflag & O_CREAT) {
+ unlink(path);
+ }
}
}