core: Store engine's version string in gpgsm engine
* src/engine-gpgsm.c (struct engine_gpgsm): Add field 'version'. (gpgsm_new): Copy version string. (gpgsm_release): Free VERSION. -- GnuPG-bug-id: 6648
This commit is contained in:
parent
8701e98937
commit
d72811a2c0
@ -68,6 +68,7 @@ typedef struct
|
|||||||
struct engine_gpgsm
|
struct engine_gpgsm
|
||||||
{
|
{
|
||||||
assuan_context_t assuan_ctx;
|
assuan_context_t assuan_ctx;
|
||||||
|
char *version;
|
||||||
|
|
||||||
int lc_ctype_set;
|
int lc_ctype_set;
|
||||||
int lc_messages_set;
|
int lc_messages_set;
|
||||||
@ -254,6 +255,9 @@ gpgsm_release (void *engine)
|
|||||||
|
|
||||||
gpgsm_cancel (engine);
|
gpgsm_cancel (engine);
|
||||||
|
|
||||||
|
if (gpgsm->version)
|
||||||
|
free (gpgsm->version);
|
||||||
|
|
||||||
gpgme_data_release (gpgsm->diagnostics);
|
gpgme_data_release (gpgsm->diagnostics);
|
||||||
|
|
||||||
free (gpgsm->colon.attic.line);
|
free (gpgsm->colon.attic.line);
|
||||||
@ -281,12 +285,20 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir,
|
|||||||
char *optstr;
|
char *optstr;
|
||||||
unsigned int connect_flags;
|
unsigned int connect_flags;
|
||||||
|
|
||||||
(void)version; /* Not yet used. */
|
|
||||||
|
|
||||||
gpgsm = calloc (1, sizeof *gpgsm);
|
gpgsm = calloc (1, sizeof *gpgsm);
|
||||||
if (!gpgsm)
|
if (!gpgsm)
|
||||||
return gpg_error_from_syserror ();
|
return gpg_error_from_syserror ();
|
||||||
|
|
||||||
|
if (version)
|
||||||
|
{
|
||||||
|
gpgsm->version = strdup (version);
|
||||||
|
if (!gpgsm->version)
|
||||||
|
{
|
||||||
|
err = gpg_error_from_syserror ();
|
||||||
|
goto leave;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gpgsm->status_cb.fd = -1;
|
gpgsm->status_cb.fd = -1;
|
||||||
gpgsm->status_cb.dir = 1;
|
gpgsm->status_cb.dir = 1;
|
||||||
gpgsm->status_cb.tag = 0;
|
gpgsm->status_cb.tag = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user