[git] Assuan - branch, master, updated. libassuan-2.2.1-4-gcd8face

by Werner Koch cvs at cvs.gnupg.org
Fri Jun 26 12:08:36 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPC library used by GnuPG".

The branch, master has been updated
       via  cd8face27cc96cb0092c920e6e5bdee81a61c420 (commit)
       via  0da6afa864cfd68333941d6332d762c82928946c (commit)
      from  c6b131949bb6c77392af2cbbbeb8ea1bed129b79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cd8face27cc96cb0092c920e6e5bdee81a61c420
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jun 26 12:06:31 2015 +0200

    Return GPG_ERR_SOURCE_ASSUAN on errors with no CTX.
    
    * src/assuan-defs.h (_assuan_error): Use error source Assuan if no CTX
    is given.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 3dec3df..68cd810 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -228,7 +228,7 @@ struct assuan_context_s
 static GPG_ERR_INLINE gpg_error_t
 _assuan_error (assuan_context_t ctx, gpg_err_code_t errcode)
 {
-  return gpg_err_make (ctx?ctx->err_source:0, errcode);
+  return gpg_err_make (ctx?ctx->err_source: GPG_ERR_SOURCE_ASSUAN, errcode);
 }
 
 /* Release all resources associated with an engine operation.  */

commit 0da6afa864cfd68333941d6332d762c82928946c
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Jun 26 12:04:20 2015 +0200

    Do not segv if NULL is passed for CTX in sendfd and receivefd.
    
    * src/assuan-buffer.c (assuan_sendfd): Check that CTX is not NULL.
    (assuan_receivefd): Ditto.
    --
    
    This change is to align the behaviour with that of assuan_send_data.
    
    Suggested-by: Andre Heinecke.
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/assuan.texi b/doc/assuan.texi
index 358357c..10b309c 100644
--- a/doc/assuan.texi
+++ b/doc/assuan.texi
@@ -1205,8 +1205,10 @@ The descriptor must be sent before the command is issued that makes
 use of the descriptor.
 
 Note that calling this function with a @var{ctx} of @code{NULL} and
- at var{fd} of @code{-1} can be used as a runtime test to check whether
-descriptor passing is available on the platform.  If it is, 0 is returned, otherwise an error with the error code @code{GPG_ERR_NOT_IMPLEMENTED}.
+ at var{fd} of @code{ASSUAN_INVALID_FD} can be used as a runtime test to
+check whether descriptor passing is available on the platform:
+ at code{0} is returned if descriptor passing is available, otherwise an
+error with the error code @code{GPG_ERR_NOT_IMPLEMENTED} is returned.
 @end deftypefun
 
 @anchor{function assuan_receivefd}
diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c
index 04aff5a..b442b3d 100644
--- a/src/assuan-buffer.c
+++ b/src/assuan-buffer.c
@@ -524,6 +524,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd)
   return _assuan_error (ctx, GPG_ERR_NOT_IMPLEMENTED);
 #endif
 
+  if (!ctx)
+    return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+
   if (! ctx->engine.sendfd)
     return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED,
 		      "server does not support sending and receiving "
@@ -534,6 +537,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd)
 gpg_error_t
 assuan_receivefd (assuan_context_t ctx, assuan_fd_t *fd)
 {
+  if (!ctx)
+    return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+
   if (! ctx->engine.receivefd)
     return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED,
 		      "server does not support sending and receiving "
diff --git a/src/context.c b/src/context.c
index 62b7f57..147edae 100644
--- a/src/context.c
+++ b/src/context.c
@@ -183,8 +183,8 @@ void assuan_set_io_monitor (assuan_context_t ctx,
 
 

 /* Store the error in the context so that the error sending function
-  can take out a descriptive text.  Inside the assuan code, use the
-  macro set_error instead of this function. */
+   can take out a descriptive text.  Inside the assuan code, use the
+   macro set_error instead of this function. */
 gpg_error_t
 assuan_set_error (assuan_context_t ctx, gpg_error_t err, const char *text)
 {

-----------------------------------------------------------------------

Summary of changes:
 doc/assuan.texi     | 6 ++++--
 src/assuan-buffer.c | 6 ++++++
 src/assuan-defs.h   | 2 +-
 src/context.c       | 4 ++--
 4 files changed, 13 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list