Compare commits
No commits in common. 'c8' and 'c9' have entirely different histories.
@ -1 +1 @@
|
|||||||
8a062878968c0f8e083046429647ad33b122542f SOURCES/avahi-0.7.tar.gz
|
969a50ae18c8d8e2288435a75666dd076e69852a SOURCES/avahi-0.8.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
SOURCES/avahi-0.7.tar.gz
|
SOURCES/avahi-0.8.tar.gz
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
From bbf47e831143dc87c90811f404ccbae580930ff0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Gustavo Noronha Silva <gustavo@noronha.dev.br>
|
|
||||||
Date: Sun, 2 Jan 2022 22:29:04 -0300
|
|
||||||
Subject: [PATCH] Do not disable timeout cleanup on watch cleanup
|
|
||||||
|
|
||||||
This was causing timeouts to never be removed from the linked list that
|
|
||||||
tracks them, resulting in both memory and CPU usage to grow larger over
|
|
||||||
time.
|
|
||||||
---
|
|
||||||
avahi-common/simple-watch.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-common/simple-watch.c b/avahi-common/simple-watch.c
|
|
||||||
index 08d8090..2a4a989 100644
|
|
||||||
--- a/avahi-common/simple-watch.c
|
|
||||||
+++ b/avahi-common/simple-watch.c
|
|
||||||
@@ -238,7 +238,7 @@ static void cleanup_watches(AvahiSimplePoll *s, int all) {
|
|
||||||
destroy_watch(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
- s->timeout_req_cleanup = 0;
|
|
||||||
+ s->watch_req_cleanup = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) {
|
|
||||||
--
|
|
||||||
2.45.2
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
From 94cb6489114636940ac683515417990b55b5d66c Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
|
||||||
Date: Tue, 11 Apr 2023 15:29:59 +0200
|
|
||||||
Subject: [PATCH] Ensure each label is at least one byte long
|
|
||||||
|
|
||||||
The only allowed exception is single dot, where it should return empty
|
|
||||||
string.
|
|
||||||
|
|
||||||
Fixes #454.
|
|
||||||
---
|
|
||||||
avahi-common/domain-test.c | 14 ++++++++++++++
|
|
||||||
avahi-common/domain.c | 2 +-
|
|
||||||
2 files changed, 15 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-common/domain-test.c b/avahi-common/domain-test.c
|
|
||||||
index cf763ec..3acc1c1 100644
|
|
||||||
--- a/avahi-common/domain-test.c
|
|
||||||
+++ b/avahi-common/domain-test.c
|
|
||||||
@@ -45,6 +45,20 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
|
|
||||||
printf("%s\n", s = avahi_normalize_name_strdup("fo\\\\o\\..f oo."));
|
|
||||||
avahi_free(s);
|
|
||||||
|
|
||||||
+ printf("%s\n", s = avahi_normalize_name_strdup("."));
|
|
||||||
+ avahi_free(s);
|
|
||||||
+
|
|
||||||
+ s = avahi_normalize_name_strdup(",.=.}.=.?-.}.=.?.?.}.}.?.?.?.z.?.?.}.}."
|
|
||||||
+ "}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.=.=.?.?.}.}.?.?.}.}.}"
|
|
||||||
+ ".?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.=.=.?.?.}.}.?.?.?.zM.?`"
|
|
||||||
+ "?.}.}.}.?.?.?.r.=.?.}.=.?.?.}.?.?.?.}.=.?.?.}??.}.}.?.?."
|
|
||||||
+ "?.z.?.?.}.}.}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM.?`?.}.}.}."
|
|
||||||
+ "??.?.zM.?`?.}.}.}.?.?.?.r.=.?.}.=.?.?.}.?.?.?.}.=.?.?.}?"
|
|
||||||
+ "?.}.}.?.?.?.z.?.?.}.}.}.?.?.?.r.=.=.}.=.?.}}.}.?.?.?.zM."
|
|
||||||
+ "?`?.}.}.}.?.?.?.r.=.=.?.?`.?.?}.}.}.?.?.?.r.=.?.}.=.?.?."
|
|
||||||
+ "}.?.?.?.}.=.?.?.}");
|
|
||||||
+ assert(s == NULL);
|
|
||||||
+
|
|
||||||
printf("%i\n", avahi_domain_equal("\\065aa bbb\\.\\046cc.cc\\\\.dee.fff.", "Aaa BBB\\.\\.cc.cc\\\\.dee.fff"));
|
|
||||||
printf("%i\n", avahi_domain_equal("A", "a"));
|
|
||||||
|
|
||||||
diff --git a/avahi-common/domain.c b/avahi-common/domain.c
|
|
||||||
index 3b1ab68..e66d241 100644
|
|
||||||
--- a/avahi-common/domain.c
|
|
||||||
+++ b/avahi-common/domain.c
|
|
||||||
@@ -201,7 +201,7 @@ char *avahi_normalize_name(const char *s, char *ret_s, size_t size) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty) {
|
|
||||||
- if (size < 1)
|
|
||||||
+ if (size < 2)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
*(r++) = '.';
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -0,0 +1,151 @@
|
|||||||
|
From 9d31939e55280a733d930b15ac9e4dda4497680c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tommi Rantala <tommi.t.rantala@nokia.com>
|
||||||
|
Date: Mon, 8 Feb 2021 11:04:43 +0200
|
||||||
|
Subject: [PATCH] Fix NULL pointer crashes from #175
|
||||||
|
|
||||||
|
avahi-daemon is crashing when running "ping .local".
|
||||||
|
The crash is due to failing assertion from NULL pointer.
|
||||||
|
Add missing NULL pointer checks to fix it.
|
||||||
|
|
||||||
|
Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd
|
||||||
|
---
|
||||||
|
avahi-core/browse-dns-server.c | 5 ++++-
|
||||||
|
avahi-core/browse-domain.c | 5 ++++-
|
||||||
|
avahi-core/browse-service-type.c | 3 +++
|
||||||
|
avahi-core/browse-service.c | 3 +++
|
||||||
|
avahi-core/browse.c | 3 +++
|
||||||
|
avahi-core/resolve-address.c | 5 ++++-
|
||||||
|
avahi-core/resolve-host-name.c | 5 ++++-
|
||||||
|
avahi-core/resolve-service.c | 5 ++++-
|
||||||
|
8 files changed, 29 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/avahi-core/browse-dns-server.c b/avahi-core/browse-dns-server.c
|
||||||
|
index 049752e..c2d914f 100644
|
||||||
|
--- a/avahi-core/browse-dns-server.c
|
||||||
|
+++ b/avahi-core/browse-dns-server.c
|
||||||
|
@@ -343,7 +343,10 @@ AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
|
||||||
|
AvahiSDNSServerBrowser* b;
|
||||||
|
|
||||||
|
b = avahi_s_dns_server_browser_prepare(server, interface, protocol, domain, type, aprotocol, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_dns_server_browser_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
||||||
|
diff --git a/avahi-core/browse-domain.c b/avahi-core/browse-domain.c
|
||||||
|
index f145d56..06fa70c 100644
|
||||||
|
--- a/avahi-core/browse-domain.c
|
||||||
|
+++ b/avahi-core/browse-domain.c
|
||||||
|
@@ -253,7 +253,10 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new(
|
||||||
|
AvahiSDomainBrowser *b;
|
||||||
|
|
||||||
|
b = avahi_s_domain_browser_prepare(server, interface, protocol, domain, type, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_domain_browser_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
||||||
|
diff --git a/avahi-core/browse-service-type.c b/avahi-core/browse-service-type.c
|
||||||
|
index fdd22dc..b1fc7af 100644
|
||||||
|
--- a/avahi-core/browse-service-type.c
|
||||||
|
+++ b/avahi-core/browse-service-type.c
|
||||||
|
@@ -171,6 +171,9 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
|
||||||
|
AvahiSServiceTypeBrowser *b;
|
||||||
|
|
||||||
|
b = avahi_s_service_type_browser_prepare(server, interface, protocol, domain, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_service_type_browser_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
diff --git a/avahi-core/browse-service.c b/avahi-core/browse-service.c
|
||||||
|
index 5531360..63e0275 100644
|
||||||
|
--- a/avahi-core/browse-service.c
|
||||||
|
+++ b/avahi-core/browse-service.c
|
||||||
|
@@ -184,6 +184,9 @@ AvahiSServiceBrowser *avahi_s_service_browser_new(
|
||||||
|
AvahiSServiceBrowser *b;
|
||||||
|
|
||||||
|
b = avahi_s_service_browser_prepare(server, interface, protocol, service_type, domain, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_service_browser_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
diff --git a/avahi-core/browse.c b/avahi-core/browse.c
|
||||||
|
index 2941e57..e8a915e 100644
|
||||||
|
--- a/avahi-core/browse.c
|
||||||
|
+++ b/avahi-core/browse.c
|
||||||
|
@@ -634,6 +634,9 @@ AvahiSRecordBrowser *avahi_s_record_browser_new(
|
||||||
|
AvahiSRecordBrowser *b;
|
||||||
|
|
||||||
|
b = avahi_s_record_browser_prepare(server, interface, protocol, key, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_record_browser_start_query(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
diff --git a/avahi-core/resolve-address.c b/avahi-core/resolve-address.c
|
||||||
|
index ac0b29b..e61dd24 100644
|
||||||
|
--- a/avahi-core/resolve-address.c
|
||||||
|
+++ b/avahi-core/resolve-address.c
|
||||||
|
@@ -286,7 +286,10 @@ AvahiSAddressResolver *avahi_s_address_resolver_new(
|
||||||
|
AvahiSAddressResolver *b;
|
||||||
|
|
||||||
|
b = avahi_s_address_resolver_prepare(server, interface, protocol, address, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_address_resolver_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
||||||
|
diff --git a/avahi-core/resolve-host-name.c b/avahi-core/resolve-host-name.c
|
||||||
|
index 808b0e7..4e8e597 100644
|
||||||
|
--- a/avahi-core/resolve-host-name.c
|
||||||
|
+++ b/avahi-core/resolve-host-name.c
|
||||||
|
@@ -318,7 +318,10 @@ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
|
||||||
|
AvahiSHostNameResolver *b;
|
||||||
|
|
||||||
|
b = avahi_s_host_name_resolver_prepare(server, interface, protocol, host_name, aprotocol, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_host_name_resolver_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
||||||
|
diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c
|
||||||
|
index 66bf3ca..4377176 100644
|
||||||
|
--- a/avahi-core/resolve-service.c
|
||||||
|
+++ b/avahi-core/resolve-service.c
|
||||||
|
@@ -519,7 +519,10 @@ AvahiSServiceResolver *avahi_s_service_resolver_new(
|
||||||
|
AvahiSServiceResolver *b;
|
||||||
|
|
||||||
|
b = avahi_s_service_resolver_prepare(server, interface, protocol, name, type, domain, aprotocol, flags, callback, userdata);
|
||||||
|
+ if (!b)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
avahi_s_service_resolver_start(b);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
-}
|
||||||
|
\ No newline at end of file
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
@ -1,231 +0,0 @@
|
|||||||
From be7992f35ab4ed7ed9907319b429dc079c2b7285 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
|
|
||||||
Date: Tue, 11 Jul 2017 21:52:37 +0200
|
|
||||||
Subject: [PATCH] avahi-python: Use the agnostic DBM interface
|
|
||||||
|
|
||||||
Also fixes configure failing if Python 3 is the build python and GDBM is
|
|
||||||
enabled, since Py3 only has anydbm under the name of 'dbm'.
|
|
||||||
|
|
||||||
Not enough to make ServiceTypeDatabase.py compatible with Py3, but it's
|
|
||||||
a start.
|
|
||||||
|
|
||||||
(cherry picked from commit 63750f1be96ad08c407193b08bf3b9ee74310e2d)
|
|
||||||
|
|
||||||
Related: #1561019
|
|
||||||
---
|
|
||||||
avahi-python/avahi/Makefile.am | 15 +----------
|
|
||||||
avahi-python/avahi/ServiceTypeDatabase.py.in | 33 ++++++++++++++++++-------
|
|
||||||
configure.ac | 9 +++----
|
|
||||||
service-type-database/Makefile.am | 18 +++-----------
|
|
||||||
service-type-database/{build-db.in => build-db} | 13 +++++++---
|
|
||||||
5 files changed, 42 insertions(+), 46 deletions(-)
|
|
||||||
rename service-type-database/{build-db.in => build-db} (87%)
|
|
||||||
|
|
||||||
diff --git a/avahi-python/avahi/Makefile.am b/avahi-python/avahi/Makefile.am
|
|
||||||
index 3eb67d0..c906b9b 100644
|
|
||||||
--- a/avahi-python/avahi/Makefile.am
|
|
||||||
+++ b/avahi-python/avahi/Makefile.am
|
|
||||||
@@ -25,29 +25,16 @@ avahidir = $(pythondir)/avahi
|
|
||||||
|
|
||||||
if HAVE_GDBM
|
|
||||||
nodist_avahi_SCRIPTS = ServiceTypeDatabase.py
|
|
||||||
-
|
|
||||||
-ServiceTypeDatabase.py: ServiceTypeDatabase.py.in
|
|
||||||
- $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
|
|
||||||
- -e 's,@DBM\@,gdbm,g' \
|
|
||||||
- -e 's,@FIRST_KEY\@,key = self.db.firstkey(),g' \
|
|
||||||
- -e 's,@CHECK_KEY\@,while key is not None:,g' \
|
|
||||||
- -e 's,@NEXT_KEY\@,key = self.db.nextkey(key),g' \
|
|
||||||
- -e 's,@pkglibdatadir\@,$(pkglibdatadir),g' $< > $@ && \
|
|
||||||
- chmod +x $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_DBM
|
|
||||||
nodist_avahi_SCRIPTS = ServiceTypeDatabase.py
|
|
||||||
+endif
|
|
||||||
|
|
||||||
ServiceTypeDatabase.py: ServiceTypeDatabase.py.in
|
|
||||||
$(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
|
|
||||||
- -e 's,@DBM\@,dbm,g' \
|
|
||||||
- -e 's,@FIRST_KEY\@,keys = self.db.keys(),g' \
|
|
||||||
- -e 's,@CHECK_KEY\@,for key in keys:,g' \
|
|
||||||
- -e 's,@NEXT_KEY\@,,g' \
|
|
||||||
-e 's,@pkglibdatadir\@,$(pkglibdatadir),g' $< > $@ && \
|
|
||||||
chmod +x $@
|
|
||||||
-endif
|
|
||||||
|
|
||||||
avahi_PYTHON = $(avahi_SCRIPTS)
|
|
||||||
|
|
||||||
diff --git a/avahi-python/avahi/ServiceTypeDatabase.py.in b/avahi-python/avahi/ServiceTypeDatabase.py.in
|
|
||||||
index 4ddd654..d7f9969 100644
|
|
||||||
--- a/avahi-python/avahi/ServiceTypeDatabase.py.in
|
|
||||||
+++ b/avahi-python/avahi/ServiceTypeDatabase.py.in
|
|
||||||
@@ -17,7 +17,11 @@
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
# USA.
|
|
||||||
|
|
||||||
-import @DBM@
|
|
||||||
+try:
|
|
||||||
+ import anydbm as dbm
|
|
||||||
+except ImportError:
|
|
||||||
+ import dbm
|
|
||||||
+
|
|
||||||
import locale
|
|
||||||
import re
|
|
||||||
|
|
||||||
@@ -28,7 +32,7 @@ class ServiceTypeDatabase:
|
|
||||||
|
|
||||||
def __init__(self, filename = "@pkglibdatadir@/service-types.db"):
|
|
||||||
|
|
||||||
- self.db = @DBM@.open(filename, "r")
|
|
||||||
+ self.db = dbm.open(filename, "r")
|
|
||||||
|
|
||||||
l = locale.getlocale(locale.LC_MESSAGES)
|
|
||||||
|
|
||||||
@@ -90,13 +94,24 @@ class ServiceTypeDatabase:
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
|
|
||||||
- @FIRST_KEY@
|
|
||||||
- @CHECK_KEY@
|
|
||||||
-
|
|
||||||
- if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key) and not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key):
|
|
||||||
- yield key
|
|
||||||
-
|
|
||||||
- @NEXT_KEY@
|
|
||||||
+ def want_key(key):
|
|
||||||
+ if not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key):
|
|
||||||
+ return False
|
|
||||||
+ if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key):
|
|
||||||
+ return False
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ try:
|
|
||||||
+ key = self.db.firstkey()
|
|
||||||
+ except AttributeError:
|
|
||||||
+ for key in self.db.keys():
|
|
||||||
+ if want_key(key):
|
|
||||||
+ yield key
|
|
||||||
+ else:
|
|
||||||
+ while key is not None:
|
|
||||||
+ if want_key(key):
|
|
||||||
+ yield key
|
|
||||||
+ key = self.db.nextkey(key)
|
|
||||||
|
|
||||||
def __len__(self):
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 6678971..fbbf7cf 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -824,11 +824,10 @@ if test "x$HAVE_PYTHON" = "xyes" ; then
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
|
|
||||||
- if test "x$HAVE_GDBM" = "xyes"; then
|
|
||||||
- AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
|
|
||||||
- fi
|
|
||||||
- if test "x$HAVE_DBM" = "xyes"; then
|
|
||||||
- AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
|
|
||||||
+ if test "x$HAVE_GDBM" = "xyes" || test "x$HAVE_DBM" = "xyes"; then
|
|
||||||
+ AM_CHECK_PYMOD(anydbm,,,[
|
|
||||||
+ AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
|
|
||||||
+ ])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
diff --git a/service-type-database/Makefile.am b/service-type-database/Makefile.am
|
|
||||||
index d184fde..f9fa082 100644
|
|
||||||
--- a/service-type-database/Makefile.am
|
|
||||||
+++ b/service-type-database/Makefile.am
|
|
||||||
@@ -15,7 +15,7 @@
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
# USA.
|
|
||||||
|
|
||||||
-EXTRA_DIST=build-db.in service-types
|
|
||||||
+EXTRA_DIST=service-types
|
|
||||||
|
|
||||||
pkglibdatadir=$(libdir)/avahi
|
|
||||||
|
|
||||||
@@ -27,16 +27,11 @@ if HAVE_GDBM
|
|
||||||
noinst_SCRIPTS=build-db
|
|
||||||
pkglibdata_DATA+=service-types.db
|
|
||||||
|
|
||||||
-build-db: build-db.in
|
|
||||||
- $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
|
|
||||||
- -e 's,@DBM\@,gdbm,g' $< > $@ && \
|
|
||||||
- chmod +x $@
|
|
||||||
-
|
|
||||||
-service-types.db: service-types build-db
|
|
||||||
+service-types.db: service-types
|
|
||||||
$(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
|
|
||||||
mv $@.coming $@
|
|
||||||
|
|
||||||
-CLEANFILES = service-types.db build-db
|
|
||||||
+CLEANFILES = service-types.db
|
|
||||||
|
|
||||||
endif
|
|
||||||
if HAVE_DBM
|
|
||||||
@@ -44,11 +39,6 @@ if HAVE_DBM
|
|
||||||
noinst_SCRIPTS=build-db
|
|
||||||
pkglibdata_DATA+=service-types.db.pag service-types.db.dir
|
|
||||||
|
|
||||||
-build-db: build-db.in
|
|
||||||
- $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
|
|
||||||
- -e 's,@DBM\@,dbm,g' $< > $@ && \
|
|
||||||
- chmod +x $@
|
|
||||||
-
|
|
||||||
service-types.db.pag: service-types.db
|
|
||||||
$(AM_V_GEN)mv service-types.db.coming.pag service-types.db.pag
|
|
||||||
service-types.db.dir: service-types.db
|
|
||||||
@@ -57,7 +47,7 @@ service-types.db: service-types build-db
|
|
||||||
$(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
|
|
||||||
if test -f "$@.coming"; then mv $@.coming $@; fi
|
|
||||||
|
|
||||||
-CLEANFILES = service-types.db* build-db
|
|
||||||
+CLEANFILES = service-types.db*
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
diff --git a/service-type-database/build-db.in b/service-type-database/build-db
|
|
||||||
similarity index 87%
|
|
||||||
rename from service-type-database/build-db.in
|
|
||||||
rename to service-type-database/build-db
|
|
||||||
index 4cda425..78ee892 100755
|
|
||||||
--- a/service-type-database/build-db.in
|
|
||||||
+++ b/service-type-database/build-db
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-#!@PYTHON@
|
|
||||||
+#!/usr/bin/env python
|
|
||||||
# -*-python-*-
|
|
||||||
# This file is part of avahi.
|
|
||||||
#
|
|
||||||
@@ -17,7 +17,12 @@
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
# USA.
|
|
||||||
|
|
||||||
-import @DBM@, sys
|
|
||||||
+try:
|
|
||||||
+ import anydbm as dbm
|
|
||||||
+except ImportError:
|
|
||||||
+ import dbm
|
|
||||||
+
|
|
||||||
+import sys
|
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
infn = sys.argv[1]
|
|
||||||
@@ -29,9 +34,9 @@ if len(sys.argv) > 2:
|
|
||||||
else:
|
|
||||||
outfn = infn + ".db"
|
|
||||||
|
|
||||||
-db = @DBM@.open(outfn, "n")
|
|
||||||
+db = dbm.open(outfn, "n")
|
|
||||||
|
|
||||||
-for ln in file(infn, "r"):
|
|
||||||
+for ln in open(infn, "r"):
|
|
||||||
ln = ln.strip(" \r\n\t")
|
|
||||||
|
|
||||||
if ln == "" or ln.startswith("#"):
|
|
||||||
--
|
|
||||||
2.14.3
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
|||||||
From b448c9f771bada14ae8de175695a9729f8646797 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michal Sekletar <msekleta@redhat.com>
|
|
||||||
Date: Wed, 11 Oct 2023 17:45:44 +0200
|
|
||||||
Subject: [PATCH] common: derive alternative host name from its unescaped
|
|
||||||
version
|
|
||||||
|
|
||||||
Normalization of input makes sure we don't have to deal with special
|
|
||||||
cases like unescaped dot at the end of label.
|
|
||||||
|
|
||||||
Fixes #451 #487
|
|
||||||
CVE-2023-38473
|
|
||||||
---
|
|
||||||
avahi-common/alternative-test.c | 3 +++
|
|
||||||
avahi-common/alternative.c | 27 +++++++++++++++++++--------
|
|
||||||
2 files changed, 22 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-common/alternative-test.c b/avahi-common/alternative-test.c
|
|
||||||
index 9255435..681fc15 100644
|
|
||||||
--- a/avahi-common/alternative-test.c
|
|
||||||
+++ b/avahi-common/alternative-test.c
|
|
||||||
@@ -31,6 +31,9 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
|
|
||||||
const char* const test_strings[] = {
|
|
||||||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
||||||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXüüüüüüü",
|
|
||||||
+ ").",
|
|
||||||
+ "\\.",
|
|
||||||
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\",
|
|
||||||
"gurke",
|
|
||||||
"-",
|
|
||||||
" #",
|
|
||||||
diff --git a/avahi-common/alternative.c b/avahi-common/alternative.c
|
|
||||||
index b3d39f0..a094e6d 100644
|
|
||||||
--- a/avahi-common/alternative.c
|
|
||||||
+++ b/avahi-common/alternative.c
|
|
||||||
@@ -49,15 +49,20 @@ static void drop_incomplete_utf8(char *c) {
|
|
||||||
}
|
|
||||||
|
|
||||||
char *avahi_alternative_host_name(const char *s) {
|
|
||||||
+ char label[AVAHI_LABEL_MAX], alternative[AVAHI_LABEL_MAX*4+1];
|
|
||||||
+ char *alt, *r, *ret;
|
|
||||||
const char *e;
|
|
||||||
- char *r;
|
|
||||||
+ size_t len;
|
|
||||||
|
|
||||||
assert(s);
|
|
||||||
|
|
||||||
if (!avahi_is_valid_host_name(s))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
- if ((e = strrchr(s, '-'))) {
|
|
||||||
+ if (!avahi_unescape_label(&s, label, sizeof(label)))
|
|
||||||
+ return NULL;
|
|
||||||
+
|
|
||||||
+ if ((e = strrchr(label, '-'))) {
|
|
||||||
const char *p;
|
|
||||||
|
|
||||||
e++;
|
|
||||||
@@ -74,19 +79,18 @@ char *avahi_alternative_host_name(const char *s) {
|
|
||||||
|
|
||||||
if (e) {
|
|
||||||
char *c, *m;
|
|
||||||
- size_t l;
|
|
||||||
int n;
|
|
||||||
|
|
||||||
n = atoi(e)+1;
|
|
||||||
if (!(m = avahi_strdup_printf("%i", n)))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
- l = e-s-1;
|
|
||||||
+ len = e-label-1;
|
|
||||||
|
|
||||||
- if (l >= AVAHI_LABEL_MAX-1-strlen(m)-1)
|
|
||||||
- l = AVAHI_LABEL_MAX-1-strlen(m)-1;
|
|
||||||
+ if (len >= AVAHI_LABEL_MAX-1-strlen(m)-1)
|
|
||||||
+ len = AVAHI_LABEL_MAX-1-strlen(m)-1;
|
|
||||||
|
|
||||||
- if (!(c = avahi_strndup(s, l))) {
|
|
||||||
+ if (!(c = avahi_strndup(label, len))) {
|
|
||||||
avahi_free(m);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
@@ -100,7 +104,7 @@ char *avahi_alternative_host_name(const char *s) {
|
|
||||||
} else {
|
|
||||||
char *c;
|
|
||||||
|
|
||||||
- if (!(c = avahi_strndup(s, AVAHI_LABEL_MAX-1-2)))
|
|
||||||
+ if (!(c = avahi_strndup(label, AVAHI_LABEL_MAX-1-2)))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
drop_incomplete_utf8(c);
|
|
||||||
@@ -109,6 +113,13 @@ char *avahi_alternative_host_name(const char *s) {
|
|
||||||
avahi_free(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ alt = alternative;
|
|
||||||
+ len = sizeof(alternative);
|
|
||||||
+ ret = avahi_escape_label(r, strlen(r), &alt, &len);
|
|
||||||
+
|
|
||||||
+ avahi_free(r);
|
|
||||||
+ r = avahi_strdup(ret);
|
|
||||||
+
|
|
||||||
assert(avahi_is_valid_host_name(r));
|
|
||||||
|
|
||||||
return r;
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
From 160e8fb6ca1b33387f30f7a6aa9159015ffda9d0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
|
||||||
Date: Sun, 22 Oct 2023 10:31:31 +0000
|
|
||||||
Subject: [PATCH] core: copy resource records with zero-length rdata properly
|
|
||||||
|
|
||||||
It fixes the crash spotted
|
|
||||||
https://github.com/lathiat/avahi/pull/490#issuecomment-1773019619.
|
|
||||||
The fuzz target was updated to exercise those code paths (among other
|
|
||||||
things). Without this commit it crashes with
|
|
||||||
```
|
|
||||||
fuzz-consume-record: malloc.c:250: void *avahi_memdup(const void *, size_t): Assertion `s' failed.
|
|
||||||
==72869== ERROR: libFuzzer: deadly signal
|
|
||||||
#0 0x5031b5 in __sanitizer_print_stack_trace (avahi/out/fuzz-consume-record+0x5031b5) (BuildId: 69840d811c9ba9f74eea21e34786a2005c5dcc06)
|
|
||||||
#1 0x45cd6c in fuzzer::PrintStackTrace() (avahi/out/fuzz-consume-record+0x45cd6c) (BuildId: 69840d811c9ba9f74eea21e34786a2005c5dcc06)
|
|
||||||
#2 0x441c47 in fuzzer::Fuzzer::CrashCallback() (out/fuzz-consume-record+0x441c47) (BuildId: 69840d811c9ba9f74eea21e34786a2005c5dcc06)
|
|
||||||
#3 0x7f189e97ebaf (/lib64/libc.so.6+0x3dbaf) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#4 0x7f189e9cf883 in __pthread_kill_implementation (/lib64/libc.so.6+0x8e883) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#5 0x7f189e97eafd in gsignal (/lib64/libc.so.6+0x3dafd) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#6 0x7f189e96787e in abort (/lib64/libc.so.6+0x2687e) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#7 0x7f189e96779a in __assert_fail_base.cold (/lib64/libc.so.6+0x2679a) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#8 0x7f189e977186 in __assert_fail (/lib64/libc.so.6+0x36186) (BuildId: 3ebe8d97a0ed3e1f13476a02665c5a9442adcd78)
|
|
||||||
#9 0x557bfc in avahi_memdup avahi/avahi-common/malloc.c:250:5
|
|
||||||
#10 0x54895c in avahi_record_copy avahi/avahi-core/rr.c:469:45
|
|
||||||
```
|
|
||||||
---
|
|
||||||
avahi-core/rr.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-core/rr.c b/avahi-core/rr.c
|
|
||||||
index 7fa0bee..2bb8924 100644
|
|
||||||
--- a/avahi-core/rr.c
|
|
||||||
+++ b/avahi-core/rr.c
|
|
||||||
@@ -426,6 +426,7 @@ AvahiRecord *avahi_record_copy(AvahiRecord *r) {
|
|
||||||
copy->ref = 1;
|
|
||||||
copy->key = avahi_key_ref(r->key);
|
|
||||||
copy->ttl = r->ttl;
|
|
||||||
+ memset(©->data, 0, sizeof(copy->data));
|
|
||||||
|
|
||||||
switch (r->key->type) {
|
|
||||||
case AVAHI_DNS_TYPE_PTR:
|
|
||||||
@@ -466,7 +467,7 @@ AvahiRecord *avahi_record_copy(AvahiRecord *r) {
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
- if (!(copy->data.generic.data = avahi_memdup(r->data.generic.data, r->data.generic.size)))
|
|
||||||
+ if (r->data.generic.size && !(copy->data.generic.data = avahi_memdup(r->data.generic.data, r->data.generic.size)))
|
|
||||||
goto fail;
|
|
||||||
copy->data.generic.size = r->data.generic.size;
|
|
||||||
break;
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
|||||||
From 894f085f402e023a98cbb6f5a3d117bd88d93b09 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michal Sekletar <msekleta@redhat.com>
|
|
||||||
Date: Mon, 23 Oct 2023 13:38:35 +0200
|
|
||||||
Subject: [PATCH] core: extract host name using avahi_unescape_label()
|
|
||||||
|
|
||||||
Previously we could create invalid escape sequence when we split the
|
|
||||||
string on dot. For example, from valid host name "foo\\.bar" we have
|
|
||||||
created invalid name "foo\\" and tried to set that as the host name
|
|
||||||
which crashed the daemon.
|
|
||||||
|
|
||||||
Fixes #453
|
|
||||||
|
|
||||||
CVE-2023-38471
|
|
||||||
---
|
|
||||||
avahi-core/server.c | 27 +++++++++++++++++++++------
|
|
||||||
1 file changed, 21 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-core/server.c b/avahi-core/server.c
|
|
||||||
index c32637a..f6a21bb 100644
|
|
||||||
--- a/avahi-core/server.c
|
|
||||||
+++ b/avahi-core/server.c
|
|
||||||
@@ -1295,7 +1295,11 @@ static void update_fqdn(AvahiServer *s) {
|
|
||||||
}
|
|
||||||
|
|
||||||
int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
|
||||||
- char *hn = NULL;
|
|
||||||
+ char label_escaped[AVAHI_LABEL_MAX*4+1];
|
|
||||||
+ char label[AVAHI_LABEL_MAX];
|
|
||||||
+ char *hn = NULL, *h;
|
|
||||||
+ size_t len;
|
|
||||||
+
|
|
||||||
assert(s);
|
|
||||||
|
|
||||||
AVAHI_CHECK_VALIDITY(s, !host_name || avahi_is_valid_host_name(host_name), AVAHI_ERR_INVALID_HOST_NAME);
|
|
||||||
@@ -1305,17 +1309,28 @@ int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
|
||||||
else
|
|
||||||
hn = avahi_normalize_name_strdup(host_name);
|
|
||||||
|
|
||||||
- hn[strcspn(hn, ".")] = 0;
|
|
||||||
+ h = hn;
|
|
||||||
+ if (!avahi_unescape_label((const char **)&hn, label, sizeof(label))) {
|
|
||||||
+ avahi_free(h);
|
|
||||||
+ return AVAHI_ERR_INVALID_HOST_NAME;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ avahi_free(h);
|
|
||||||
+
|
|
||||||
+ h = label_escaped;
|
|
||||||
+ len = sizeof(label_escaped);
|
|
||||||
+ if (!avahi_escape_label(label, strlen(label), &h, &len))
|
|
||||||
+ return AVAHI_ERR_INVALID_HOST_NAME;
|
|
||||||
|
|
||||||
- if (avahi_domain_equal(s->host_name, hn) && s->state != AVAHI_SERVER_COLLISION) {
|
|
||||||
- avahi_free(hn);
|
|
||||||
+ if (avahi_domain_equal(s->host_name, label_escaped) && s->state != AVAHI_SERVER_COLLISION)
|
|
||||||
return avahi_server_set_errno(s, AVAHI_ERR_NO_CHANGE);
|
|
||||||
- }
|
|
||||||
|
|
||||||
withdraw_host_rrs(s);
|
|
||||||
|
|
||||||
avahi_free(s->host_name);
|
|
||||||
- s->host_name = hn;
|
|
||||||
+ s->host_name = avahi_strdup(label_escaped);
|
|
||||||
+ if (!s->host_name)
|
|
||||||
+ return AVAHI_ERR_NO_MEMORY;
|
|
||||||
|
|
||||||
update_fqdn(s);
|
|
||||||
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
From b024ae5749f4aeba03478e6391687c3c9c8dee40 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michal Sekletar <msekleta@redhat.com>
|
|
||||||
Date: Thu, 19 Oct 2023 17:36:44 +0200
|
|
||||||
Subject: [PATCH] core: make sure there is rdata to process before parsing it
|
|
||||||
|
|
||||||
Fixes #452
|
|
||||||
|
|
||||||
CVE-2023-38472
|
|
||||||
---
|
|
||||||
avahi-client/client-test.c | 3 +++
|
|
||||||
avahi-daemon/dbus-entry-group.c | 2 +-
|
|
||||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c
|
|
||||||
index b3366d8..ba97998 100644
|
|
||||||
--- a/avahi-client/client-test.c
|
|
||||||
+++ b/avahi-client/client-test.c
|
|
||||||
@@ -258,6 +258,9 @@ int main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
|
|
||||||
printf("%s\n", avahi_strerror(avahi_entry_group_add_service (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL)));
|
|
||||||
printf("add_record: %d\n", avahi_entry_group_add_record (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "\5booya", 6));
|
|
||||||
|
|
||||||
+ error = avahi_entry_group_add_record (group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "", 0);
|
|
||||||
+ assert(error != AVAHI_OK);
|
|
||||||
+
|
|
||||||
avahi_entry_group_commit (group);
|
|
||||||
|
|
||||||
domain = avahi_domain_browser_new (avahi, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, 0, avahi_domain_browser_callback, (char*) "omghai3u");
|
|
||||||
diff --git a/avahi-daemon/dbus-entry-group.c b/avahi-daemon/dbus-entry-group.c
|
|
||||||
index 4e879a5..aa23d4b 100644
|
|
||||||
--- a/avahi-daemon/dbus-entry-group.c
|
|
||||||
+++ b/avahi-daemon/dbus-entry-group.c
|
|
||||||
@@ -340,7 +340,7 @@ DBusHandlerResult avahi_dbus_msg_entry_group_impl(DBusConnection *c, DBusMessage
|
|
||||||
if (!(r = avahi_record_new_full (name, clazz, type, ttl)))
|
|
||||||
return avahi_dbus_respond_error(c, m, AVAHI_ERR_NO_MEMORY, NULL);
|
|
||||||
|
|
||||||
- if (avahi_rdata_parse (r, rdata, size) < 0) {
|
|
||||||
+ if (!rdata || avahi_rdata_parse (r, rdata, size) < 0) {
|
|
||||||
avahi_record_unref (r);
|
|
||||||
return avahi_dbus_respond_error(c, m, AVAHI_ERR_INVALID_RDATA, NULL);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From a337a1ba7d15853fb56deef1f464529af6e3a1cf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
|
||||||
Date: Mon, 23 Oct 2023 20:29:31 +0000
|
|
||||||
Subject: [PATCH] core: reject overly long TXT resource records
|
|
||||||
|
|
||||||
Closes https://github.com/lathiat/avahi/issues/455
|
|
||||||
|
|
||||||
CVE-2023-38469
|
|
||||||
---
|
|
||||||
avahi-core/rr.c | 9 ++++++++-
|
|
||||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-core/rr.c b/avahi-core/rr.c
|
|
||||||
index 2bb8924..9c04ebb 100644
|
|
||||||
--- a/avahi-core/rr.c
|
|
||||||
+++ b/avahi-core/rr.c
|
|
||||||
@@ -32,6 +32,7 @@
|
|
||||||
#include <avahi-common/malloc.h>
|
|
||||||
#include <avahi-common/defs.h>
|
|
||||||
|
|
||||||
+#include "dns.h"
|
|
||||||
#include "rr.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "util.h"
|
|
||||||
@@ -689,11 +690,17 @@ int avahi_record_is_valid(AvahiRecord *r) {
|
|
||||||
case AVAHI_DNS_TYPE_TXT: {
|
|
||||||
|
|
||||||
AvahiStringList *strlst;
|
|
||||||
+ size_t used = 0;
|
|
||||||
|
|
||||||
- for (strlst = r->data.txt.string_list; strlst; strlst = strlst->next)
|
|
||||||
+ for (strlst = r->data.txt.string_list; strlst; strlst = strlst->next) {
|
|
||||||
if (strlst->size > 255 || strlst->size <= 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
+ used += 1+strlst->size;
|
|
||||||
+ if (used > AVAHI_DNS_RDATA_MAX)
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
From b675f70739f404342f7f78635d6e2dcd85a13460 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
|
||||||
Date: Tue, 24 Oct 2023 22:04:51 +0000
|
|
||||||
Subject: [PATCH] core: return errors from avahi_server_set_host_name properly
|
|
||||||
|
|
||||||
It's a follow-up to 894f085f402e023a98cbb6f5a3d117bd88d93b09
|
|
||||||
---
|
|
||||||
avahi-core/server.c | 9 ++++++---
|
|
||||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-core/server.c b/avahi-core/server.c
|
|
||||||
index f6a21bb..84df6b5 100644
|
|
||||||
--- a/avahi-core/server.c
|
|
||||||
+++ b/avahi-core/server.c
|
|
||||||
@@ -1309,10 +1309,13 @@ int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
|
||||||
else
|
|
||||||
hn = avahi_normalize_name_strdup(host_name);
|
|
||||||
|
|
||||||
+ if (!hn)
|
|
||||||
+ return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
|
|
||||||
+
|
|
||||||
h = hn;
|
|
||||||
if (!avahi_unescape_label((const char **)&hn, label, sizeof(label))) {
|
|
||||||
avahi_free(h);
|
|
||||||
- return AVAHI_ERR_INVALID_HOST_NAME;
|
|
||||||
+ return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
avahi_free(h);
|
|
||||||
@@ -1320,7 +1323,7 @@ int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
|
||||||
h = label_escaped;
|
|
||||||
len = sizeof(label_escaped);
|
|
||||||
if (!avahi_escape_label(label, strlen(label), &h, &len))
|
|
||||||
- return AVAHI_ERR_INVALID_HOST_NAME;
|
|
||||||
+ return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME);
|
|
||||||
|
|
||||||
if (avahi_domain_equal(s->host_name, label_escaped) && s->state != AVAHI_SERVER_COLLISION)
|
|
||||||
return avahi_server_set_errno(s, AVAHI_ERR_NO_CHANGE);
|
|
||||||
@@ -1330,7 +1333,7 @@ int avahi_server_set_host_name(AvahiServer *s, const char *host_name) {
|
|
||||||
avahi_free(s->host_name);
|
|
||||||
s->host_name = avahi_strdup(label_escaped);
|
|
||||||
if (!s->host_name)
|
|
||||||
- return AVAHI_ERR_NO_MEMORY;
|
|
||||||
+ return avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
|
|
||||||
|
|
||||||
update_fqdn(s);
|
|
||||||
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
From 93de55227583a149a375f529f3fafafae7c2c3bb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Wei Li <wei.li@calix.com>
|
|
||||||
Date: Fri, 23 Dec 2022 17:02:53 +0800
|
|
||||||
Subject: [PATCH] fix memory leak in wide area lookup
|
|
||||||
|
|
||||||
---
|
|
||||||
avahi-core/wide-area.c | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c
|
|
||||||
index d5e64e5..971f5e7 100644
|
|
||||||
--- a/avahi-core/wide-area.c
|
|
||||||
+++ b/avahi-core/wide-area.c
|
|
||||||
@@ -564,6 +564,7 @@ static void socket_event(AVAHI_GCC_UNUSED AvahiWatch *w, int fd, AVAHI_GCC_UNUSE
|
|
||||||
if (p) {
|
|
||||||
handle_packet(e, p);
|
|
||||||
avahi_dns_packet_free(p);
|
|
||||||
+ avahi_cleanup_dead_entries(e->server);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.45.2
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
|||||||
From 3303a8a621467dd7be67cec211fe417e9c81946f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Simon McVittie <smcv@debian.org>
|
|
||||||
Date: Fri, 27 Apr 2018 11:09:07 +0100
|
|
||||||
Subject: [PATCH] avahi-python: Encode unicode strings as UTF-8
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Previously, we would effectively encode anything representable in
|
|
||||||
Latin-1 as Latin-1, and crash on anything not representable in Latin-1:
|
|
||||||
|
|
||||||
>>> import avahi
|
|
||||||
>>> avahi.string_to_byte_array(u'©')
|
|
||||||
[dbus.Byte(169)]
|
|
||||||
>>> avahi.string_to_byte_array(u'\ufeff')
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "<stdin>", line 1, in <module>
|
|
||||||
File "/usr/lib/python2.7/dist-packages/avahi/__init__.py", line 94, in string_to_byte_array
|
|
||||||
r.append(dbus.Byte(ord(c)))
|
|
||||||
ValueError: Integer outside range 0-255
|
|
||||||
|
|
||||||
This is particularly important for Python 3, where the str type
|
|
||||||
is a Unicode string.
|
|
||||||
|
|
||||||
The b'' syntax for bytestrings is supported since at least Python 2.7.
|
|
||||||
|
|
||||||
These functions now accept either Unicode strings (Python 2 unicode,
|
|
||||||
Python 3 str), which are encoded in UTF-8, or bytestrings
|
|
||||||
(Python 2 str, Python 3 bytes) which are taken as-is.
|
|
||||||
|
|
||||||
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
||||||
(cherry picked from commit 169e85dbc13dcaae8a699618883e512614f540b7)
|
|
||||||
|
|
||||||
Related: #1561019
|
|
||||||
---
|
|
||||||
avahi-python/avahi/__init__.py | 24 +++++++++++++++++++++---
|
|
||||||
1 file changed, 21 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-python/avahi/__init__.py b/avahi-python/avahi/__init__.py
|
|
||||||
index 7b45029..02305b0 100644
|
|
||||||
--- a/avahi-python/avahi/__init__.py
|
|
||||||
+++ b/avahi-python/avahi/__init__.py
|
|
||||||
@@ -17,6 +17,8 @@
|
|
||||||
|
|
||||||
# Some definitions matching those in avahi-common/defs.h
|
|
||||||
|
|
||||||
+import sys
|
|
||||||
+
|
|
||||||
import dbus
|
|
||||||
|
|
||||||
SERVER_INVALID, SERVER_REGISTERING, SERVER_RUNNING, SERVER_COLLISION, SERVER_FAILURE = range(0, 5)
|
|
||||||
@@ -66,6 +68,9 @@ DBUS_INTERFACE_HOST_NAME_RESOLVER = DBUS_NAME + ".HostNameResolver"
|
|
||||||
DBUS_INTERFACE_SERVICE_RESOLVER = DBUS_NAME + ".ServiceResolver"
|
|
||||||
DBUS_INTERFACE_RECORD_BROWSER = DBUS_NAME + ".RecordBrowser"
|
|
||||||
|
|
||||||
+if sys.version_info[0] >= 3:
|
|
||||||
+ unicode = str
|
|
||||||
+
|
|
||||||
def byte_array_to_string(s):
|
|
||||||
r = ""
|
|
||||||
|
|
||||||
@@ -86,12 +91,19 @@ def txt_array_to_string_array(t):
|
|
||||||
|
|
||||||
return l
|
|
||||||
|
|
||||||
-
|
|
||||||
def string_to_byte_array(s):
|
|
||||||
+ if isinstance(s, unicode):
|
|
||||||
+ s = s.encode('utf-8')
|
|
||||||
+
|
|
||||||
r = []
|
|
||||||
|
|
||||||
for c in s:
|
|
||||||
- r.append(dbus.Byte(ord(c)))
|
|
||||||
+ if isinstance(c, int):
|
|
||||||
+ # Python 3: iterating over bytes yields ints
|
|
||||||
+ r.append(dbus.Byte(c))
|
|
||||||
+ else:
|
|
||||||
+ # Python 2: iterating over str yields str
|
|
||||||
+ r.append(dbus.Byte(ord(c)))
|
|
||||||
|
|
||||||
return r
|
|
||||||
|
|
||||||
@@ -107,6 +119,12 @@ def dict_to_txt_array(txt_dict):
|
|
||||||
l = []
|
|
||||||
|
|
||||||
for k,v in txt_dict.items():
|
|
||||||
- l.append(string_to_byte_array("%s=%s" % (k,v)))
|
|
||||||
+ if isinstance(k, unicode):
|
|
||||||
+ k = k.encode('utf-8')
|
|
||||||
+
|
|
||||||
+ if isinstance(v, unicode):
|
|
||||||
+ v = v.encode('utf-8')
|
|
||||||
+
|
|
||||||
+ l.append(string_to_byte_array(b"%s=%s" % (k,v)))
|
|
||||||
|
|
||||||
return l
|
|
||||||
--
|
|
||||||
2.14.3
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
|||||||
From ffb19d8f3c7f1fe4f31f79f8601dd3079730401b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Simon McVittie <smcv@debian.org>
|
|
||||||
Date: Fri, 27 Apr 2018 09:01:13 +0100
|
|
||||||
Subject: [PATCH] Remove empty avahi_discover Python module
|
|
||||||
|
|
||||||
The avahi-discover tool no longer has any code outside its main
|
|
||||||
executable, so it does not need to install library modules. Its only
|
|
||||||
library code was avahi_discover.SimpleGladeApp, which was removed
|
|
||||||
in 2009.
|
|
||||||
|
|
||||||
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
||||||
---
|
|
||||||
avahi-python/avahi-discover/Makefile.am | 6 ------
|
|
||||||
avahi-python/avahi-discover/__init__.py | 18 ------------------
|
|
||||||
2 files changed, 24 deletions(-)
|
|
||||||
delete mode 100755 avahi-python/avahi-discover/__init__.py
|
|
||||||
|
|
||||||
diff --git a/avahi-python/avahi-discover/Makefile.am b/avahi-python/avahi-discover/Makefile.am
|
|
||||||
index 5fc4b25..bb4d717 100644
|
|
||||||
--- a/avahi-python/avahi-discover/Makefile.am
|
|
||||||
+++ b/avahi-python/avahi-discover/Makefile.am
|
|
||||||
@@ -18,7 +18,6 @@
|
|
||||||
AM_CFLAGS=-I$(top_srcdir)
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
|
||||||
- __init__.py \
|
|
||||||
avahi-discover.py \
|
|
||||||
avahi-discover.desktop.in.in
|
|
||||||
|
|
||||||
@@ -31,15 +30,11 @@ pythonscripts =
|
|
||||||
desktopdir = $(datadir)/applications
|
|
||||||
desktop_DATA =
|
|
||||||
|
|
||||||
-avahi_discoverdir = $(pythondir)/avahi_discover
|
|
||||||
-avahi_discover_PYTHON =
|
|
||||||
-
|
|
||||||
if HAVE_GDBM
|
|
||||||
pythonscripts += \
|
|
||||||
avahi-discover
|
|
||||||
desktop_DATA += avahi-discover.desktop
|
|
||||||
@INTLTOOL_DESKTOP_RULE@
|
|
||||||
-avahi_discover_PYTHON += __init__.py
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_DBM
|
|
||||||
@@ -47,7 +42,6 @@ pythonscripts += \
|
|
||||||
avahi-discover
|
|
||||||
desktop_DATA += avahi-discover.desktop
|
|
||||||
@INTLTOOL_DESKTOP_RULE@
|
|
||||||
-avahi_discover_PYTHON += __init__.py
|
|
||||||
endif
|
|
||||||
|
|
||||||
avahi-discover.desktop.in: avahi-discover.desktop.in.in
|
|
||||||
diff --git a/avahi-python/avahi-discover/__init__.py b/avahi-python/avahi-discover/__init__.py
|
|
||||||
deleted file mode 100755
|
|
||||||
index 6f3ec7f..0000000
|
|
||||||
--- a/avahi-python/avahi-discover/__init__.py
|
|
||||||
+++ /dev/null
|
|
||||||
@@ -1,18 +0,0 @@
|
|
||||||
-#!@PYTHON@
|
|
||||||
-# -*-python-*-
|
|
||||||
-# This file is part of avahi.
|
|
||||||
-#
|
|
||||||
-# avahi is free software; you can redistribute it and/or modify it
|
|
||||||
-# under the terms of the GNU Lesser General Public License as
|
|
||||||
-# published by the Free Software Foundation; either version 2 of the
|
|
||||||
-# License, or (at your option) any later version.
|
|
||||||
-#
|
|
||||||
-# avahi is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
||||||
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
||||||
-# License for more details.
|
|
||||||
-#
|
|
||||||
-# You should have received a copy of the GNU Lesser General Public
|
|
||||||
-# License along with avahi; if not, write to the Free Software
|
|
||||||
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
-# USA.
|
|
||||||
--
|
|
||||||
2.14.3
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From 374245ec1418e7e1e57120fcaf0a12ec695f5f6d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michal Sekletar <msekleta@redhat.com>
|
|
||||||
Date: Wed, 24 Oct 2018 15:22:19 +0000
|
|
||||||
Subject: [PATCH] avahi-client: fix resource leak
|
|
||||||
|
|
||||||
---
|
|
||||||
avahi-client/browser.c | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/avahi-client/browser.c b/avahi-client/browser.c
|
|
||||||
index c978d94..fa4a9a8 100644
|
|
||||||
--- a/avahi-client/browser.c
|
|
||||||
+++ b/avahi-client/browser.c
|
|
||||||
@@ -72,6 +72,8 @@ static void parse_domain_file(AvahiDomainBrowser *b) {
|
|
||||||
if (avahi_normalize_name(buf, domain, sizeof(domain)))
|
|
||||||
b->static_browse_domains = avahi_string_list_add(b->static_browse_domains, domain);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ fclose(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void domain_browser_ref(AvahiDomainBrowser *db) {
|
|
||||||
--
|
|
||||||
2.17.2
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From 4b48927e8e2c721d103018b4ce39a164b6c2898f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michal Sekletar <msekleta@redhat.com>
|
|
||||||
Date: Wed, 24 Oct 2018 15:38:48 +0000
|
|
||||||
Subject: [PATCH] chroot: fix bogus assignments in assertions
|
|
||||||
|
|
||||||
---
|
|
||||||
avahi-daemon/chroot.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/avahi-daemon/chroot.c b/avahi-daemon/chroot.c
|
|
||||||
index ccd56be..871b3b3 100644
|
|
||||||
--- a/avahi-daemon/chroot.c
|
|
||||||
+++ b/avahi-daemon/chroot.c
|
|
||||||
@@ -188,8 +188,8 @@ static int recv_fd(int fd) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- assert(h->cmsg_len = CMSG_LEN(sizeof(int)));
|
|
||||||
- assert(h->cmsg_level = SOL_SOCKET);
|
|
||||||
+ assert(h->cmsg_len == CMSG_LEN(sizeof(int)));
|
|
||||||
+ assert(h->cmsg_level == SOL_SOCKET);
|
|
||||||
assert(h->cmsg_type == SCM_RIGHTS);
|
|
||||||
|
|
||||||
return *((int*)CMSG_DATA(h));
|
|
||||||
--
|
|
||||||
2.17.2
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
From 9c3a314856affb288f701d2d3ee23278fc98eaee Mon Sep 17 00:00:00 2001
|
||||||
|
From: Steve Langasek <steve.langasek@ubuntu.com>
|
||||||
|
Date: Tue, 18 Feb 2020 15:43:19 +0800
|
||||||
|
Subject: [PATCH 06/11] avahi-dnsconfd.service: Drop "Also=avahi-daemon.socket"
|
||||||
|
|
||||||
|
Also=avahi-daemon.socket' means that 'systemctl disable avahi-dnsconfd'
|
||||||
|
ill also disable avahi-daemon.socket, which is definitely not what we
|
||||||
|
ant, and it also causes debhelper to throw an error. Just drop this
|
||||||
|
entry from the configuration.
|
||||||
|
---
|
||||||
|
avahi-dnsconfd/avahi-dnsconfd.service.in | 1 -
|
||||||
|
1 file changed, 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/avahi-dnsconfd/avahi-dnsconfd.service.in b/avahi-dnsconfd/avahi-dnsconfd.service.in
|
||||||
|
index 95db79f..7c293da 100644
|
||||||
|
--- a/avahi-dnsconfd/avahi-dnsconfd.service.in
|
||||||
|
+++ b/avahi-dnsconfd/avahi-dnsconfd.service.in
|
||||||
|
@@ -26,4 +26,3 @@ ExecStart=@sbindir@/avahi-dnsconfd -s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
-Also=avahi-daemon.socket
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
From f983df44870b602179b493f9c3d113753b378e27 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Biebl <biebl@debian.org>
|
||||||
|
Date: Sun, 17 Sep 2017 12:52:39 +0200
|
||||||
|
Subject: [PATCH 07/11] man: add missing bshell.1 symlink
|
||||||
|
|
||||||
|
The bshell binary is missing a symlink to its manual page. It should be
|
||||||
|
symlinked to the man page for bssh, just like how the bvnc man page is.
|
||||||
|
|
||||||
|
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655190
|
||||||
|
---
|
||||||
|
man/Makefile.am | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/man/Makefile.am b/man/Makefile.am
|
||||||
|
index d38267c..77a27bd 100644
|
||||||
|
--- a/man/Makefile.am
|
||||||
|
+++ b/man/Makefile.am
|
||||||
|
@@ -137,12 +137,13 @@ BSSH_LN =
|
||||||
|
if HAVE_GTK
|
||||||
|
if HAVE_GLIB
|
||||||
|
BSSH_LN += $(LN_S) bssh.1 bvnc.1 &&
|
||||||
|
+BSSH_LN += $(LN_S) bssh.1 bshell.1 &&
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
install-exec-local:
|
||||||
|
mkdir -p $(DESTDIR)/$(mandir)/man1 && \
|
||||||
|
cd $(DESTDIR)/$(mandir)/man1 && \
|
||||||
|
- rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 avahi-browse-domains.1 avahi-publish-address.1 avahi-publish-service.1 bvnc.1 && \
|
||||||
|
+ rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 avahi-browse-domains.1 avahi-publish-address.1 avahi-publish-service.1 bvnc.1 bshell.1 && \
|
||||||
|
$(BSSH_LN) \
|
||||||
|
$(LN_S) avahi-resolve.1 avahi-resolve-host-name.1 && \
|
||||||
|
$(LN_S) avahi-resolve.1 avahi-resolve-address.1 && \
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
From 751be804e891aec5701a059144e2f5cbfc981b36 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andreas Henriksson <andreas@fatal.se>
|
||||||
|
Date: Thu, 24 Aug 2017 17:52:19 +0200
|
||||||
|
Subject: [PATCH 08/11] Ship avahi-discover(1), bssh(1) and bvnc(1) also for
|
||||||
|
GTK3
|
||||||
|
|
||||||
|
These manpages went missing when you disabled gtk2 builds....
|
||||||
|
---
|
||||||
|
man/Makefile.am | 9 +++++----
|
||||||
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/man/Makefile.am b/man/Makefile.am
|
||||||
|
index 77a27bd..289b942 100644
|
||||||
|
--- a/man/Makefile.am
|
||||||
|
+++ b/man/Makefile.am
|
||||||
|
@@ -56,7 +56,7 @@ man_MANS += \
|
||||||
|
avahi-publish.1 \
|
||||||
|
avahi-set-host-name.1
|
||||||
|
|
||||||
|
-if HAVE_GTK
|
||||||
|
+if HAVE_GTK2OR3
|
||||||
|
man_MANS += \
|
||||||
|
bssh.1
|
||||||
|
endif
|
||||||
|
@@ -64,12 +64,13 @@ endif
|
||||||
|
if HAVE_PYTHON
|
||||||
|
man_MANS += \
|
||||||
|
avahi-bookmarks.1
|
||||||
|
-if HAVE_GTK
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+if HAVE_PYGOBJECT
|
||||||
|
man_MANS += \
|
||||||
|
avahi-discover.1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
-endif
|
||||||
|
|
||||||
|
if ENABLE_AUTOIPD
|
||||||
|
if HAVE_LIBDAEMON
|
||||||
|
@@ -134,7 +135,7 @@ EXTRA_DIST = \
|
||||||
|
if HAVE_DBUS
|
||||||
|
|
||||||
|
BSSH_LN =
|
||||||
|
-if HAVE_GTK
|
||||||
|
+if HAVE_GTK2OR3
|
||||||
|
if HAVE_GLIB
|
||||||
|
BSSH_LN += $(LN_S) bssh.1 bvnc.1 &&
|
||||||
|
BSSH_LN += $(LN_S) bssh.1 bshell.1 &&
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,24 @@
|
|||||||
|
From 366e3798bdbd6b7bf24e59379f4a9a51af575ce9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
|
||||||
|
Date: Thu, 20 Feb 2020 16:09:40 +0100
|
||||||
|
Subject: [PATCH 09/11] fix requires in pc file
|
||||||
|
|
||||||
|
---
|
||||||
|
avahi-libevent.pc.in | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/avahi-libevent.pc.in b/avahi-libevent.pc.in
|
||||||
|
index a1dca01..3356b0b 100644
|
||||||
|
--- a/avahi-libevent.pc.in
|
||||||
|
+++ b/avahi-libevent.pc.in
|
||||||
|
@@ -6,6 +6,6 @@ includedir=${prefix}/include
|
||||||
|
Name: avahi-libevent
|
||||||
|
Description: Avahi Multicast DNS Responder (libevent Support)
|
||||||
|
Version: @PACKAGE_VERSION@
|
||||||
|
-Requires: libevent-2.1.5
|
||||||
|
+Requires: libevent >= 2.1.5
|
||||||
|
Libs: -L${libdir} -lavahi-libevent
|
||||||
|
Cflags: -D_REENTRANT -I${includedir}
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
From a94f72081dd1d546a1d95d860311a1242315bb28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?=C3=89ric=20Araujo?= <merwok@netwok.org>
|
||||||
|
Date: Sat, 29 Feb 2020 19:14:04 -0500
|
||||||
|
Subject: [PATCH 10/11] fix bytestring decoding for proper display
|
||||||
|
|
||||||
|
---
|
||||||
|
avahi-python/avahi-discover/avahi-discover.py | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/avahi-python/avahi-discover/avahi-discover.py b/avahi-python/avahi-discover/avahi-discover.py
|
||||||
|
index 0db705d..4a2b575 100755
|
||||||
|
--- a/avahi-python/avahi-discover/avahi-discover.py
|
||||||
|
+++ b/avahi-python/avahi-discover/avahi-discover.py
|
||||||
|
@@ -238,12 +238,15 @@ class Main_window:
|
||||||
|
txts+="<b>" + _("TXT") + " <i>%s</i></b> = %s\n" % (k,v)
|
||||||
|
else:
|
||||||
|
txts = "<b>" + _("TXT Data:") + "</b> <i>" + _("empty") + "</i>"
|
||||||
|
+
|
||||||
|
+ txts = txts.decode("utf-8")
|
||||||
|
|
||||||
|
infos = "<b>" + _("Service Type:") + "</b> %s\n"
|
||||||
|
infos += "<b>" + _("Service Name:") + "</b> %s\n"
|
||||||
|
infos += "<b>" + _("Domain Name:") + "</b> %s\n"
|
||||||
|
infos += "<b>" + _("Interface:") + "</b> %s %s\n"
|
||||||
|
infos += "<b>" + _("Address:") + "</b> %s/%s:%i\n%s"
|
||||||
|
+ infos = infos.decode("utf-8")
|
||||||
|
infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
|
||||||
|
self.info_label.set_markup(infos)
|
||||||
|
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
From b897ca43ac100d326d118e5877da710eb7f836f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: traffic-millions <60914101+traffic-millions@users.noreply.github.com>
|
||||||
|
Date: Tue, 3 Mar 2020 11:15:48 +0800
|
||||||
|
Subject: [PATCH 11/11] avahi_dns_packet_consume_uint32: fix potential
|
||||||
|
undefined behavior
|
||||||
|
|
||||||
|
avahi_dns_packet_consume_uint32 left shifts uint8_t values by 8, 16 and 24 bits to combine them into a 32-bit value. This produces an undefined behavior warning with gcc -fsanitize when fed input values of 128 or 255 however in testing no actual unexpected behavior occurs in practice and the 32-bit uint32_t is always correctly produced as the final value is immediately stored into a uint32_t and the compiler appears to handle this "correctly".
|
||||||
|
|
||||||
|
Cast the intermediate values to uint32_t to prevent this warning and ensure the intended result is explicit.
|
||||||
|
|
||||||
|
Closes: #267
|
||||||
|
Closes: #268
|
||||||
|
Reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19304
|
||||||
|
---
|
||||||
|
avahi-core/dns.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/avahi-core/dns.c b/avahi-core/dns.c
|
||||||
|
index 7c38f42..d793b76 100644
|
||||||
|
--- a/avahi-core/dns.c
|
||||||
|
+++ b/avahi-core/dns.c
|
||||||
|
@@ -455,7 +455,7 @@ int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
|
||||||
|
- *ret_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
|
||||||
|
+ *ret_v = ((uint32_t)d[0] << 24) | ((uint32_t)d[1] << 16) | ((uint32_t)d[2] << 8) | (uint32_t)d[3];
|
||||||
|
p->rindex += sizeof(uint32_t);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
2.25.2
|
||||||
|
|
@ -0,0 +1,29 @@
|
|||||||
|
From 66a684b988052664669158819fc123469b714f50 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rex Dieter <rdieter@gmail.com>
|
||||||
|
Date: Tue, 17 Nov 2020 16:42:00 -0600
|
||||||
|
Subject: [PATCH 16/16] fix QT3 build
|
||||||
|
|
||||||
|
recent commit d1e71b320d96d0f213ecb0885c8313039a09f693 adding QT5
|
||||||
|
support added a new conditional
|
||||||
|
but failed to actually set the define. This commit adds that to
|
||||||
|
allow successful build when enabling QT3 support
|
||||||
|
---
|
||||||
|
avahi-qt/Makefile.am | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/avahi-qt/Makefile.am b/avahi-qt/Makefile.am
|
||||||
|
index 09ce7ca..b404810 100644
|
||||||
|
--- a/avahi-qt/Makefile.am
|
||||||
|
+++ b/avahi-qt/Makefile.am
|
||||||
|
@@ -38,7 +38,7 @@ libavahi_qt3_la_SOURCES = \
|
||||||
|
qt-watch.moc3: qt-watch.cpp
|
||||||
|
$(AM_V_GEN)$(MOC_QT3) $^ > $@
|
||||||
|
|
||||||
|
-libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
+libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) -DQT3 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
libavahi_qt3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT3_LIBS)
|
||||||
|
libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_QT3_VERSION_INFO)
|
||||||
|
endif
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
diff -up avahi-0.8/avahi-qt/Makefile.am.no_undefined avahi-0.8/avahi-qt/Makefile.am
|
||||||
|
--- avahi-0.8/avahi-qt/Makefile.am.no_undefined 2018-09-14 00:31:28.490023071 -0500
|
||||||
|
+++ avahi-0.8/avahi-qt/Makefile.am 2020-11-17 16:35:04.646045499 -0600
|
||||||
|
@@ -38,9 +38,9 @@ libavahi_qt3_la_SOURCES = \
|
||||||
|
qt-watch.moc3: qt-watch.cpp
|
||||||
|
$(AM_V_GEN)$(MOC_QT3) $^ > $@
|
||||||
|
|
||||||
|
-libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) -DQT3 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
+libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) -DQT3 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
libavahi_qt3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT3_LIBS)
|
||||||
|
-libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_QT3_VERSION_INFO)
|
||||||
|
+libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -export-dynamic -version-info $(LIBAVAHI_QT3_VERSION_INFO)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_QT4
|
||||||
|
@@ -62,7 +62,7 @@ qt-watch.moc4: qt-watch.cpp
|
||||||
|
|
||||||
|
libavahi_qt4_la_CPPFLAGS = $(AM_CFLAGS) $(QT4_CFLAGS) -DQT4 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
libavahi_qt4_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT4_LIBS)
|
||||||
|
-libavahi_qt4_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT4_VERSION_INFO)
|
||||||
|
+libavahi_qt4_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -version-info $(LIBAVAHI_QT4_VERSION_INFO)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_QT5
|
||||||
|
@@ -84,7 +84,7 @@ qt-watch.moc5: qt-watch.cpp
|
||||||
|
|
||||||
|
libavahi_qt5_la_CPPFLAGS = $(AM_CFLAGS) --std=gnu++11 $(QT5_CFLAGS) -DQT5 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
libavahi_qt5_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT5_LIBS)
|
||||||
|
-libavahi_qt5_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT5_VERSION_INFO)
|
||||||
|
+libavahi_qt5_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -version-info $(LIBAVAHI_QT5_VERSION_INFO)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
diff -up avahi-0.8/avahi-qt/Makefile.in.no_undefined avahi-0.8/avahi-qt/Makefile.in
|
||||||
|
--- avahi-0.8/avahi-qt/Makefile.in.no_undefined 2020-02-18 01:03:16.474614659 -0600
|
||||||
|
+++ avahi-0.8/avahi-qt/Makefile.in 2020-11-17 16:36:12.263297534 -0600
|
||||||
|
@@ -551,9 +551,9 @@ BUILT_SOURCES = $(am__append_2) $(am__ap
|
||||||
|
@HAVE_QT3_TRUE@libavahi_qt3_la_SOURCES = \
|
||||||
|
@HAVE_QT3_TRUE@ qt-watch.cpp
|
||||||
|
|
||||||
|
-@HAVE_QT3_TRUE@libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
+@HAVE_QT3_TRUE@libavahi_qt3_la_CPPFLAGS = $(AM_CFLAGS) $(QT3_CFLAGS) -DQT3 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
@HAVE_QT3_TRUE@libavahi_qt3_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT3_LIBS)
|
||||||
|
-@HAVE_QT3_TRUE@libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_QT3_VERSION_INFO)
|
||||||
|
+@HAVE_QT3_TRUE@libavahi_qt3_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -export-dynamic -version-info $(LIBAVAHI_QT3_VERSION_INFO)
|
||||||
|
@HAVE_QT4_TRUE@avahiqt4includedir = $(includedir)/avahi-qt4
|
||||||
|
@HAVE_QT4_TRUE@avahiqt4include_HEADERS = \
|
||||||
|
@HAVE_QT4_TRUE@ qt-watch.h
|
||||||
|
@@ -563,7 +563,7 @@ BUILT_SOURCES = $(am__append_2) $(am__ap
|
||||||
|
|
||||||
|
@HAVE_QT4_TRUE@libavahi_qt4_la_CPPFLAGS = $(AM_CFLAGS) $(QT4_CFLAGS) -DQT4 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
@HAVE_QT4_TRUE@libavahi_qt4_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT4_LIBS)
|
||||||
|
-@HAVE_QT4_TRUE@libavahi_qt4_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT4_VERSION_INFO)
|
||||||
|
+@HAVE_QT4_TRUE@libavahi_qt4_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -version-info $(LIBAVAHI_QT4_VERSION_INFO)
|
||||||
|
@HAVE_QT5_TRUE@avahiqt5includedir = $(includedir)/avahi-qt5
|
||||||
|
@HAVE_QT5_TRUE@avahiqt5include_HEADERS = \
|
||||||
|
@HAVE_QT5_TRUE@ qt-watch.h
|
||||||
|
@@ -573,7 +573,7 @@ BUILT_SOURCES = $(am__append_2) $(am__ap
|
||||||
|
|
||||||
|
@HAVE_QT5_TRUE@libavahi_qt5_la_CPPFLAGS = $(AM_CFLAGS) --std=gnu++11 $(QT5_CFLAGS) -DQT5 $(VISIBILITY_HIDDEN_CFLAGS)
|
||||||
|
@HAVE_QT5_TRUE@libavahi_qt5_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la $(QT5_LIBS)
|
||||||
|
-@HAVE_QT5_TRUE@libavahi_qt5_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBAVAHI_QT5_VERSION_INFO)
|
||||||
|
+@HAVE_QT5_TRUE@libavahi_qt5_la_LDFLAGS = $(AM_LDFLAGS) -Wl,--no-undefined -no-undefined -version-info $(LIBAVAHI_QT5_VERSION_INFO)
|
||||||
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
all: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) all-am
|
Loading…
Reference in new issue