GNU bug report logs - #30785
Man pages truncated, repeated

Previous Next

Package: guix;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Mon, 12 Mar 2018 21:26:01 UTC

Severity: minor

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Pierre Neidhardt <mail <at> ambrevar.xyz>, 30785 <at> debbugs.gnu.org
Subject: bug#30785: Man pages truncated, repeated
Date: Mon, 14 Jan 2019 21:27:35 +0100
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> On Mon, 14 Jan 2019 18:48:53 +0100
> Danny Milosavljevic <dannym <at> scratchpost.org> 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’.




This bug report was last modified 4 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.