From: Petr Uzel <petr.uzel@suse.cz>
To: util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 3/3] libuuid: use randutils
Date: Thu, 3 May 2012 21:04:34 +0200 [thread overview]
Message-ID: <20120503190434.GA32558@skipper.site> (raw)
In-Reply-To: <20120410113150.GN19784@x2.net.home>
[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]
On Tue, Apr 10, 2012 at 01:31:50PM +0200, Karel Zak wrote:
> On Thu, Apr 05, 2012 at 11:52:10PM +0200, Davidlohr Bueso wrote:
> > libuuid/src/Makefile.am | 3 +-
> > libuuid/src/gen_uuid.c | 99 ++--------------------------------------------
> > 2 files changed, 7 insertions(+), 95 deletions(-)
>
> Applied, thanks.
>
> > @@ -703,7 +614,7 @@ void uuid_generate_random(uuid_t out)
> > */
> > void uuid_generate(uuid_t out)
> > {
> > - if (get_random_fd() >= 0)
> > + if (random_get_fd() >= 0)
> > uuid_generate_random(out);
>
> This sucks:
>
> - because we call random_get_fd() in __uuid_generate_random again:
>
> $ strace -e open ./misc-utils/uuidgen
> open("/dev/urandom", O_RDONLY) = 3
> open("/dev/urandom", O_RDONLY) = 4
>
> it would be better to add 'fd' argument to __uuid_generate_random(),
> use it in uuid_generate() and reuse the file descriptor if >= 0.
>
> We use __uuid_generate_random in the library and in uuidd, so we
> don't have to care about API there.
>
> - it's file descriptor leak in shared library...
>
> Volunteers? ;-)
Patch addressing this is included in the uuidd series I sent shortly
before. But please check the note about it in the series cover letter.
Thanks,
Petr
--
Petr Uzel
IRC: ptr_uzl @ freenode
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2012-05-03 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 21:52 [PATCH 3/3] libuuid: use randutils Davidlohr Bueso
2012-04-10 11:31 ` Karel Zak
2012-04-10 12:20 ` Petr Uzel
2012-05-03 19:04 ` Petr Uzel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120503190434.GA32558@skipper.site \
--to=petr.uzel@suse.cz \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox