!4 dnssec-trigger在master进行升级,到0.17-1
From: @json-book Reviewed-by: @caodongxia Signed-off-by: @caodongxia
This commit is contained in:
commit
7eb3680275
@ -1,108 +0,0 @@
|
||||
From ef18b39abdb5e8bf870ada3c108ab7f083405d2c Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
Date: Thu, 15 Feb 2018 17:57:52 +0100
|
||||
Subject: [PATCH] dnssec-trigger-script: port to libnm
|
||||
|
||||
The libnm-glib is depreacted for a long time already and is eventually
|
||||
going away.
|
||||
---
|
||||
dnssec-trigger-script.in | 51 ++++++++++++++----------------------------------
|
||||
1 file changed, 15 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dnssec-trigger-script.in b/dnssec-trigger-script.in
|
||||
index 5f70580..14d9278 100644
|
||||
--- a/dnssec-trigger-script.in
|
||||
+++ b/dnssec-trigger-script.in
|
||||
@@ -13,14 +13,13 @@ import glob
|
||||
import subprocess
|
||||
import logging
|
||||
import logging.handlers
|
||||
-import socket
|
||||
import struct
|
||||
import signal
|
||||
|
||||
import gi
|
||||
-gi.require_version('NMClient', '1.0')
|
||||
+gi.require_version('NM', '1.0')
|
||||
|
||||
-from gi.repository import NMClient
|
||||
+from gi.repository import NM
|
||||
|
||||
# Python compatibility stuff
|
||||
if not hasattr(os, "O_CLOEXEC"):
|
||||
@@ -132,7 +131,7 @@ class ConnectionList:
|
||||
|
||||
def __init__(self, client, only_default=False, only_vpn=False, skip_wifi=False):
|
||||
# Cache the active connection list in the class
|
||||
- if not client.get_manager_running():
|
||||
+ if not client.get_nm_running():
|
||||
raise UserError("NetworkManager is not running.")
|
||||
if self.nm_connections is None:
|
||||
self.__class__.nm_connections = client.get_active_connections()
|
||||
@@ -208,40 +207,20 @@ class Connection:
|
||||
self.uuid = connection.get_uuid()
|
||||
|
||||
self.zones = []
|
||||
- try:
|
||||
- self.zones += connection.get_ip4_config().get_domains()
|
||||
- except AttributeError:
|
||||
- pass
|
||||
- try:
|
||||
- self.zones += connection.get_ip6_config().get_domains()
|
||||
- except AttributeError:
|
||||
- pass
|
||||
-
|
||||
self.servers = []
|
||||
- try:
|
||||
- self.servers += [self.ip4_to_str(server) for server in connection.get_ip4_config().get_nameservers()]
|
||||
- except AttributeError:
|
||||
- pass
|
||||
- try:
|
||||
- self.servers += [self.ip6_to_str(connection.get_ip6_config().get_nameserver(i))
|
||||
- for i in range(connection.get_ip6_config().get_num_nameservers())]
|
||||
- except AttributeError:
|
||||
- pass
|
||||
-
|
||||
- def __repr__(self):
|
||||
- return "<Connection(uuid={uuid}, type={type}, default={is_default}, zones={zones}, servers={servers})>".format(**vars(self))
|
||||
|
||||
- @staticmethod
|
||||
- def ip4_to_str(ip4):
|
||||
- """Converts IPv4 address from integer to string."""
|
||||
-
|
||||
- return socket.inet_ntop(socket.AF_INET, struct.pack("=I", ip4))
|
||||
+ ip4_config = connection.get_ip4_config()
|
||||
+ if ip4_config is not None:
|
||||
+ self.zones += ip4_config.get_domains()
|
||||
+ self.servers += ip4_config.get_nameservers()
|
||||
|
||||
- @staticmethod
|
||||
- def ip6_to_str(ip6):
|
||||
- """Converts IPv6 address from integer to string."""
|
||||
+ ip6_config = connection.get_ip6_config()
|
||||
+ if ip6_config is not None:
|
||||
+ self.zones += ip6_config.get_domains()
|
||||
+ self.servers += ip6_config.get_nameservers()
|
||||
|
||||
- return socket.inet_ntop(socket.AF_INET6, ip6)
|
||||
+ def __repr__(self):
|
||||
+ return "<Connection(uuid={uuid}, type={type}, default={is_default}, zones={zones}, servers={servers})>".format(**vars(self))
|
||||
|
||||
@property
|
||||
def ignore(self):
|
||||
@@ -466,10 +445,10 @@ class Application:
|
||||
except AttributeError:
|
||||
self.usage()
|
||||
|
||||
- self.client = NMClient.Client().new()
|
||||
+ self.client = NM.Client().new()
|
||||
|
||||
def nm_handles_resolv_conf(self):
|
||||
- if not self.client.get_manager_running():
|
||||
+ if not self.client.get_nm_running():
|
||||
log.debug("NetworkManager is not running")
|
||||
return False
|
||||
try:
|
||||
--
|
||||
2.13.6
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 871f36410b93abc2a2e583043665337d25d66c1e Mon Sep 17 00:00:00 2001
|
||||
From: Wouter Wijngaards <wouter@nlnetlabs.nl>
|
||||
Date: Mon, 26 Feb 2018 13:48:26 +0000
|
||||
Subject: [PATCH] - Fix that NXDOMAIN for _probe.uk.uk is deemed allright.
|
||||
|
||||
git-svn-id: file:///svn/dnssec-trigger/trunk@764 14dc9c71-5cc2-e011-b339-0019d10b89f4
|
||||
---
|
||||
riggerd/probe.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/riggerd/probe.c b/riggerd/probe.c
|
||||
index 4781e01..0954766 100644
|
||||
--- a/riggerd/probe.c
|
||||
+++ b/riggerd/probe.c
|
||||
@@ -490,7 +490,8 @@ outq_check_packet(struct outq* outq, uint8_t* wire, size_t len)
|
||||
}
|
||||
|
||||
/* does DNS work? */
|
||||
- if(ldns_pkt_get_rcode(p) != LDNS_RCODE_NOERROR) {
|
||||
+ if(ldns_pkt_get_rcode(p) != LDNS_RCODE_NOERROR &&
|
||||
+ ldns_pkt_get_rcode(p) != LDNS_RCODE_NXDOMAIN) {
|
||||
char* r = ldns_pkt_rcode2str(ldns_pkt_get_rcode(p));
|
||||
snprintf(reason, sizeof(reason), "no answer, %s",
|
||||
r?r:"(out of memory)");
|
||||
--
|
||||
2.14.3
|
||||
|
||||
Binary file not shown.
BIN
dnssec-trigger-0.17.tar.gz
Normal file
BIN
dnssec-trigger-0.17.tar.gz
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
Name: dnssec-trigger
|
||||
Version: 0.15
|
||||
Release: 9
|
||||
Version: 0.17
|
||||
Release: 1
|
||||
Summary: Dnssec-trigger reconfigures the local Unbound DNS server
|
||||
License: BSD
|
||||
Url: http://www.nlnetlabs.nl/downloads/dnssec-trigger/
|
||||
@ -8,8 +8,6 @@ Source0: http://www.nlnetlabs.nl/downloads/dnssec-trigger/%{name}-%{ver
|
||||
Source1: dnssec-trigger.tmpfiles.d
|
||||
Source2: dnssec-trigger-default.conf
|
||||
|
||||
Patch0001: 0001-dnssec-trigger-script-port-to-libnm.patch
|
||||
Patch0002: 0002-Fix-that-NXDOMAIN-for-_probe.uk.uk-is-deemed-allrigh.patch
|
||||
|
||||
BuildRequires: openssl-devel ldns-devel python3-devel gcc NetworkManager-libnm-devel systemd
|
||||
Requires: ldns >= 1.6.10 NetworkManager-libnm unbound openssl e2fsprogs NetworkManager >= 0.9.9.1-13
|
||||
@ -120,5 +118,8 @@ fi
|
||||
%{_mandir}/man8/dnssec-trigger*
|
||||
|
||||
%changelog
|
||||
* Sat Feb 04 2023 wenchaofan <349464272@qq.com> - 0.17-1
|
||||
* Update to 0.17 version
|
||||
|
||||
* Wed Nov 20 2019 duyeyu <duyeyu@huawei.com> - 0.15-9
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user