From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BDCBC05027 for ; Fri, 10 Feb 2023 18:53:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.493584.763578 (Exim 4.92) (envelope-from ) id 1pQYWd-0006KF-A6; Fri, 10 Feb 2023 18:53:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 493584.763578; Fri, 10 Feb 2023 18:53:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pQYWd-0006Jr-5r; Fri, 10 Feb 2023 18:53:35 +0000 Received: by outflank-mailman (input) for mailman id 493584; Fri, 10 Feb 2023 18:53:33 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pQYWb-0006J4-QO for xen-devel@lists.xenproject.org; Fri, 10 Feb 2023 18:53:33 +0000 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 355a1b2a-a974-11ed-93b5-47a8fe42b414; Fri, 10 Feb 2023 19:53:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 51E1320162; Fri, 10 Feb 2023 19:53:29 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5qNXIv7BGRAa; Fri, 10 Feb 2023 19:53:29 +0100 (CET) Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr [92.158.138.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 2AD872015E; Fri, 10 Feb 2023 19:53:29 +0100 (CET) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pQYWW-006gXg-2V; Fri, 10 Feb 2023 19:53:28 +0100 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 355a1b2a-a974-11ed-93b5-47a8fe42b414 Date: Fri, 10 Feb 2023 19:53:28 +0100 From: Samuel Thibault To: Juergen Gross Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org Subject: Re: [PATCH v2 6/7] Mini-OS: add open and close handling to the 9pfs frontend Message-ID: <20230210185328.2zqo5xvklpke3ie2@begin> Mail-Followup-To: Samuel Thibault , Juergen Gross , minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org, wl@xen.org References: <20230210104628.14374-1-jgross@suse.com> <20230210104628.14374-7-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230210104628.14374-7-jgross@suse.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) Juergen Gross, le ven. 10 févr. 2023 11:46:27 +0100, a ecrit: > +static bool path_canonical(const char *pathname) > +{ > + unsigned int len = strlen(pathname); > + const char *c; > + > + /* Empty path is allowed. */ > + if ( !len ) > + return true; > + > + /* No trailing '/'. */ > + if ( pathname[len - 1] == '/' ) > + return false; > + > + /* No self or parent references. */ > + c = pathname; > + while ( (c = strstr(c, "/.")) != NULL ) > + { > + if ( c[2] == '.' ) > + c++; > + if ( c[2] == 0 || c[2] == '/' ) > + return false; > + c += 2; > + } > + > + return true; > +} This doesn't seem to be catching "//"? Samuel