From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CTeQDJCA919TFQAAWB0awg (envelope-from ) for ; Thu, 07 Jan 2021 16:43:44 -0500 Received: by simark.ca (Postfix, from userid 112) id 25EB61E965; Thu, 7 Jan 2021 16:43:44 -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 7AF501E519 for ; Thu, 7 Jan 2021 16:43:43 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 046063858023; Thu, 7 Jan 2021 21:43:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 046063858023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610055823; bh=w/5dVruGbd8Zxi1TcGDEGDfLL3acsda5buFbW5qBnYU=; 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=EZ49gsOKHUbalcfwMDadTiMRGsr52cz9Pxxo2MWAsIuJloXgdLa/YJxVLPvZYhX+h vagqA1VgozHwLkfQbc3Jo6Jx5rlW3G2pKVkSO9PKNyLr9ks/YqsK8Z+OJPpwfHlczN U759+S87vv8Ev14C/+wHamWxonHgR5sc1cQnxnvs= Received: from beryx.lancelotsix.com (beryx.lancelotsix.com [164.132.98.193]) by sourceware.org (Postfix) with ESMTPS id 7487B3858023 for ; Thu, 7 Jan 2021 21:43:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7487B3858023 Received: from [IPv6:2a02:390:8443:0:ac3f:305a:5a38:83cc] (unknown [IPv6:2a02:390:8443:0:ac3f:305a:5a38:83cc]) by beryx.lancelotsix.com (Postfix) with ESMTPSA id 102B02E070; Thu, 7 Jan 2021 22:43:38 +0100 (CET) Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir To: Simon Marchi , 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> Message-ID: <21cd6bb7-f220-37c6-eef8-ede223a761ae@lancelotsix.com> Date: Thu, 7 Jan 2021 21:43:37 +0000 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: <69b9d1e9-ec9c-5bdc-4255-4f59440c0b5f@efficios.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (beryx.lancelotsix.com [0.0.0.0]); Thu, 07 Jan 2021 22:43:38 +0100 (CET) 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: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: sourcewarebugz@kyber.fi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 suppose that it is, since it's just a shortcut for > /home/smarchi. This actually is the most usual pattern, but the home directory of smarchi could be different. The actual answer is in /etc/passwd or accessed via getent: $ getent passwd smarchi | awk -F: '{ print $6 }' > > Simon Lancelot.