From: Eric Blake <eblake@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qga: unlink just created guest-file if fchmod() or fdopen() fails on it
Date: Wed, 08 May 2013 11:07:29 -0600 [thread overview]
Message-ID: <518A8651.7090903@redhat.com> (raw)
In-Reply-To: <1368027096-12108-3-git-send-email-lersek@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 892 bytes --]
On 05/08/2013 09:31 AM, Laszlo Ersek wrote:
> 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>
> ---
> qga/commands-posix.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 2eec712..e199738 100644
> --- 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);
> + }
> }
> }
>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-05-08 17:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 15:31 [Qemu-devel] [PATCH v2 0/2] qga umask fix addenda Laszlo Ersek
2013-05-08 15:31 ` [Qemu-devel] [PATCH v2 1/2] qga: distinguish binary modes in "guest_file_open_modes" map Laszlo Ersek
2013-05-08 15:31 ` [Qemu-devel] [PATCH v2 2/2] qga: unlink just created guest-file if fchmod() or fdopen() fails on it Laszlo Ersek
2013-05-08 17:07 ` Eric Blake [this message]
2013-05-10 13:29 ` [Qemu-devel] [PATCH v2 0/2] qga umask fix addenda Luiz Capitulino
2013-05-10 19:30 ` mdroth
2013-05-10 19:53 ` Laszlo Ersek
2013-05-10 20:09 ` mdroth
2013-05-12 16:47 ` Andreas Färber
2013-05-13 11:33 ` mdroth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518A8651.7090903@redhat.com \
--to=eblake@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=lersek@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).