From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iD35Ersp+F8yJwAAWB0awg (envelope-from ) for ; Fri, 08 Jan 2021 04:45:31 -0500 Received: by simark.ca (Postfix, from userid 112) id 3A04B1E99A; Fri, 8 Jan 2021 04:45:31 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B859E1E4F4; Fri, 8 Jan 2021 04:45:30 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B4A93844026; Fri, 8 Jan 2021 09:45:30 +0000 (GMT) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 3276D3844026 for ; Fri, 8 Jan 2021 09:45:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3276D3844026 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x42d.google.com with SMTP id r7so8343540wrc.5 for ; Fri, 08 Jan 2021 01:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rBSi4tFwYGVyWLh5LuheyvWCZVDIwUptTlLHJ7z/eQM=; b=Ni+czRkqHp8kwABOTiaTm/MGMIjZ8NkKh10BP1/X6tDtocYV8KcgJikk3mo0pDERg0 AhBCtHn2//KvW/dF+foGeCrxsBxUmPulURRaSEItinjdxduZTh+raEQQvjT2Ro4Hf5Cg +yKjWJf2G9x+6hWhMuNewk0lpoOBYi3Yi7zNdlooy4XkcXo0RV2Cbe96/R6nIryHM50a mUXqdyue+VpUkc7vHVgmmhFDIXv1acaw0yFifaiQ6j9H6e3KcFLOERFKecILupVlUCd9 QbubOvuARcAEdDEJOAO/bQO4TL9kd1I2om8EBNDsVhlyP4tOr6R9+uaokLSGzlTo3oj6 dAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rBSi4tFwYGVyWLh5LuheyvWCZVDIwUptTlLHJ7z/eQM=; b=kIRgJaZyGTeUw36AjhXLB3GgvpcPB/LEvENFbSIPpmo42I1vRV87ypo2BZfwpuNTS6 fRi0X99kZTk85VLHaAx0Yaac7lBelT6e1q24HUTcby3X6F6+Fw+QQ6JrUYS5gMy/Ykvm fK7JkPvJymFNq9G3rxayoN9G8qHhocN4CbRE/QElEe5K3VLp1HQAwWyy1uIyzfBgVTGJ ndI1SuS4xqtalv5wW25PL8LnBbsrXv0wRab9Q4gUC5qwexqLhNrE1VuCLYMvt2AWA7pG 5z2cI7asEaJ9dYnI4BG81hBY6N/Qvu1B03Q/uFnBaueJmHeRsLTZR3oBxXkwAaLrzTGc 7H3A== X-Gm-Message-State: AOAM531QZciY5rh+MiRy9KoVeaTXR3RtS6ecCmOJonbxqdMMN0vHrH7H Rhl726yarnAxeBZt6zdYhTJNj8bjaPc8tQ== X-Google-Smtp-Source: ABdhPJzPqL1XZlgJjCjRegziWMaBfcETscdZ7wR2iqG7+hKsoROs+7Z+WiHu4oxRzoAapDNwtvWfpg== X-Received: by 2002:a05:6000:18c:: with SMTP id p12mr2712595wrx.7.1610099126334; Fri, 08 Jan 2021 01:45:26 -0800 (PST) Received: from localhost (host86-166-129-230.range86-166.btcentralplus.com. [86.166.129.230]) by smtp.gmail.com with ESMTPSA id v11sm12570551wrt.25.2021.01.08.01.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 01:45:25 -0800 (PST) Date: Fri, 8 Jan 2021 09:45:24 +0000 From: Andrew Burgess To: Lancelot SIX Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir Message-ID: <20210108094524.GS2945@embecosm.com> References: <20210107205725.2010353-1-simon.marchi@efficios.com> <87pn2gv4wh.fsf@tromey.com> <69b9d1e9-ec9c-5bdc-4255-4f59440c0b5f@efficios.com> <21cd6bb7-f220-37c6-eef8-ede223a761ae@lancelotsix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21cd6bb7-f220-37c6-eef8-ede223a761ae@lancelotsix.com> X-Operating-System: Linux/5.8.13-100.fc31.x86_64 (x86_64) X-Uptime: 09:35:10 up 30 days, 14:19, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Marchi , Tom Tromey , Simon Marchi via Gdb-patches , sourcewarebugz@kyber.fi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" * Lancelot SIX via Gdb-patches [2021-01-07 21:43:37 +0000]: > Hi > > Ok, I can try this as a follow-up patch, check that the path > > is absolute using the IS_ABSOLUTE_PATH macro. Is a tilde path > > considered absolute? Like > > > > ~/my-cache > > ~smarchi/my-cache > I would be tempted to say that it is not (according to > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html it > seems it is not). I guess you're suggesting it's not because it doesn't start with a slash? However, isn't ~ expansion something a tool does, not a file system thing? So '~/my-cache' as a path is really asking to open ${CWD}/~/my-cache, it's just that many tools actually choose to modify any incoming path starting with ~. So, is '~/my-cache' absolute? No, as an incoming request from the user, I agree with you it is not. But, GDB attaches special meaning to paths starting with ~, and converts them into absolute paths... I think we already agreed not to change this behaviour anyway, so I probably shouldn't even be writing this.... Thanks, Andrew