From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Lancelot SIX <lsix@lancelotsix.com>, Tom Tromey <tom@tromey.com>,
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: sourcewarebugz@kyber.fi
Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir
Date: Thu, 7 Jan 2021 16:53:10 -0500 [thread overview]
Message-ID: <16b61c65-e8d0-d744-85f0-ca3d79439ca4@efficios.com> (raw)
In-Reply-To: <21cd6bb7-f220-37c6-eef8-ede223a761ae@lancelotsix.com>
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. 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 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.
>
> 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 }'
Right. If we want to support it, we would presumably use gdb_tilde_expand,
which uses glob(3), which gets the real user home.
What's annoying though is that glob won't work with non-existent directories.
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 support
non-existent paths.
Simon
next prev parent reply other threads:[~2021-01-07 21:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 20:57 Simon Marchi via Gdb-patches
2021-01-07 21:00 ` Tom Tromey
2021-01-07 21:14 ` Simon Marchi via Gdb-patches
2021-01-07 21:43 ` Lancelot SIX via Gdb-patches
2021-01-07 21:53 ` Simon Marchi via Gdb-patches [this message]
2021-01-07 22:04 ` Lancelot SIX via Gdb-patches
2021-01-07 22:10 ` Simon Marchi via Gdb-patches
2021-01-07 23:39 ` Sergio Durigan Junior via Gdb-patches
2021-01-08 9:45 ` Andrew Burgess
2021-01-08 11:05 ` Christian Biesinger via Gdb-patches
2021-01-08 9:48 ` Andrew Burgess
2021-01-08 15:50 ` [PATCH v2] gdb: check for empty strings in, get_standard_cache_dir/get_standard_config_dir Simon Marchi via Gdb-patches
2021-01-08 17:13 ` Andrew Burgess
2021-01-08 18:47 ` Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16b61c65-e8d0-d744-85f0-ca3d79439ca4@efficios.com \
--to=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=simon.marchi@efficios.com \
--cc=sourcewarebugz@kyber.fi \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox