[svn] assuan - r208 - in trunk: . doc src tests

svn author wk cvs at cvs.gnupg.org
Tue Sep 19 12:58:49 CEST 2006


Author: wk
Date: 2006-09-19 12:58:48 +0200 (Tue, 19 Sep 2006)
New Revision: 208

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/configure.ac
   trunk/doc/Makefile.am
   trunk/doc/assuan.texi
   trunk/src/ChangeLog
   trunk/src/assuan-defs.h
   trunk/src/assuan-pipe-connect.c
   trunk/src/assuan-socket-server.c
   trunk/src/assuan.h
   trunk/src/mkerrors
   trunk/tests/Makefile.am
   trunk/tests/fdpassing.c
Log:
Fixed problems Nelson H. F. Beebe reported when doing build tests on several
platforms.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/ChangeLog	2006-09-19 10:58:48 UTC (rev 208)
@@ -1,3 +1,10 @@
+2006-09-19  Werner Koch  <wk at g10code.com>
+
+	* tests/fdpassing.c: Reverted Marcus changes.
+	(client): New arg FNAME to replace hardwired file name.
+	(main): Pass motd to client.
+	* tests/Makefile.am (AM_CPPFLAGS): Removed.
+
 2006-09-19  Marcus Brinkmann  <marcus at g10code.de>
 
 	* tests/fdpassing.c (MOTD): New macro.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/NEWS	2006-09-19 10:58:48 UTC (rev 208)
@@ -1,3 +1,7 @@
+Noteworthy changes in version 0.9.1
+------------------------------------------------
+
+
 Noteworthy changes in version 0.9.0 (2006-09-14)
 ------------------------------------------------
 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/configure.ac	2006-09-19 10:58:48 UTC (rev 208)
@@ -25,7 +25,7 @@
 
 # Version number: Remember to change it immediately *after* a release.
 #                 Add a "-cvs" prefix for non-released code.
-AC_INIT(libassuan, 0.9.0, gnupg-devel at gnupg.org)
+AC_INIT(libassuan, 0.9.1-cvs, gnupg-devel at gnupg.org)
 # Note, that this is not yet available as a shared library.
 
 PACKAGE=$PACKAGE_NAME

Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/doc/Makefile.am	2006-09-19 10:58:48 UTC (rev 208)
@@ -23,3 +23,12 @@
 
 assuan_TEXINFOS = lgpl.texi gpl.texi
 
+
+online: assuan.html assuan.pdf
+	set -e; \
+	echo "Uploading current manuals to www.gnupg.org ..."; \
+        user=werner ; \
+	(cd assuan.html && rsync -vr --exclude='.svn' .  \
+	  $${user}@cvs.gnupg.org:webspace/manuals/assuan/ ); \
+        rsync -v assuan.pdf $${user}@cvs.gnupg.org:webspace/manuals/
+

Modified: trunk/doc/assuan.texi
===================================================================
--- trunk/doc/assuan.texi	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/doc/assuan.texi	2006-09-19 10:58:48 UTC (rev 208)
@@ -745,6 +745,7 @@
 /* The file descriptor must be pending before assuan_receivefd is
    called.  This means that assuan_sendfd should be called *before* the
    trigger is sent (normally via assuan_write_line ("INPUT FD")).  */
+ at anchor{fun-assuan_sendfd}
 assuan_error_t assuan_sendfd (assuan_context_t ctx, int fd);
 assuan_error_t assuan_receivefd (assuan_context_t ctx, int *fd);
 

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/ChangeLog	2006-09-19 10:58:48 UTC (rev 208)
@@ -1,3 +1,13 @@
+2006-09-19  Werner Koch  <wk at g10code.com>
+
+	* assuan-defs.h (putc_unlocked): Add prototype.
+
+	* assuan-socket-server.c (accept_connection): Made LEN a socklen_t.
+
+	* assuan.h: Replaced assuan error code enum by simple defines and
+	made assuan_error_t an int.
+	* mkerrors: Changed parser accordingly.
+
 2006-09-19  Marcus Brinkmann  <marcus at g10code.de>
 
 	* assuan-pipe-connect.c: Add hacks for Slowaris.
@@ -895,7 +905,7 @@
 	* assuan-defs.h: Add space in the context for this.
 
 	
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2006 Free Software Foundation, Inc.
 
  This file is free software; as a special exception the author gives
  unlimited permission to copy and/or distribute it, with or without

Modified: trunk/src/assuan-defs.h
===================================================================
--- trunk/src/assuan-defs.h	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/assuan-defs.h	2006-09-19 10:58:48 UTC (rev 208)
@@ -298,8 +298,10 @@
 #define clearenv _assuan_clearenv
 int setenv (const char *name, const char *value, int replace);
 #endif
+#ifndef HAVE_PUTC_UNLOCKED
+int putc_unlocked (int c, FILE *stream)
+#endif
 
-
 #define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
 #define DIMof(type,member)   DIM(((type *)0)->member)
 

Modified: trunk/src/assuan-pipe-connect.c
===================================================================
--- trunk/src/assuan-pipe-connect.c	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/assuan-pipe-connect.c	2006-09-19 10:58:48 UTC (rev 208)
@@ -51,6 +51,7 @@
 # define AF_LOCAL AF_UNIX
 #endif
 
+
 #ifdef _POSIX_OPEN_MAX
 #define MAX_OPEN_FDS _POSIX_OPEN_MAX
 #else
@@ -332,7 +333,7 @@
           setenv ("_assuan_pipe_connect_pid", mypidstr, 1);
 
           /* Make sure that we never pass a connection fd variable
-             when using a simple pipe. */
+             when using a simple pipe.  */
           unsetenv ("_assuan_connection_fd");
 
           execv (name, (char *const *) argv); 

Modified: trunk/src/assuan-socket-server.c
===================================================================
--- trunk/src/assuan-socket-server.c	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/assuan-socket-server.c	2006-09-19 10:58:48 UTC (rev 208)
@@ -85,7 +85,7 @@
 {
   int fd;
   struct sockaddr_un clnt_addr;
-  size_t len = sizeof clnt_addr;
+  socklen_t len = sizeof clnt_addr;
 
   fd = accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len );
   if (fd == -1)

Modified: trunk/src/assuan.h
===================================================================
--- trunk/src/assuan.h	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/assuan.h	2006-09-19 10:58:48 UTC (rev 208)
@@ -188,105 +188,103 @@
 /* Assuan error codes.  These are only used by old applications or
    those applications which won't make use of libgpg-error. */
 #ifndef _ASSUAN_ONLY_GPG_ERRORS
-typedef enum
-{
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_No_Error = 0,
+#define  ASSUAN_No_Error 0
 #endif
-  ASSUAN_General_Error = 1,
-  ASSUAN_Out_Of_Core = 2,
-  ASSUAN_Invalid_Value = 3,
+#define  ASSUAN_General_Error 1
+#define  ASSUAN_Out_Of_Core 2
+#define  ASSUAN_Invalid_Value 3
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_Timeout = 4,
+#define  ASSUAN_Timeout 4
 #endif
-  ASSUAN_Read_Error = 5,
-  ASSUAN_Write_Error = 6,
-  ASSUAN_Problem_Starting_Server = 7,
-  ASSUAN_Not_A_Server = 8,
+#define  ASSUAN_Read_Error 5
+#define  ASSUAN_Write_Error 6
+#define  ASSUAN_Problem_Starting_Server 7
+#define  ASSUAN_Not_A_Server 8
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_Not_A_Client = 9,
+#define  ASSUAN_Not_A_Client 9
 #endif
-  ASSUAN_Nested_Commands = 10,
-  ASSUAN_Invalid_Response = 11,
-  ASSUAN_No_Data_Callback = 12,
-  ASSUAN_No_Inquire_Callback = 13,
-  ASSUAN_Connect_Failed = 14,
-  ASSUAN_Accept_Failed = 15,
+#define  ASSUAN_Nested_Commands 10
+#define  ASSUAN_Invalid_Response 11
+#define  ASSUAN_No_Data_Callback 12
+#define  ASSUAN_No_Inquire_Callback 13
+#define  ASSUAN_Connect_Failed 14
+#define  ASSUAN_Accept_Failed 15
 
   /* Error codes above 99 are meant as status codes */
-  ASSUAN_Not_Implemented = 100,
-  ASSUAN_Server_Fault    = 101,
+#define  ASSUAN_Not_Implemented 100
+#define  ASSUAN_Server_Fault    101
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_Invalid_Command = 102,
+#define  ASSUAN_Invalid_Command 102
 #endif
-  ASSUAN_Unknown_Command = 103,
-  ASSUAN_Syntax_Error    = 104,
+#define  ASSUAN_Unknown_Command 103
+#define  ASSUAN_Syntax_Error    104
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_Parameter_Error = 105,
+#define  ASSUAN_Parameter_Error 105
 #endif
-  ASSUAN_Parameter_Conflict = 106,
-  ASSUAN_Line_Too_Long = 107,
-  ASSUAN_Line_Not_Terminated = 108,
+#define  ASSUAN_Parameter_Conflict 106
+#define  ASSUAN_Line_Too_Long 107
+#define  ASSUAN_Line_Not_Terminated 108
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_No_Input = 109,
-  ASSUAN_No_Output = 110,
+#define  ASSUAN_No_Input 109
+#define  ASSUAN_No_Output 110
 #endif
-  ASSUAN_Canceled = 111,
+#define  ASSUAN_Canceled 111
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ASSUAN_Unsupported_Algorithm = 112,
-  ASSUAN_Server_Resource_Problem = 113,
-  ASSUAN_Server_IO_Error = 114,
-  ASSUAN_Server_Bug = 115,
-  ASSUAN_No_Data_Available = 116,
-  ASSUAN_Invalid_Data = 117,
+#define  ASSUAN_Unsupported_Algorithm 112
+#define  ASSUAN_Server_Resource_Problem 113
+#define  ASSUAN_Server_IO_Error 114
+#define  ASSUAN_Server_Bug 115
+#define  ASSUAN_No_Data_Available 116
+#define  ASSUAN_Invalid_Data 117
 #endif
-  ASSUAN_Unexpected_Command = 118,
-  ASSUAN_Too_Much_Data = 119
+#define  ASSUAN_Unexpected_Command 118
+#define  ASSUAN_Too_Much_Data 119
 #ifndef _ASSUAN_IN_LIBASSUAN
-  ,  /* Avoid trailing comma in enumerator list.  */
-  ASSUAN_Inquire_Unknown = 120,
-  ASSUAN_Inquire_Error = 121,
-  ASSUAN_Invalid_Option = 122,
-  ASSUAN_Invalid_Index = 123,
-  ASSUAN_Unexpected_Status = 124,
-  ASSUAN_Unexpected_Data = 125,
-  ASSUAN_Invalid_Status = 126,
-  ASSUAN_Locale_Problem = 127,
-  ASSUAN_Not_Confirmed = 128,
+#define  ASSUAN_Inquire_Unknown 120
+#define  ASSUAN_Inquire_Error 121
+#define  ASSUAN_Invalid_Option 122
+#define  ASSUAN_Invalid_Index 123
+#define  ASSUAN_Unexpected_Status 124
+#define  ASSUAN_Unexpected_Data 125
+#define  ASSUAN_Invalid_Status 126
+#define  ASSUAN_Locale_Problem 127
+#define  ASSUAN_Not_Confirmed 128
 
   /* Warning: Don't use the Error codes, below they are deprecated. */
-  ASSUAN_Bad_Certificate = 201,
-  ASSUAN_Bad_Certificate_Chain = 202,
-  ASSUAN_Missing_Certificate = 203,
-  ASSUAN_Bad_Signature = 204,
-  ASSUAN_No_Agent = 205,
-  ASSUAN_Agent_Error = 206,
-  ASSUAN_No_Public_Key = 207,
-  ASSUAN_No_Secret_Key = 208,
-  ASSUAN_Invalid_Name = 209,
+#define  ASSUAN_Bad_Certificate 201
+#define  ASSUAN_Bad_Certificate_Chain 202
+#define  ASSUAN_Missing_Certificate 203
+#define  ASSUAN_Bad_Signature 204
+#define  ASSUAN_No_Agent 205
+#define  ASSUAN_Agent_Error 206
+#define  ASSUAN_No_Public_Key 207
+#define  ASSUAN_No_Secret_Key 208
+#define  ASSUAN_Invalid_Name 209
 
-  ASSUAN_Cert_Revoked = 301,
-  ASSUAN_No_CRL_For_Cert = 302,
-  ASSUAN_CRL_Too_Old = 303,
-  ASSUAN_Not_Trusted = 304,
+#define  ASSUAN_Cert_Revoked 301
+#define  ASSUAN_No_CRL_For_Cert 302
+#define  ASSUAN_CRL_Too_Old 303
+#define  ASSUAN_Not_Trusted 304
 
-  ASSUAN_Card_Error = 401,
-  ASSUAN_Invalid_Card = 402,
-  ASSUAN_No_PKCS15_App = 403,
-  ASSUAN_Card_Not_Present = 404,
-  ASSUAN_Invalid_Id = 405,
+#define  ASSUAN_Card_Error 401
+#define  ASSUAN_Invalid_Card 402
+#define  ASSUAN_No_PKCS15_App 403
+#define  ASSUAN_Card_Not_Present 404
+#define  ASSUAN_Invalid_Id 405
 
   /* Error codes in the range 1000 to 9999 may be used by applications
      at their own discretion. */
-  ASSUAN_USER_ERROR_FIRST = 1000,
-  ASSUAN_USER_ERROR_LAST = 9999
+#define  ASSUAN_USER_ERROR_FIRST 1000
+#define  ASSUAN_USER_ERROR_LAST 9999
 #endif
-} assuan_error_t;
 
