From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beoJg-0003KJ-L3 for qemu-devel@nongnu.org; Tue, 30 Aug 2016 15:03:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beoJd-00075d-WC for qemu-devel@nongnu.org; Tue, 30 Aug 2016 15:03:24 -0400 Received: from 1.mo179.mail-out.ovh.net ([178.33.111.220]:44788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beoJd-000757-Pr for qemu-devel@nongnu.org; Tue, 30 Aug 2016 15:03:21 -0400 Received: from player698.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 63ED81004A67 for ; Tue, 30 Aug 2016 21:03:20 +0200 (CEST) Date: Tue, 30 Aug 2016 21:03:11 +0200 From: Greg Kurz Message-ID: <20160830210311.73bf7e86@bahia.lan> In-Reply-To: <89ab411b-ef71-9521-53ec-81300ba32b2b@redhat.com> References: <147257704749.28515.17213711886150247423.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <147257707176.28515.1734765316772223928.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <89ab411b-ef71-9521-53ec-81300ba32b2b@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/O8DjpDELt./wLjVjoMuza9m"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [PATCH v4 2/3] 9pfs: forbid . and .. in file names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Peter Maydell , Felix Wilhelm , "Michael S. Tsirkin" , P J P , "Aneesh Kumar K.V" --Sig_/O8DjpDELt./wLjVjoMuza9m Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 30 Aug 2016 13:06:31 -0500 Eric Blake wrote: > On 08/30/2016 12:13 PM, Greg Kurz wrote: > > According to the 9P spec http://man.cat-v.org/plan_9/5/open about the > > create request: > >=20 > > The names . and .. are special; it is illegal to create files with these > > names. > >=20 > > This patch causes the create and lcreate requests to fail with EINVAL if > > the file name is either "." or "..". > >=20 > > Even if it isn't explicitly written in the spec, this patch extends the > > checking to all requests that may cause a directory entry to be created: > >=20 > > - mknod > > - rename > > - renameat > > - mkdir > > - link > > - symlink > >=20 > > The unlinkat request also gets patched for consistency (even if > > rmdir("foo/..") is expected to fail according to POSIX.1-2001). > >=20 > > The various error values come from the linux manual pages. > >=20 > > Suggested-by: Peter Maydell > > Signed-off-by: Greg Kurz > >=20 > > v3: - rename and renameat now return EISDIR instead of EBUSY =20 >=20 > The v3 comment could occur after the '---' separator. >=20 Yes of course. Sorry for the other patches as well :) > > --- > > hw/9pfs/9p.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 51 insertions(+) =20 >=20 > Maintainer can touch that up, then add > Reviewed-by: Eric Blake >=20 --Sig_/O8DjpDELt./wLjVjoMuza9m Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlfF2G8ACgkQAvw66wEB28JRvQCffcfwQ0YFDmz1LuLUm89jomq5 uG8AoKM18Iz1If0F1ErpIN0SBnbagro0 =l8qt -----END PGP SIGNATURE----- --Sig_/O8DjpDELt./wLjVjoMuza9m--