From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsiFN-00004r-BV for qemu-devel@nongnu.org; Tue, 08 Jan 2013 18:06:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsiFM-000702-7a for qemu-devel@nongnu.org; Tue, 08 Jan 2013 18:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsiFM-0006zx-0R for qemu-devel@nongnu.org; Tue, 08 Jan 2013 18:06:16 -0500 Message-ID: <50ECA663.2030309@redhat.com> Date: Tue, 08 Jan 2013 16:06:11 -0700 From: Eric Blake MIME-Version: 1.0 References: <1357680386-10904-1-git-send-email-lcapitulino@redhat.com> <1357680386-10904-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1357680386-10904-2-git-send-email-lcapitulino@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAC1565F211DDDE0A81F13D47" Subject: Re: [Qemu-devel] [PATCH 1/2] qemu-ga: ga_open_pidfile(): use qemu_open() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAC1565F211DDDE0A81F13D47 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/08/2013 02:26 PM, Luiz Capitulino wrote: > This ensures that O_CLOEXEC is passed to open(), this way the > pid file fd is not leaked to executed processes. >=20 > Signed-off-by: Luiz Capitulino > --- > qga/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > diff --git a/qga/main.c b/qga/main.c > index ba5fa1c..e4245cc 100644 > --- a/qga/main.c > +++ b/qga/main.c > @@ -242,7 +242,7 @@ static bool ga_open_pidfile(const char *pidfile) > int pidfd; > char pidstr[32]; > =20 > - pidfd =3D open(pidfile, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR); > + pidfd =3D qemu_open(pidfile, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR); > if (pidfd =3D=3D -1 || lockf(pidfd, F_TLOCK, 0)) { > g_critical("Cannot lock pid file, %s", strerror(errno)); > if (pidfd !=3D -1) { >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAC1565F211DDDE0A81F13D47 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ7KZkAAoJEKeha0olJ0NqACkIAK9XHqB7Ixpp8k9Z1vrnZfee 1zTN8e5BASbOZwghOncvAn8HqdTQgPu+yzSL8t1SpTn2BNen6ZUdSHrsSA/u+W2J kjIm8HX+YFnuYbT/bS50tPSWD6QV3GYlyf3oQxeyBTwi8QdKCgfbTr5Ny0myZ9E+ dsqdG3jBHqL3zAPX9PUHzw64a/CjjsGspwAoAaPVevLQ71b/s37Y7VyeuMgE2MGz CnyIjI0wUaiSVZTvTfcF/Pjmi+jFi3eys/rEgUtQ233J0x+ktJ3Qm+6ozGTZC6ud wYFZhVjYaBQC/OV/p2UwLyejpKG5JaQ+8YK3b8wRg4TmqIAkoQD7uYmi3etWtX4= =prb4 -----END PGP SIGNATURE----- --------------enigAC1565F211DDDE0A81F13D47--