From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua7qh-00036K-5R for qemu-devel@nongnu.org; Wed, 08 May 2013 13:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ua7qf-00019g-T1 for qemu-devel@nongnu.org; Wed, 08 May 2013 13:08:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua7qf-00019b-Jf for qemu-devel@nongnu.org; Wed, 08 May 2013 13:08:13 -0400 Message-ID: <518A8651.7090903@redhat.com> Date: Wed, 08 May 2013 11:07:29 -0600 From: Eric Blake MIME-Version: 1.0 References: <1368027096-12108-1-git-send-email-lersek@redhat.com> <1368027096-12108-3-git-send-email-lersek@redhat.com> In-Reply-To: <1368027096-12108-3-git-send-email-lersek@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2AXRVKJAPHGHRASNXCAGI" Subject: Re: [Qemu-devel] [PATCH v2 2/2] qga: unlink just created guest-file if fchmod() or fdopen() fails on it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2AXRVKJAPHGHRASNXCAGI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/08/2013 09:31 AM, Laszlo Ersek wrote: > We shouldn't allow guest filesystem pollution on error paths. >=20 > Suggested-by: Eric Blake > Signed-off-by: Laszlo Ersek > --- > qga/commands-posix.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) Reviewed-by: Eric Blake >=20 > 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 *m= ode, Error **err) > } > =20 > close(fd); > + if (oflag & O_CREAT) { > + unlink(path); > + } > } > } > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2AXRVKJAPHGHRASNXCAGI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRioZRAAoJEKeha0olJ0Nqy8YH/Raf6R56E8+6YoamJOw9wMvs PzIf7oNhte1xf1OjbNNXN09KmRGXHKXlS3aGZ58uwUs6YHpF8a4hE2Gd/Ts8Pw0C 32fywVxwYF7f1YzE/R355ccXW5s0YXgcwbhXmOsqPW1UbtYDIQLL31xQEszB5rRA Lg82XhL1e2Gvb/DLlyYISVzfdApUfedyXWCKtekMFLr1BIcvnkCj74KfM0mf/bPY nsIs6Eaa6gnXxWY6m0B1DQyzjxZV9D3n78IRHa4KgB5CuGsgZ9wsq6AoQEDsnrI5 KPqYVlje2Xljm0gDDbGqiek2ZLE8TaUrRW6hSu5o/rNpyw6cYyOCBjTBBjAcmI8= =tlQc -----END PGP SIGNATURE----- ------enig2AXRVKJAPHGHRASNXCAGI--