Page MenuHome GnuPG

libassuan not opening redirected socket if $GNUPGHOME/S.gpg-agent path longer than sun_path
Closed, ResolvedPublic

Description

Reproduce error by starting gpg-agent (e.g. gnupg-2.1.11) against GNUPGOME
longer than 96 characters. and S.gpg-agent configuration to sane socket location:
-------->8--------
%Assuan%
socket=/tmp/S.gpg-agnent-test
-------->8--------

Please consider following patch for resolving the problem

  • a/src/assuan-socket-connect.c

+++ b/src/assuan-socket-connect.c
@@ -233,13 +233,12 @@ assuan_socket_connect (assuan_context_t ctx, const char *name,

if (af == AF_LOCAL)
  {
  • if (strlen (name)+1 >= sizeof srvr_addr_un.sun_path)
  • return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);

+ int redirected;
+ if (assuan_sock_set_sockaddr_un (name, (struct sockaddr *)&srvr_addr_un,
&redirected))
+ {
+ return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+ }

  • memset (&srvr_addr_un, 0, sizeof srvr_addr_un);
  • srvr_addr_un.sun_family = AF_LOCAL;
  • strncpy (srvr_addr_un.sun_path, name, sizeof (srvr_addr_un.sun_path) - 1);
  • srvr_addr_un.sun_path[sizeof (srvr_addr_un.sun_path) - 1] = 0; len = SUN_LEN (&srvr_addr_un); srvr_addr = (struct sockaddr *)&srvr_addr_un;

Details

Version
2.4.2

Event Timeline

uldis set Version to 2.4.2.
uldis added a subscriber: uldis.

Thanks. Changed with commit 678f606 for 2.4.3

2.4.3 has been released and I assume that this works now. Feel free to re-open
if it is not the case.

werner removed a project: Restricted Project.