Util-Linux package development
 help / color / mirror / Atom feed
From: Ludwig Nussel <ludwig.nussel@suse.de>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH] uuidgen: print warning if uuidd isn't running
Date: Tue, 14 Jun 2011 14:06:10 +0200	[thread overview]
Message-ID: <201106141406.10364.ludwig.nussel@suse.de> (raw)
In-Reply-To: <20110614115125.GG14293@nb.net.home>

Karel Zak wrote:
> On Tue, Jun 14, 2011 at 01:45:34PM +0200, Karel Zak wrote:
> > On Wed, Jun 08, 2011 at 03:35:01PM +0200, Ludwig Nussel wrote:
> > > ---
> > >  misc-utils/uuidgen.c |    4 +++-
> > >  1 files changed, 3 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
> > > index 3cf6ec9..47f8e8f 100644
> > > --- a/misc-utils/uuidgen.c
> > > +++ b/misc-utils/uuidgen.c
> > > @@ -59,7 +59,9 @@ main (int argc, char *argv[])
> > >  
> > >  	switch (do_type) {
> > >  	case DO_TYPE_TIME:
> > > -		uuid_generate_time(uu);
> > > +		if (uuid_generate_time_safe(uu)) {
> > > +			fprintf(stderr, _("Warning: uuidd not running or not operational. Time based uuid may not be unique.\n"));
> > 
> > IMHO this is overkill -- the uuidd is used very rarely (usually on
> > large systems with SAP) and it's disabled by default in many
> > distributions, but the uuidgen(1) util is available everywhere and
> > used probably often used by admins/scripts.

That's the problem exactly. uuidgen seems to work for them at first
until lots of uuids within a short time are required. It's a mean
trap.

> > It would be better to add some WARNING section to the uuidgen(1) man
> > page to inform users about the disadvantage.

Well, who reads docu if uuidgen -t appears to work?

>  ... we can also add a new option (e.g. --safe) to use 
>  uuid_generate_time_safe().

... or make -t fail if it's not safe and add a --unsafe option. That
would be the fail-safe approach :-)

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 

  reply	other threads:[~2011-06-14 12:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 13:35 [PATCH] uuidgen: print warning if uuidd isn't running Ludwig Nussel
2011-06-14 11:45 ` Karel Zak
2011-06-14 11:51   ` Karel Zak
2011-06-14 12:06     ` Ludwig Nussel [this message]
2011-06-14 12:17       ` Voelker, Bernhard
2011-06-14 14:38       ` Karel Zak

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=201106141406.10364.ludwig.nussel@suse.de \
    --to=ludwig.nussel@suse.de \
    --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