Browse Source

n/gnupg2: Use the system DNS resolver.

slackware-14.2
Damien Goutte-Gattat 5 years ago
parent
commit
5e7d1a4159
  1. 72
      n/gnupg2/gnupg-2.1.17-fix-disable-libdns.diff
  2. 4
      n/gnupg2/gnupg2.SlackBuild

72
n/gnupg2/gnupg-2.1.17-fix-disable-libdns.diff

@ -0,0 +1,72 @@
commit d26c51825e2255fe58305cbc1cd74fa43f80d93e
Author: NIIBE Yutaka <gniibe@fsij.org>
Date: Fri Dec 23 16:05:01 2016 +0900
dirmngr: Fix for --disable-libdns usage.
* dirmngr/dns-stuff.c (enable_recursive_resolver, set_dns_nameserver)
(reload_dns_stuff): Conditionalize with USE_LIBDNS.
(get_h_errno_as_gpg_error): Map HOST_NOT_FOUND to GPG_ERR_NO_NAME.
--
get_dns_srv assumes error code of GPG_ERR_NO_NAME when no SRV record
available.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
GnuPG-bug-id: 2889
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 491fcce..a31b073 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -181,7 +181,9 @@ void
enable_recursive_resolver (int yes)
{
recursive_resolver = yes;
+#ifdef USE_LIBDNS
libdns_reinit_pending = 1;
+#endif
}
@@ -251,8 +253,10 @@ set_dns_nameserver (const char *ipaddr)
strncpy (tor_nameserver, ipaddr? ipaddr : DEFAULT_NAMESERVER,
sizeof tor_nameserver -1);
tor_nameserver[sizeof tor_nameserver -1] = 0;
+#ifdef USE_LIBDNS
libdns_reinit_pending = 1;
libdns_tor_port = 0; /* Start again with the default port. */
+#endif
}
@@ -278,7 +282,7 @@ get_h_errno_as_gpg_error (void)
switch (h_errno)
{
- case HOST_NOT_FOUND: ec = GPG_ERR_UNKNOWN_HOST; break;
+ case HOST_NOT_FOUND: ec = GPG_ERR_NO_NAME; break;
case TRY_AGAIN: ec = GPG_ERR_TRY_LATER; break;
case NO_RECOVERY: ec = GPG_ERR_SERVER_FAILED; break;
case NO_DATA: ec = GPG_ERR_NO_DATA; break;
@@ -534,15 +538,17 @@ libdns_deinit (void)
void
reload_dns_stuff (int force)
{
+#ifdef USE_LIBDNS
if (force)
{
-#ifdef USE_LIBDNS
libdns_deinit ();
-#endif
libdns_reinit_pending = 0;
}
else
libdns_reinit_pending = 1;
+#else
+ (void)force;
+#endif
}

4
n/gnupg2/gnupg2.SlackBuild

@ -35,7 +35,7 @@ WGET=${WGET:-https://www.gnupg.org/ftp/gcrypt/gnupg/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-gnupg2}
BUILD=${BUILD:-1GGD}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -86,6 +86,7 @@ cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/gnupg-2.1.17-fix-disable-libdns.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
@ -95,6 +96,7 @@ CXXFLAGS=$CPUOPT \
--mandir=/usr/man \
--infodir=/usr/info \
--docdir=/usr/doc/$NAMEPKG-$PKGVERSION \
--disable-libdns \
--build=$ARCH-slackware-linux
make -j $JOBS
make install-strip DESTDIR=$PKG

Loading…
Cancel
Save