mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 03:09:51 +03:00
parent
727f2dd485
commit
bcaf6282ba
3 changed files with 3 additions and 178 deletions
|
@ -1,38 +0,0 @@
|
|||
From 1c26b534bfd9fe5b4092903806473ee3eca16af9 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Kelley <simon@thekelleys.org.uk>
|
||||
Date: Mon, 19 Feb 2024 23:21:58 +0000
|
||||
Subject: [PATCH] Fix infinite loop when invoking SetFilterA dbus method more
|
||||
than once.
|
||||
|
||||
Fix infinite loop when invoking SetFilterA dbus method more than once.
|
||||
|
||||
Also applies to SetFilterAAAA.
|
||||
|
||||
Thanks to Clayton Craft for spotting the issue.
|
||||
---
|
||||
src/dbus.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/dbus.c b/src/dbus.c
|
||||
index ad6a4f3..84a8d97 100644
|
||||
--- a/src/dbus.c
|
||||
+++ b/src/dbus.c
|
||||
@@ -833,6 +833,7 @@ DBusHandlerResult message_handler(DBusConnection *connection,
|
||||
|
||||
if (!done)
|
||||
{
|
||||
+ done = 1;
|
||||
list.next = daemon->filter_rr;
|
||||
daemon->filter_rr = &list;
|
||||
}
|
||||
@@ -844,6 +845,7 @@ DBusHandlerResult message_handler(DBusConnection *connection,
|
||||
|
||||
if (!done)
|
||||
{
|
||||
+ done = 1;
|
||||
list.next = daemon->filter_rr;
|
||||
daemon->filter_rr = &list;
|
||||
}
|
||||
--
|
||||
2.43.1
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
From 4c590320ec5442d431c5e059c890077ec6d67575 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Kelley <simon@thekelleys.org.uk>
|
||||
Date: Tue, 20 Feb 2024 23:38:26 +0000
|
||||
Subject: [PATCH] Fix breakage in DBus FilterA and FilterAAAA methods.
|
||||
|
||||
In generalising the RR filter code, the Dbus methods
|
||||
controlling filtering A and AAAA records
|
||||
got severely broken. This, and the previous commit,
|
||||
fixes things.
|
||||
---
|
||||
src/dbus.c | 67 +++++++++++++++++++++++++++++++++++-------------------
|
||||
src/util.c | 2 +-
|
||||
2 files changed, 45 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/src/dbus.c b/src/dbus.c
|
||||
index 84a8d97..87c4b80 100644
|
||||
--- a/src/dbus.c
|
||||
+++ b/src/dbus.c
|
||||
@@ -485,28 +485,37 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
|
||||
return error;
|
||||
}
|
||||
|
||||
-static DBusMessage *dbus_set_bool(DBusMessage *message, int flag, char *name)
|
||||
+static DBusMessage *dbus_get_bool(DBusMessage *message, dbus_bool_t *enabled, char *name)
|
||||
{
|
||||
DBusMessageIter iter;
|
||||
- dbus_bool_t enabled;
|
||||
|
||||
if (!dbus_message_iter_init(message, &iter) || dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BOOLEAN)
|
||||
return dbus_message_new_error(message, DBUS_ERROR_INVALID_ARGS, "Expected boolean argument");
|
||||
|
||||
- dbus_message_iter_get_basic(&iter, &enabled);
|
||||
-
|
||||
- if (enabled)
|
||||
- {
|
||||
- my_syslog(LOG_INFO, _("Enabling --%s option from D-Bus"), name);
|
||||
- set_option_bool(flag);
|
||||
- }
|
||||
+ dbus_message_iter_get_basic(&iter, enabled);
|
||||
+
|
||||
+ if (*enabled)
|
||||
+ my_syslog(LOG_INFO, _("Enabling --%s option from D-Bus"), name);
|
||||
else
|
||||
+ my_syslog(LOG_INFO, _("Disabling --%s option from D-Bus"), name);
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static DBusMessage *dbus_set_bool(DBusMessage *message, int flag, char *name)
|
||||
+{
|
||||
+ dbus_bool_t val;
|
||||
+ DBusMessage *reply = dbus_get_bool(message, &val, name);
|
||||
+
|
||||
+ if (!reply)
|
||||
{
|
||||
- my_syslog(LOG_INFO, _("Disabling --%s option from D-Bus"), name);
|
||||
- reset_option_bool(flag);
|
||||
+ if (val)
|
||||
+ set_option_bool(flag);
|
||||
+ else
|
||||
+ reset_option_bool(flag);
|
||||
}
|
||||
|
||||
- return NULL;
|
||||
+ return reply;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DHCP
|
||||
@@ -829,25 +838,37 @@ DBusHandlerResult message_handler(DBusConnection *connection,
|
||||
else if (strcmp(method, "SetFilterA") == 0)
|
||||
{
|
||||
static int done = 0;
|
||||
- static struct rrlist list = { T_A, NULL };
|
||||
+ static struct rrlist list = { 0, NULL };
|
||||
+ dbus_bool_t enabled;
|
||||
|
||||
- if (!done)
|
||||
+ if (!(reply = dbus_get_bool(message, &enabled, "filter-A")))
|
||||
{
|
||||
- done = 1;
|
||||
- list.next = daemon->filter_rr;
|
||||
- daemon->filter_rr = &list;
|
||||
+ if (!done)
|
||||
+ {
|
||||
+ done = 1;
|
||||
+ list.next = daemon->filter_rr;
|
||||
+ daemon->filter_rr = &list;
|
||||
+ }
|
||||
+
|
||||
+ list.rr = enabled ? T_A : 0;
|
||||
}
|
||||
}
|
||||
else if (strcmp(method, "SetFilterAAAA") == 0)
|
||||
{
|
||||
static int done = 0;
|
||||
- static struct rrlist list = { T_AAAA, NULL };
|
||||
-
|
||||
- if (!done)
|
||||
+ static struct rrlist list = { 0, NULL };
|
||||
+ dbus_bool_t enabled;
|
||||
+
|
||||
+ if (!(reply = dbus_get_bool(message, &enabled, "filter-AAAA")))
|
||||
{
|
||||
- done = 1;
|
||||
- list.next = daemon->filter_rr;
|
||||
- daemon->filter_rr = &list;
|
||||
+ if (!done)
|
||||
+ {
|
||||
+ done = 1;
|
||||
+ list.next = daemon->filter_rr;
|
||||
+ daemon->filter_rr = &list;
|
||||
+ }
|
||||
+
|
||||
+ list.rr = enabled ? T_AAAA : 0;
|
||||
}
|
||||
}
|
||||
else if (strcmp(method, "SetLocaliseQueriesOption") == 0)
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 0c7de44..c527381 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -119,7 +119,7 @@ int rr_on_list(struct rrlist *list, unsigned short rr)
|
||||
{
|
||||
while (list)
|
||||
{
|
||||
- if (list->rr == rr)
|
||||
+ if (list->rr != 0 && list->rr == rr)
|
||||
return 1;
|
||||
|
||||
list = list->next;
|
||||
--
|
||||
2.43.2
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
||||
pkgname=dnsmasq
|
||||
pkgver=2.90
|
||||
pkgrel=3
|
||||
pkgver=2.91
|
||||
pkgrel=0
|
||||
pkgdesc="A lightweight DNS, DHCP, RA, TFTP and PXE server"
|
||||
url="https://www.thekelleys.org.uk/dnsmasq/"
|
||||
arch="all"
|
||||
|
@ -37,8 +37,6 @@ subpackages="
|
|||
"
|
||||
source="https://www.thekelleys.org.uk/dnsmasq/dnsmasq-$pkgver.tar.xz
|
||||
0000-underflow.patch
|
||||
0001-Fix-infinite-loop-when-invoking-SetFilterA-dbus-meth.patch
|
||||
0002-Fix-breakage-in-DBus-FilterA-and-FilterAAAA-methods.patch
|
||||
|
||||
config.h.patch
|
||||
dnsmasq.conf.patch
|
||||
|
@ -182,10 +180,8 @@ utils_doc() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
e169de1892f935e219b0f49d90107f95cba42b40bca20bd3c973313c2cd4df58b929af6628cd988419051d81c3b4ccf8e9f816274df7d0840e79f5bf49602442 dnsmasq-2.90.tar.xz
|
||||
d8b062d28f32d0e499e551aeebba75d3ea9f6a5173d78f45292cb1ef28a5d0f7c86982d987fe25c3cee9f139023b1fd023130dddd0dc849fb0cfbd969c3b0c7f dnsmasq-2.91.tar.xz
|
||||
5083bbe7150276d2226ba4b5bab73c513fe7baf4843b85d83d1ab16cb50e2dcc1dbd9ed04a89e2f9ea61796b12ea36206cc49a2574ce75abb37cb46279bd9aeb 0000-underflow.patch
|
||||
b4ced1017f7157f4b363e642d84b3e100ae1a4927f2de39f5d165bcb4df85b1c562f9e47ec66123703134c15adf90695e8b08baaa791d32889f6933ade22357a 0001-Fix-infinite-loop-when-invoking-SetFilterA-dbus-meth.patch
|
||||
e8f75c903d97898bf5d42cbd8712eac355922b80809a410ac5b295c70d5c5642a4108a3ae3d665b18e492470badbe29b2676735d1554dc79439d909cfd9a4be5 0002-Fix-breakage-in-DBus-FilterA-and-FilterAAAA-methods.patch
|
||||
d0274417019af84911f3f4a850e785797bdc77732fd93504fe21db7317a874d2ab54bf7a211d000a751cdc43e225a30be4c1a315ab2383fc3fcc619e436aed97 config.h.patch
|
||||
41679e0e889607896dcf7fdeb179b9b7a79095c9f86aebda131ac09c12e3ef2a94cece0018ab33ea08d3e6f6bbae44379e9d6fb8987fae29e68ecad952ccdd45 dnsmasq.conf.patch
|
||||
0c609a55ca0140d8f31f8f6eb4cb96eca7bc76385d48739998bea926b409f3d72cbfdffc30ad3f9e3a62db4ea3280f7fe6a60a12fc091164814a7cdf6a14b307 dnsmasq.initd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue