diff options
| author | Marcus Brinkmann <[email protected]> | 2002-06-11 18:12:19 +0000 | 
|---|---|---|
| committer | Marcus Brinkmann <[email protected]> | 2002-06-11 18:12:19 +0000 | 
| commit | 14f16305b0818b3c3e573976d5d83d6ba6b86682 (patch) | |
| tree | c900161b3ffaf993307ffbbb7273dbd77cef3eb3 | |
| parent | * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_ (diff) | |
| download | gpgme-14f16305b0818b3c3e573976d5d83d6ba6b86682.tar.gz gpgme-14f16305b0818b3c3e573976d5d83d6ba6b86682.zip  | |
2002-06-11  Marcus Brinkmann  <[email protected]>
	* engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
	(_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
	use our own close notification mechanism without interfering with
	assuan.
Diffstat (limited to '')
| -rw-r--r-- | gpgme/ChangeLog | 7 | ||||
| -rw-r--r-- | gpgme/engine-gpgsm.c | 14 | ||||
| -rw-r--r-- | gpgme/rungpg.c | 5 | 
3 files changed, 25 insertions, 1 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 20f74bf0..7337181c 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,10 @@ +2002-06-11  Marcus Brinkmann  <[email protected]> + +	* engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd. +	(_gpgme_gpgsm_new): Duplicate status file descriptor, so we can +	use our own close notification mechanism without interfering with +	assuan. +  2002-06-11  Werner Koch  <[email protected]>  	* gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_ diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 0fdd07da..3d490d09 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -381,7 +381,17 @@ _gpgme_gpgsm_new (GpgsmObject *r_gpgsm)        err = mk_error (General_Error);  /* FIXME */        goto leave;      } -  gpgsm->status_cb.fd = fdlist[0]; +  /* We duplicate the file descriptor, so we can close it without +     disturbing assuan.  Alternatively, we could special case +     status_fd and register/unregister it manually as needed, but this +     increases code duplication and is more complicated as we can not +     use the close notifications etc.  */ +  gpgsm->status_cb.fd = dup (fdlist[0]); +  if (gpgsm->status_cb.fd < 0) +    { +      err = mk_error (General_Error);	/* FIXME */ +      goto leave; +    }    gpgsm->status_cb.dir = 1;    gpgsm->status_cb.data = gpgsm; @@ -516,6 +526,8 @@ _gpgme_gpgsm_release (GpgsmObject gpgsm)    if (!gpgsm)      return; +  if (gpgsm->status_cb.fd != -1) +    _gpgme_io_close (gpgsm->status_cb.fd);    if (gpgsm->input_cb.fd != -1)      _gpgme_io_close (gpgsm->input_cb.fd);    if (gpgsm->output_cb.fd != -1) diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 318e99d8..df84ee5d 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -1074,6 +1074,9 @@ read_status ( GpgObject gpg )                          if ( r->code == STATUS_END_STREAM ) {  			  if (gpg->cmd.used)  			    { +			      /* XXX We must check if there are any +				 more fds active after removing this +				 one.  */  			      (*gpg->io_cbs.remove)  				(gpg->fd_data_map[gpg->cmd.idx].tag);  			      gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd; @@ -1335,6 +1338,8 @@ command_cb (void *opaque, char *buffer, size_t length, size_t *nread)    gpg->cmd.fnc (gpg->cmd.fnc_value, 0, value);    gpg->cmd.code = 0;    /* And sleep again until read_status will wake us up again.  */ +  /* XXX We must check if there are any more fds active after removing +     this one.  */    (*gpg->io_cbs.remove) (gpg->fd_data_map[gpg->cmd.idx].tag);    gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd;    gpg->fd_data_map[gpg->cmd.idx].fd = -1;  | 
