mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
Fix possible system freeze on Mac OS X.
This commit is contained in:
parent
98f10d74b8
commit
4fa261f8ec
3
NEWS
3
NEWS
@ -24,7 +24,8 @@ Noteworthy changes in version 2.0.12 (not released)
|
|||||||
* The gpg-protect-tool now uses gpg-agent via libassuan. Under
|
* The gpg-protect-tool now uses gpg-agent via libassuan. Under
|
||||||
Windows the Pinentry will now be put into the foreground.
|
Windows the Pinentry will now be put into the foreground.
|
||||||
|
|
||||||
|
* Changed code to avoid a possible Mac OS X system freeze.
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 2.0.11 (2009-03-03)
|
Noteworthy changes in version 2.0.11 (2009-03-03)
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* gpg-agent.c (JNLIB_NEED_AFLOCAL): Define.
|
||||||
|
(create_server_socket): Use SUN_LEN macro.
|
||||||
|
|
||||||
2009-05-15 Werner Koch <wk@g10code.com>
|
2009-05-15 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
Fix bug #1053.
|
Fix bug #1053.
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <pth.h>
|
#include <pth.h>
|
||||||
|
|
||||||
#define JNLIB_NEED_LOG_LOGV
|
#define JNLIB_NEED_LOG_LOGV
|
||||||
|
#define JNLIB_NEED_AFLOCAL
|
||||||
#include "agent.h"
|
#include "agent.h"
|
||||||
#include <assuan.h> /* Malloc hooks and socket wrappers. */
|
#include <assuan.h> /* Malloc hooks and socket wrappers. */
|
||||||
|
|
||||||
@ -1457,9 +1458,7 @@ create_server_socket (char *name, int is_ssh, assuan_sock_nonce_t *nonce)
|
|||||||
agent_exit (2);
|
agent_exit (2);
|
||||||
}
|
}
|
||||||
strcpy (serv_addr->sun_path, name);
|
strcpy (serv_addr->sun_path, name);
|
||||||
len = (offsetof (struct sockaddr_un, sun_path)
|
len = SUN_LEN (serv_addr);
|
||||||
+ strlen (serv_addr->sun_path) + 1);
|
|
||||||
|
|
||||||
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
|
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
|
||||||
if (use_standard_socket && rc == -1 && errno == EADDRINUSE)
|
if (use_standard_socket && rc == -1 && errno == EADDRINUSE)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* simple-pwquery.c (agent_open): Use SUN_LEN
|
||||||
|
(JNLIB_NEED_AFLOCAL): Define and include mischelp.h.
|
||||||
|
|
||||||
2009-05-07 Werner Koch <wk@g10code.com>
|
2009-05-07 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* sexputil.c (get_rsa_pk_from_canon_sexp): New.
|
* sexputil.c (get_rsa_pk_from_canon_sexp): New.
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define JNLIB_NEED_AFLOCAL
|
||||||
|
#include "../jnlib/mischelp.h"
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
#include "../jnlib/w32-afunix.h"
|
#include "../jnlib/w32-afunix.h"
|
||||||
#endif
|
#endif
|
||||||
@ -379,8 +382,7 @@ agent_open (int *rfd)
|
|||||||
memset (&client_addr, 0, sizeof client_addr);
|
memset (&client_addr, 0, sizeof client_addr);
|
||||||
client_addr.sun_family = AF_UNIX;
|
client_addr.sun_family = AF_UNIX;
|
||||||
strcpy (client_addr.sun_path, infostr);
|
strcpy (client_addr.sun_path, infostr);
|
||||||
len = (offsetof (struct sockaddr_un, sun_path)
|
len = SUN_LEN (&client_addr);
|
||||||
+ strlen(client_addr.sun_path) + 1);
|
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
rc = _w32_sock_connect (fd, (struct sockaddr*)&client_addr, len );
|
rc = _w32_sock_connect (fd, (struct sockaddr*)&client_addr, len );
|
||||||
|
@ -56,7 +56,4 @@ void gnupg_allow_set_foregound_window (pid_t pid);
|
|||||||
|
|
||||||
#endif /*HAVE_W32_SYSTEM*/
|
#endif /*HAVE_W32_SYSTEM*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*GNUPG_COMMON_SYSUTILS_H*/
|
#endif /*GNUPG_COMMON_SYSUTILS_H*/
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* mischelp.h: Define PF_LOCAL, AF_LOCAL and SUN_LEN if requested.
|
||||||
|
* logging.c (fun_writer): Use SUN_LEN to fix a Mac OS X freeze.
|
||||||
|
|
||||||
2009-03-25 Werner Koch <wk@g10code.com>
|
2009-03-25 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* logging.c (fun_closer): Never close fd 2.
|
* logging.c (fun_closer): Never close fd 2.
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define JNLIB_NEED_LOG_LOGV 1
|
#define JNLIB_NEED_LOG_LOGV 1
|
||||||
|
#define JNLIB_NEED_AFLOCAL 1
|
||||||
#include "libjnlib-config.h"
|
#include "libjnlib-config.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
|
|
||||||
@ -152,8 +153,7 @@ fun_writer (void *cookie_arg, const char *buffer, my_funopen_hook_size_t size)
|
|||||||
addr.sun_family = PF_LOCAL;
|
addr.sun_family = PF_LOCAL;
|
||||||
strncpy (addr.sun_path, cookie->name, sizeof (addr.sun_path)-1);
|
strncpy (addr.sun_path, cookie->name, sizeof (addr.sun_path)-1);
|
||||||
addr.sun_path[sizeof (addr.sun_path)-1] = 0;
|
addr.sun_path[sizeof (addr.sun_path)-1] = 0;
|
||||||
addrlen = (offsetof (struct sockaddr_un, sun_path)
|
addrlen = SUN_LEN (&addr);
|
||||||
+ strlen (addr.sun_path) + 1);
|
|
||||||
|
|
||||||
if (connect (cookie->fd, (struct sockaddr *) &addr, addrlen) == -1)
|
if (connect (cookie->fd, (struct sockaddr *) &addr, addrlen) == -1)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* mischelp.h - Miscellaneous helper macros and functions
|
/* mischelp.h - Miscellaneous helper macros and functions
|
||||||
* Copyright (C) 1999, 2000, 2001, 2002, 2003,
|
* Copyright (C) 1999, 2000, 2001, 2002, 2003,
|
||||||
* 2006, 2007 Free Software Foundation, Inc.
|
* 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This file is part of JNLIB.
|
* This file is part of JNLIB.
|
||||||
*
|
*
|
||||||
@ -60,5 +60,35 @@ time_t timegm (struct tm *tm);
|
|||||||
#define wipememory(_ptr,_len) wipememory2(_ptr,0,_len)
|
#define wipememory(_ptr,_len) wipememory2(_ptr,0,_len)
|
||||||
|
|
||||||
|
|
||||||
|
/* Include hacks which are mainly required for Slowaris. */
|
||||||
|
#if defined(JNLIB_NEED_AFLOCAL) && !defined(HAVE_W32_SYSTEM)
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
|
||||||
|
#ifndef PF_LOCAL
|
||||||
|
# ifdef PF_UNIX
|
||||||
|
# define PF_LOCAL PF_UNIX
|
||||||
|
# else
|
||||||
|
# define PF_LOCAL AF_UNIX
|
||||||
|
# endif
|
||||||
|
#endif /*PF_LOCAL*/
|
||||||
|
#ifndef AF_LOCAL
|
||||||
|
# define AF_LOCAL AF_UNIX
|
||||||
|
#endif /*AF_UNIX*/
|
||||||
|
|
||||||
|
/* We used to avoid this macro in GnuPG and inlined the AF_LOCAL name
|
||||||
|
length computation directly with the little twist of adding 1 extra
|
||||||
|
byte. It seems that this was needed once on an old HP/UX box and
|
||||||
|
there are also rumours that 4.3 Reno and DEC systems need it. This
|
||||||
|
one-off buglet did not harm any current system until it came to Mac
|
||||||
|
OS X where the kernel (as of May 2009) exhibited a strange bug: The
|
||||||
|
systems basically froze in the connect call if the passed name
|
||||||
|
contained an invalid directory part. Ignore the old Unices. */
|
||||||
|
#ifndef SUN_LEN
|
||||||
|
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
|
||||||
|
+ strlen ((ptr)->sun_path))
|
||||||
|
#endif /*SUN_LEN*/
|
||||||
|
#endif /*JNLIB_NEED_AFLOCAL && !HAVE_W32_SYSTEM*/
|
||||||
|
|
||||||
|
|
||||||
#endif /*LIBJNLIB_MISCHELP_H*/
|
#endif /*LIBJNLIB_MISCHELP_H*/
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* scdaemon.c (create_server_socket): Use SUN_LEN.
|
||||||
|
(JNLIB_NEED_AFLOCAL): Define.
|
||||||
|
|
||||||
2009-05-13 Werner Koch <wk@g10code.com>
|
2009-05-13 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
|
* ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <pth.h>
|
#include <pth.h>
|
||||||
|
|
||||||
#define JNLIB_NEED_LOG_LOGV
|
#define JNLIB_NEED_LOG_LOGV
|
||||||
|
#define JNLIB_NEED_AFLOCAL
|
||||||
#include "scdaemon.h"
|
#include "scdaemon.h"
|
||||||
#include <ksba.h>
|
#include <ksba.h>
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
@ -1032,8 +1033,7 @@ create_server_socket (int is_standard_name, const char *name,
|
|||||||
serv_addr->sun_family = AF_UNIX;
|
serv_addr->sun_family = AF_UNIX;
|
||||||
assert (strlen (name) + 1 < sizeof (serv_addr->sun_path));
|
assert (strlen (name) + 1 < sizeof (serv_addr->sun_path));
|
||||||
strcpy (serv_addr->sun_path, name);
|
strcpy (serv_addr->sun_path, name);
|
||||||
len = (offsetof (struct sockaddr_un, sun_path)
|
len = SUN_LEN (serv_addr);
|
||||||
+ strlen (serv_addr->sun_path) + 1);
|
|
||||||
|
|
||||||
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
|
rc = assuan_sock_bind (fd, (struct sockaddr*) serv_addr, len);
|
||||||
if (is_standard_name && rc == -1 && errno == EADDRINUSE)
|
if (is_standard_name && rc == -1 && errno == EADDRINUSE)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* watchgnupg.c: Include jnlib/mischelp.h if required.
|
||||||
|
(main): Use SUN_LEN.
|
||||||
|
|
||||||
2009-04-17 Werner Koch <wk@g10code.com>
|
2009-04-17 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* ccidmon.c: New.
|
* ccidmon.c: New.
|
||||||
|
@ -86,7 +86,6 @@ create_server_socket (const char *filename, int *new_sock)
|
|||||||
name.sun_family = AF_LOCAL;
|
name.sun_family = AF_LOCAL;
|
||||||
strncpy (name.sun_path, filename, sizeof (name.sun_path));
|
strncpy (name.sun_path, filename, sizeof (name.sun_path));
|
||||||
name.sun_path[sizeof (name.sun_path) - 1] = '\0';
|
name.sun_path[sizeof (name.sun_path) - 1] = '\0';
|
||||||
|
|
||||||
size = SUN_LEN (&name);
|
size = SUN_LEN (&name);
|
||||||
|
|
||||||
remove (filename);
|
remove (filename);
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#define PGM "watchgnupg"
|
#define PGM "watchgnupg"
|
||||||
|
|
||||||
/* Allow for a standalone build. */
|
/* Allow for a standalone build on most systems. */
|
||||||
#ifdef VERSION
|
#ifdef VERSION
|
||||||
#define MYVERSION_LINE PGM " (GnuPG) " VERSION
|
#define MYVERSION_LINE PGM " (GnuPG) " VERSION
|
||||||
#define BUGREPORT_LINE "\nReport bugs to <bug-gnupg@gnu.org>.\n"
|
#define BUGREPORT_LINE "\nReport bugs to <bug-gnupg@gnu.org>.\n"
|
||||||
@ -43,16 +43,9 @@
|
|||||||
#define MYVERSION_LINE PGM
|
#define MYVERSION_LINE PGM
|
||||||
#define BUGREPORT_LINE ""
|
#define BUGREPORT_LINE ""
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(SUN_LEN) || !defined(PF_LOCAL) || !defined(AF_LOCAL)
|
||||||
#ifndef PF_LOCAL
|
#define JNLIB_NEED_AFLOCAL
|
||||||
# ifdef PF_UNIX
|
#include "../jnlib/mischelp.h"
|
||||||
# define PF_LOCAL PF_UNIX
|
|
||||||
# else
|
|
||||||
# define PF_LOCAL AF_UNIX
|
|
||||||
# endif
|
|
||||||
# ifndef AF_LOCAL
|
|
||||||
# define AF_LOCAL AF_UNIX
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -285,8 +278,7 @@ main (int argc, char **argv)
|
|||||||
srvr_addr.sun_family = AF_LOCAL;
|
srvr_addr.sun_family = AF_LOCAL;
|
||||||
strncpy (srvr_addr.sun_path, *argv, sizeof (srvr_addr.sun_path) - 1);
|
strncpy (srvr_addr.sun_path, *argv, sizeof (srvr_addr.sun_path) - 1);
|
||||||
srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0;
|
srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0;
|
||||||
addrlen = (offsetof (struct sockaddr_un, sun_path)
|
addrlen = SUN_LEN (&srvr_addr);
|
||||||
+ strlen (srvr_addr.sun_path) + 1);
|
|
||||||
|
|
||||||
|
|
||||||
again:
|
again:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user