-typedef assuan_error_t AssuanError; /* Deprecated. */
+typedef int assuan_error_t;
 
+typedef assuan_error_t AssuanError _ASSUAN_DEPRECATED; 
+
 /* This is a list of pre-registered ASSUAN commands */
-/* NOTE, these command IDs are now deprectated and solely exists for
+/* Note, these command IDs are now deprectated and solely exists for
    compatibility reasons. */
 typedef enum
 {

Modified: trunk/src/mkerrors
===================================================================
--- trunk/src/mkerrors	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/src/mkerrors	2006-09-19 10:58:48 UTC (rev 208)
@@ -140,7 +140,7 @@
  * Return value: String with the error description.
  **/
 const char *
-assuan_strerror (AssuanError err)
+assuan_strerror (assuan_error_t err)
 {
   const char *s;
   static char buf[50];
@@ -150,11 +150,10 @@
 EOF
 
 awk '
-/ASSUAN_No_Error/    { okay=1 }
-!okay              {next}
-/}/                { exit 0 }
-/^#/               {next}
-/ASSUAN_[A-Za-z_]*/ { print_code($1) }
+/ASSUAN_No_Error/        { okay=1 }
+!okay                    {next}
+/^#define[ ]+ASSUAN_[A-Za-z_]*/ { print_code($2) }
+/ASSUAN_USER_ERROR_LAST/ { exit 0 }
 
 
 function print_code( s )

Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/tests/Makefile.am	2006-09-19 10:58:48 UTC (rev 208)
@@ -29,7 +29,6 @@
 
 TESTS = fdpassing
 
-AM_CPPFLAGS = -DSRCDIR=$(srcdir)
 AM_CFLAGS = # $(GPG_ERROR_CFLAGS)
 
 noinst_HEADERS = common.h

Modified: trunk/tests/fdpassing.c
===================================================================
--- trunk/tests/fdpassing.c	2006-09-19 10:46:58 UTC (rev 207)
+++ trunk/tests/fdpassing.c	2006-09-19 10:58:48 UTC (rev 208)
@@ -32,13 +32,6 @@
 #include "../src/assuan.h"
 #include "common.h"
 
-#ifndef SRCDIR
-#define SRCDIR "/etc"
-#endif
-#define STRINGIFY2(str) #str
-#define STRINGIFY(str) STRINGIFY2(str)
-#define MOTD STRINGIFY(SRCDIR) "/motd"
-
 
 /*
 
@@ -65,7 +58,6 @@
       log_error ("fdopen failed on input fd: %s\n", strerror (errno));
       return ASSUAN_General_Error;
     }
-  log_info ("printing input to stdout:\n");
   nbytes = 0;
   while ( (c=getc (fp)) != -1)
     {
@@ -155,7 +147,7 @@
 
 /* Client main.  If true is returned, a disconnect has not been done. */
 static int
-client (assuan_context_t ctx)
+client (assuan_context_t ctx, const char *fname)
 {
   int rc;
   FILE *fp;
@@ -166,10 +158,10 @@
 
   for (i=0; i < 6; i++)
     {
-      fp = fopen (MOTD, "r");
+      fp = fopen (fname, "r");
       if (!fp)
         {
-          log_error ("failed to open `%s': %s\n", MOTD,
+          log_error ("failed to open `%s': %s\n", fname,
                      strerror (errno));
           return -1;
         }
@@ -217,16 +209,13 @@
 main (int argc, char **argv)
 {
   int last_argc = -1;
-  const char *srcdir = getenv ("srcdir");
   assuan_context_t ctx;
   int err;
   int no_close_fds[2];
   const char *arglist[10];
   int is_server = 0;
   int with_exec = 0;
-  
-  if (!srcdir)
-    srcdir = ".";
+  char *fname = prepend_srcdir ("motd");
 
   if (argc)
     {
@@ -269,6 +258,7 @@
         }
     }
 
+
   assuan_set_assuan_log_prefix (log_prefix);
   assuan_set_assuan_log_stream (stderr);
 
@@ -304,7 +294,7 @@
         }
       else
         {
-          if (client (ctx)) 
+          if (client (ctx, fname)) 
             {
               log_info ("waiting for server to terminate...\n");
               assuan_disconnect (ctx);




More information about the Gnupg-commits mailing list