diff options
author | Werner Koch <wk@gnupg.org> | 2006-09-19 10:58:48 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2006-09-19 10:58:48 +0000 |
commit | 32a50e84da66d6a20703d131f3e8bc6ac10e4422 (patch) | |
tree | 5c5142ecb4c12e00f7f8886038d85b2b4c19c9bb | |
parent | 2c22ab8151bd504d32ace8755945e6d323c06107 (diff) | |
download | libassuan-32a50e84da66d6a20703d131f3e8bc6ac10e4422.tar.gz |
Fixed problems Nelson H. F. Beebe reported when doing build tests on several
platforms.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/Makefile.am | 9 | ||||
-rw-r--r-- | doc/assuan.texi | 1 | ||||
-rw-r--r-- | src/ChangeLog | 12 | ||||
-rw-r--r-- | src/assuan-defs.h | 4 | ||||
-rw-r--r-- | src/assuan-pipe-connect.c | 3 | ||||
-rw-r--r-- | src/assuan-socket-server.c | 2 | ||||
-rw-r--r-- | src/assuan.h | 144 | ||||
-rwxr-xr-x | src/mkerrors | 11 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/fdpassing.c | 22 |
13 files changed, 121 insertions, 101 deletions
@@ -1,3 +1,10 @@ +2006-09-19 Werner Koch <wk@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@g10code.de> * tests/fdpassing.c (MOTD): New macro. @@ -1,3 +1,7 @@ +Noteworthy changes in version 0.9.1 +------------------------------------------------ + + Noteworthy changes in version 0.9.0 (2006-09-14) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 4210298..ca977c7 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ min_automake_version="1.9.3" # 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@gnupg.org) +AC_INIT(libassuan, 0.9.1-cvs, gnupg-devel@gnupg.org) # Note, that this is not yet available as a shared library. PACKAGE=$PACKAGE_NAME diff --git a/doc/Makefile.am b/doc/Makefile.am index c806232..2294f89 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -23,3 +23,12 @@ info_TEXINFOS = assuan.texi 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/ + diff --git a/doc/assuan.texi b/doc/assuan.texi index cc7dcaf..2422f73 100644 --- a/doc/assuan.texi +++ b/doc/assuan.texi @@ -745,6 +745,7 @@ assuan_transact (assuan_context_t ctx, /* 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")). */ +@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); diff --git a/src/ChangeLog b/src/ChangeLog index 65b1b7f..43d326a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2006-09-19 Werner Koch <wk@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@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 diff --git a/src/assuan-defs.h b/src/assuan-defs.h index cf7ce09..7a96c0f 100644 --- a/src/assuan-defs.h +++ b/src/assuan-defs.h @@ -298,7 +298,9 @@ char *stpcpy (char *dest, const char *src); #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) diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c index 6260e86..8ee9c74 100644 --- a/src/assuan-pipe-connect.c +++ b/src/assuan-pipe-connect.c @@ -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 @@ pipe_connect_unix (assuan_context_t *ctx, 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); diff --git a/src/assuan-socket-server.c b/src/assuan-socket-server.c index 3cc9bae..45c227d 100644 --- a/src/assuan-socket-server.c +++ b/src/assuan-socket-server.c @@ -85,7 +85,7 @@ accept_connection (assuan_context_t ctx) { 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) diff --git a/src/assuan.h b/src/assuan.h index 0d1074a..33b7d84 100644 --- a/src/assuan.h +++ b/src/assuan.h @@ -188,105 +188,103 @@ extern "C" /* 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, - - ASSUAN_Cert_Revoked = 301, - ASSUAN_No_CRL_For_Cert = 302, - ASSUAN_CRL_Too_Old = 303, - 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_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 + +#define ASSUAN_Cert_Revoked 301 +#define ASSUAN_No_CRL_For_Cert 302 +#define ASSUAN_CRL_Too_Old 303 +#define ASSUAN_Not_Trusted 304 + +#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 { diff --git a/src/mkerrors b/src/mkerrors index 459c808..ded7ba3 100755 --- a/src/mkerrors +++ b/src/mkerrors @@ -140,7 +140,7 @@ _assuan_error (int oldcode) * 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 @@ assuan_strerror (AssuanError err) 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 ) diff --git a/tests/Makefile.am b/tests/Makefile.am index 7121f8e..ef2510e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -29,7 +29,6 @@ CLEANFILES = TESTS = fdpassing -AM_CPPFLAGS = -DSRCDIR=$(srcdir) AM_CFLAGS = # $(GPG_ERROR_CFLAGS) noinst_HEADERS = common.h diff --git a/tests/fdpassing.c b/tests/fdpassing.c index da85bf7..733c232 100644 --- a/tests/fdpassing.c +++ b/tests/fdpassing.c @@ -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 @@ cmd_echo (assuan_context_t ctx, char *line) 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 @@ server (void) /* 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 @@ client (assuan_context_t ctx) 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 @@ int 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 @@ main (int argc, char **argv) } } + assuan_set_assuan_log_prefix (log_prefix); assuan_set_assuan_log_stream (stderr); @@ -304,7 +294,7 @@ main (int argc, char **argv) } else { - if (client (ctx)) + if (client (ctx, fname)) { log_info ("waiting for server to terminate...\n"); assuan_disconnect (ctx); |