[ovs-dev] [PATCH] ovs-pki: Unique subject DNs for certificate requests.

Ben Pfaff blp at nicira.com
Mon Oct 22 19:55:29 UTC 2012

On Mon, Oct 22, 2012 at 12:43:11PM -0700, Gurucharan Shetty wrote:
> Some applications expect subject DNs to be unique.
> Bug #13609.
> Signed-off-by: Gurucharan Shetty<gshetty at nicira.com>

Looks good.

I think that
    > +    if unique=`uuidgen 2>/dev/null`; then
    > +        :
    > +    else
    > +        unique=`date +"%Y %b %d %T"`
    > +    fi
can be simplified to:
        unique=`uuidgen 2>/dev/null` || unique=`date +"%Y %b %d %T"`
but the way you have it is perfectly good too.

It might be a good idea to put parentheses around uuidgen because of
this note in the Autoconf manual (which specifically mentions

       On the other hand, some shells, such as Solaris or FreeBSD
    `/bin/sh', warn about missing programs before performing redirections.
    Therefore, to silently check whether a program exists, it is necessary
    to perform redirections on a subshell:

         $ /bin/sh -c 'nosuch 2>/dev/null'
         nosuch: not found
         $ /bin/sh -c '(nosuch) 2>/dev/null'
         $ bash -c 'nosuch 2>/dev/null'



More information about the dev mailing list