From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lgt7L-0004k3-5u for qemu-devel@nongnu.org; Mon, 09 Mar 2009 23:58:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lgt7J-0004jp-P4 for qemu-devel@nongnu.org; Mon, 09 Mar 2009 23:58:57 -0400 Received: from [199.232.76.173] (port=37611 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lgt7J-0004jm-Ho for qemu-devel@nongnu.org; Mon, 09 Mar 2009 23:58:57 -0400 Received: from mx2.redhat.com ([66.187.237.31]:34999) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lgt7I-00048Q-Tw for qemu-devel@nongnu.org; Mon, 09 Mar 2009 23:58:57 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2A3wtOP019914 for ; Mon, 9 Mar 2009 23:58:55 -0400 Date: Tue, 10 Mar 2009 09:29:07 +0530 From: Amit Shah Subject: Re: [Qemu-devel] [PATCH][RFC] Handling ':' on filenames Message-ID: <20090310035907.GA3639@amit-x200.pnq.redhat.com> References: <20090306212830.GL5077@blackpad> <49B3ABDF.2080803@redhat.com> <1236608548-sup-9812@blackpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1236608548-sup-9812@blackpad> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm_autotest On (Mon) Mar 09 2009 [11:27:53], Eduardo Habkost wrote: > > > + > > > + /* Protocol name will never start with a slash. > > > + * This allows the user to specify absolute filenames > > > + * containing a ":" character. > > > + */ > > > + if (*filename == '/') > > > + return &bdrv_raw; > > > > 3. The patch limits protocols names to not start with '/' (full paths). > > I think we should apply the same logic to relative paths, so > > protocol names would not start with '.' as well (no protocol > > starts with '.' today): > > > > + if ((*filename == '/') || (*filename == '.')) > > + return &bdrv_raw; > > Is ':' a valid character for Windows filenames? In this case, we > may want to check for backslashes also. I guess so; full paths are (at least used to be) something like "C:\some-dir\some-file" Amit