[PATCH] tools/gpgconf.c (main): Initialize libgcrypt.

Ben Kibbey bjk at luxsci.net
Tue Aug 9 00:40:03 CEST 2016


On Mon, Aug 08, 2016 at 11:22:10AM +0200, Justus Winter wrote:
> > Fixes a warning appearing the system logs when --homedir is passed.
> 
> I don't understand, what warning ends up in what log?  Also, please mind
> our commit log guidelines, see doc/HACKING.

The logged message is: Libgcrypt warning: missing initialization -
please fix the application

> 
> > @@ -229,6 +230,12 @@ main (int argc, char **argv)
> >    i18n_init();
> >    init_common_subsystems (&argc, &argv);
> >  
> > +  if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
> > +    {
> > +      log_fatal ( _("%s is too old (need %s, have %s)\n"), "libgcrypt",
> > +                  NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
> > +    }
> > +
> 
> Hmm, as I see it, init_common_subsystems registers gcry_realloc as
> allocation function for libgpg-error.  So shouldn't this check be
> included before init_common_subsystems, or maybe even just moved to
> init_common_subsystems?
> 
> Also, I don't like the 'function ( space, before, argument )' style, and
> cursory grepping reveals that using 'function (no, space, before,
> argument)' is more common in GnuPG.  At least please be consistent.

Fixed in the attached patch.

-- 
Ben Kibbey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cleanup-initialization-of-libgcrypt.patch
Type: text/x-diff
Size: 9949 bytes
Desc: not available
URL: </pipermail/attachments/20160808/9bd88ace/attachment-0001.patch>


More information about the Gnupg-devel mailing list