From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnVVa-0002ZK-Kt for qemu-devel@nongnu.org; Wed, 29 Apr 2015 13:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnVVT-0004kW-EH for qemu-devel@nongnu.org; Wed, 29 Apr 2015 13:10:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnVVT-0004kS-5V for qemu-devel@nongnu.org; Wed, 29 Apr 2015 13:10:43 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3THAfBw001514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 29 Apr 2015 13:10:42 -0400 Message-ID: <55411090.3070204@redhat.com> Date: Wed, 29 Apr 2015 11:10:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <3d1c0b890723c377d9aa5c3bf416097e3cea90b3.1430325445.git.crobinso@redhat.com> <039dc3828328fe8cb59e2b74936bc67e9f01581f.1430326928.git.crobinso@redhat.com> In-Reply-To: <039dc3828328fe8cb59e2b74936bc67e9f01581f.1430326928.git.crobinso@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="udbHJ9FgaGILf0hdiQLkFBegtoAf4LsPf" Subject: Re: [Qemu-devel] [PATCH v2] qemu-sockets: Report explicit error if unlink fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson , qemu-devel@nongnu.org Cc: Gerd Hoffmann This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --udbHJ9FgaGILf0hdiQLkFBegtoAf4LsPf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/29/2015 11:03 AM, Cole Robinson wrote: > Consider this case: >=20 > $ ls -ld ~/root-owned/ > drwx--x--x. 2 root root 4096 Apr 29 12:55 /home/crobinso/root-owned/ > $ ls -l ~/root-owned/foo.sock > -rwxrwxrwx. 1 crobinso crobinso 0 Apr 29 12:55 /home/crobinso/root-owne= d/foo.sock >=20 > $ qemu-system-x86_64 -vnc unix:~/root-owned/foo.sock > qemu-system-x86_64: -vnc unix:/home/crobinso/root-owned/foo.sock: Faile= d to start VNC server: Failed to bind socket to /home/crobinso/root-owned= /foo.sock: Address already in use >=20 > ...which is techinically true, but the real error is that we failed to > unlink. So report it. >=20 > This may seem pathological but it's a real possibility via libvirt. >=20 > Signed-off-by: Cole Robinson > --- > Sigh, sent an old version of the patch accidentally >=20 > v2: > Fix the access check > Better commit message Sigh, and I was too hasty in my review of v1 to notice the logic bug in access() use. v2 is definitely better: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --udbHJ9FgaGILf0hdiQLkFBegtoAf4LsPf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVQRCQAAoJEKeha0olJ0NqJKUH/iK/rYKY80csBX/0RrT388Dr jckvOikTZeSb1KAPhfQVRrrlXovjPE1u5HsnUCxy4MGW1cEk00h1MM5L/EjzEOQE 5ZMjL0WWpvB/qF2GPC5F+X/fZWQtwUIWZ2+7+lrybmUfWebVvra0J9A8LYCp12/w +bUStQ8gizmvi8hKwe3NlGgjxeN9KWYxj4lxhOOFJr4DlFxotLzTgjbQNVv/dj4D ZFWZ9PkfDvjOmNq+YPKwXUeibTupAaMfvrvMA+dSQK2JsyxadH9+xvuiMHkALGDz BTE3ggMLFes+ftlj0qcd5fuA3orsTMd7G4wYXUfBAWDI1tSZpwJjBbnKfSsvX+s= =1Ynq -----END PGP SIGNATURE----- --udbHJ9FgaGILf0hdiQLkFBegtoAf4LsPf--