Bug#1033311: sysvinit-utils: pidof not always returning a pid when using the full path to a program

Markus Fischer ivanhoe at fiscari.de
Tue Mar 28 14:56:23 BST 2023


I did a few more tests of my own and didn't find any other issues.

- Markus

Am 24.03.23 um 15:17 schrieb Jesse Smith:
> 
> 
> On 2023-03-24 6:44 a.m., Markus Fischer wrote:
>> I think I've figured it out. With the following patch I don't see the
>> unexpected behaviour anymore:
>>
>> --- a/src/killall5.c
>> +++ b/src/killall5.c
>> @@ -662,6 +662,7 @@ int readproc()
>>                  /* Try to stat the executable. */
>>                  snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
>>                   p->pathname = (char *)xmalloc(PATH_MAX);
>> +               memset(p->pathname, 0, PATH_MAX);
>>                  if (readlink(path, p->pathname, PATH_MAX) == -1) {
>>                          p->pathname = NULL;
>>                  }
>>
> 
> This patch looks good to me. I'm adding it upstream.
> 
> Will run some more tests before publishing 3.07. And would appreciate it
> if everyone following this issue could test too and provide feedback.
> 
> - Jesse
> 



More information about the Debian-init-diversity mailing list