[systemd-devel] [systemd-commits] 4 commits - .gitignore Makefile.am man/sd_journal_print.xml man/systemd.xml src/core src/journal src/shared src/test

Kay Sievers kay at vrfy.org
Tue Jan 28 03:45:51 PST 2014


On Tue, Jan 28, 2014 at 12:27 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Mon, 27.01.14 20:17, Zbigniew Jędrzejewski-Szmek (zbyszek at kemper.freedesktop.org) wrote:

>> +        uint64_t tries = TMP_MAX;
>> +        int randfd, fd, i;
>> +
>> +        assert(streq(s, "XXXXXX"));
>> +
>> +        randfd = open("/dev/urandom", O_RDONLY);
>> +        if (randfd < 0)
>> +                return -ENOSYS;
>
> There's random_bytes() already, which is similar to this... It might
> make sense to use that here, maybe with an additional argument that
> tells it to never fallback to PRNG.

What it the point of all of this? Glibc uses gettimeofday or/and the
TSC for the random, in a retry loop. What problem is this patch
supposed to solve?

Kay


More information about the systemd-devel mailing list