From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QrWwJ8uC918nFwAAWB0awg (envelope-from ) for ; Thu, 07 Jan 2021 16:53:15 -0500 Received: by simark.ca (Postfix, from userid 112) id 949AC1E965; Thu, 7 Jan 2021 16:53:15 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 E26D01E519 for ; Thu, 7 Jan 2021 16:53:14 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9435F386F427; Thu, 7 Jan 2021 21:53:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9435F386F427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610056394; bh=56nMOssILLpVj48Acd0j1ENu28mK+iNEWBwPyHNJWgM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bW2c4I4S/kkoDYtIwtuoLdaRteoUmcx+T4i67BKwvj9H2z+++yobhKcjrmVNgt0xD iAtz7AE7FIQhlYw+yfZOUDkVJUfEgoWQVVQ9oP84O/8JW1NkFweChmcPvegamKfxtd qPi5bne/BnFv6rDDkuG6aClp/M0B+5QRSK9vzGbU= Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id BF2B0386F427 for ; Thu, 7 Jan 2021 21:53:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BF2B0386F427 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 890582E3033; Thu, 7 Jan 2021 16:53:11 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id F0u4OX0_fQU2; Thu, 7 Jan 2021 16:53:11 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 506512E2FA1; Thu, 7 Jan 2021 16:53:11 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 506512E2FA1 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AMfk33uyk5Dj; Thu, 7 Jan 2021 16:53:11 -0500 (EST) Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by mail.efficios.com (Postfix) with ESMTPSA id 254BE2E2F9E; Thu, 7 Jan 2021 16:53:11 -0500 (EST) Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir To: Lancelot SIX , Tom Tromey , Simon Marchi via Gdb-patches 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> Message-ID: <16b61c65-e8d0-d744-85f0-ca3d79439ca4@efficios.com> Date: Thu, 7 Jan 2021 16:53:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <21cd6bb7-f220-37c6-eef8-ede223a761ae@lancelotsix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: sourcewarebugz@kyber.fi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-07 4:43 p.m., Lancelot SIX wrote: > Hi >> Ok, I can try this as a follow-up patch, check that the path >> is absolute using the IS_ABSOLUTE_PATH macro.=C2=A0 Is a tilde path >> considered absolute? Like >> >> =C2=A0=C2=A0 ~/my-cache >> =C2=A0=C2=A0 ~smarchi/my-cache > I would be tempted to say that it is not (according to https://pubs.ope= ngroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html it seems it is n= ot). I wouldn't mind not supporting tilde paths, but since it worked up to now= , it could be seen as a regression by some. >> I suppose that it is, since it's just a shortcut for >> /home/smarchi. >=20 > This actually is the most usual pattern, but the home directory of smar= chi could be different. The actual answer is in /etc/passwd or accessed v= ia getent: >=20 > $ getent passwd smarchi | awk -F: '{ print $6 }' Right. If we want to support it, we would presumably use gdb_tilde_expan= d, which uses glob(3), which gets the real user home. What's annoying though is that glob won't work with non-existent director= ies. So if I use /home/smarchi/my/non/existent/directory it is accepted, and these directories will be created. But I set ~/my/non/existent/directory gdb_tilde_expand will fail. Perhaps it's just a limitation of gdb_tilde_= expand, and it should be changed to use something else than glob(3) in order to s= upport non-existent paths. Simon