[Buildroot] [PATCH v2] package/haveged: bump version to 1.9.14

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Jul 25 21:41:07 UTC 2021


Hello,

On Wed, 31 Mar 2021 22:07:10 +0200
"Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:

> Are you sure this is correct? Later on in that file, 'path' is forcibly
> assigned as thus:
> 
>     200       path[0] = '/';
> 
> And then, 'path' is used to start the daemon:
> 
>     527    else run_daemon(handle, path, argv);
> 
> So, if the original argv[0] does not start with a '/' (e.g. because it
> is called from the PATH), then 'path' will contain a mangled program
> name:
> 
>     argv[0] = "haveged"
>     path = strdup(argv[0]) = "haveged"
> 
> and thus with line 200:
>     path = "/aveged"
> 
> Did I miss something?

I agree with you that this is weird. *But* if you look at
https://github.com/jirka-h/haveged/commit/26d35af198da01220ba4f7a1b987f17012476c00#diff-043ded6506fb937c60ed15d0e9cfe02d6de6c72bcbd0bb14b7ad5e64ee7a6713L19
which is the commit that introduced this, they really just added the
<sys/auxv.h> usage as an additional thing if the path doesn't start
with /. So what Peter's patch does it make that new "feature" compile
time conditional, while it didn't exist at all before.

So with Peter's patch, on uClibc, you're just back to exactly how
haveged was behaving in its 1.9.13 version.

But I agree overall that all this string manipulation dance looks very
fragile :-/

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list