[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30785: Man pages truncated, repeated
From: |
Ludovic Courtès |
Subject: |
bug#30785: Man pages truncated, repeated |
Date: |
Mon, 14 Jan 2019 21:27:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Danny Milosavljevic <address@hidden> skribis:
> On Mon, 14 Jan 2019 18:48:53 +0100
> Danny Milosavljevic <address@hidden> wrote:
>
>> set_current_prefix() searches for the current program executable file in
>> $PATH,
>> and it can fail and return 0.
>>
>> In that case, relocatep will probably segfault at the location marked below:
>>
>> > char *relocated_path = new char[curr_prefix_len + relative_path_len + 1];
>> > strcpy(relocated_path, curr_prefix);
>> ^^^^^^^^^^^
>
> This probably happens when argv[0] is not an absolute path, but still the
> program
> somehow got started, but it is not found in $PATH either.
The ‘set_current_prefix’ logic is extremely fragile; it should readlink
from /proc/self/exe on GNU/Linux.
But in our case, no relocation happens, so we can just patch it to do:
void set_current_prefix (void)
{
curr_prefix = "/gnu/store/…";
}
Ludo’.
- bug#30785: Man pages truncated, repeated, (continued)
- bug#30785: Man pages truncated, repeated, Gábor Boskovits, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated, Ludovic Courtès, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated,
Ludovic Courtès <=
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/14
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/14
- bug#30785: Man pages truncated, repeated, Ludovic Courtès, 2019/01/15
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/16
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/16
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/16
- bug#30785: Man pages truncated, repeated, Danny Milosavljevic, 2019/01/16
- bug#30785: Man pages truncated, repeated, Pierre Neidhardt, 2019/01/16