Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

36 changed files with 1064 additions and 605 deletions

View File

@ -1 +1 @@
8a062878968c0f8e083046429647ad33b122542f SOURCES/avahi-0.7.tar.gz
969a50ae18c8d8e2288435a75666dd076e69852a avahi-0.8.tar.gz

9
.gitignore vendored
View File

@ -1 +1,8 @@
SOURCES/avahi-0.7.tar.gz
/x86_64
/.build-*.log
/avahi-0.6.3?/
*.src.rpm
/avahi-0.6.31.tar.gz
/avahi-0.6.32.tar.gz
/avahi-0.7.tar.gz
/avahi-0.8.tar.gz

View File

@ -36,5 +36,5 @@ index 3e0ebb1..6c0274d 100644
watch,
(c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) |
--
2.41.0
2.40.0

View File

@ -0,0 +1,56 @@
From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Thu, 17 Nov 2022 01:51:53 +0100
Subject: [PATCH] Emit error if requested service is not found
It currently just crashes instead of replying with error. Check return
value and emit error instead of passing NULL pointer to reply.
Fixes #375
---
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index 70d7687..406d0b4 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_alternative_host_name(DBusConnection *c, DBusM
}
t = avahi_alternative_host_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);
- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
+ }
}
static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) {
@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DB
}
t = avahi_alternative_service_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);
- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
+ }
}
static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) {
--
2.41.0

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

29
0016-fix-QT3-build.patch Normal file
View File

@ -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

View File

@ -1,56 +0,0 @@
From 509b0d14fa46b7015e0bacf2a8105f1d14d7b5e5 Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Wed, 23 Aug 2023 18:51:46 +0200
Subject: [PATCH] Emit error if requested service is not found
It currently just crashes instead of replying with error. Check return
value and emit error instead of passing NULL pointer to reply.
Fixes #375
---
avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index eb8a662..a9b62fe 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -391,10 +391,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
}
t = avahi_alternative_host_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);
- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found");
+ }
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAlternativeServiceName")) {
char *n, *t;
@@ -405,10 +409,14 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
}
t = avahi_alternative_service_name(n);
- avahi_dbus_respond_string(c, m, t);
- avahi_free(t);
+ if (t) {
+ avahi_dbus_respond_string(c, m, t);
+ avahi_free(t);
- return DBUS_HANDLER_RESULT_HANDLED;
+ return DBUS_HANDLER_RESULT_HANDLED;
+ } else {
+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found");
+ }
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "EntryGroupNew")) {
Client *client;
--
2.41.0

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,23 +1,45 @@
%bcond_with bootstrap
%if %{without bootstrap}
%{?!WITH_MONO: %global WITH_MONO 1}
%else
%{?!WITH_MONO: %global WITH_MONO 0}
%endif
%{?!WITH_COMPAT_DNSSD: %global WITH_COMPAT_DNSSD 1}
%{?!WITH_COMPAT_HOWL: %global WITH_COMPAT_HOWL 1}
%{?!WITH_QT3: %global WITH_QT3 1}
%{?!WITH_QT4: %global WITH_QT4 1}
%{?!WITH_QT3: %global WITH_QT3 0}
%{?!WITH_QT4: %global WITH_QT4 0}
%if %{without bootstrap}
%{?!WITH_QT5: %global WITH_QT5 1}
%else
%{?!WITH_QT5: %global WITH_QT5 0}
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=1751484
%{?!WITH_PYTHON: %global WITH_PYTHON 0}
%ifnarch %{mono_arches}
%define WITH_MONO 0
%endif
%if 0%{?rhel}
%define WITH_MONO 0
%if 0%{?rhel} >= 6
%define WITH_QT4 0
%endif
%if 0%{?rhel} > 7
%define WITH_QT3 0
%endif
%if 0%{?fedora}
%global WITH_QT3 1
%global WITH_QT4 1
%endif
%if 0%{?rhel}
%global WITH_MONO 0
%global WITH_QT5 0
%if 0%{?rhel} < 8
%global WITH_PYTHON 1
%endif
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=1907727
%global _lto_cflags %{nil}
# http://bugzilla.redhat.com/1008395 - no hardened build
%global _hardened_build 1
@ -25,8 +47,8 @@
%global _changelog_trimtime %(date +%s -d "1 year ago")
Name: avahi
Version: 0.7
Release: 21%{?dist}.1
Version: 0.8
Release: 20%{?dist}
Summary: Local network service discovery
License: LGPLv2+
URL: http://avahi.org
@ -42,11 +64,11 @@ BuildRequires: automake
BuildRequires: libtool
BuildRequires: dbus-devel >= 0.90
BuildRequires: dbus-glib-devel >= 0.70
BuildRequires: python3-dbus
BuildRequires: python3-libxml2
BuildRequires: desktop-file-utils
%if %{without bootstrap}
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel >= 2.99.0
%endif
#BuildRequires: gobject-introspection-devel
%if %{WITH_QT3}
BuildRequires: qt3-devel
@ -54,14 +76,36 @@ BuildRequires: qt3-devel
%if %{WITH_QT4}
BuildRequires: qt4-devel
%endif
%if %{WITH_QT5}
BuildRequires: qt5-qtbase-devel
%endif
BuildRequires: libdaemon-devel >= 0.11
BuildRequires: glib2-devel
BuildRequires: libcap-devel
BuildRequires: expat-devel
%if %{WITH_PYTHON}
%if %{without bootstrap}
BuildRequires: pygtk2
%endif
%if 0%{?fedora} > 27
%global python2_dbus python2-dbus
%global python2_libxml2 python2-libxml2
%else
%global python2_dbus dbus-python
%global python2_libxml2 libxml2-python
%endif
BuildRequires: %{python2_dbus}
BuildRequires: %{python2_libxml2}
# really only need interpreter + rpm-macros -- rex
BuildRequires: python2-devel
BuildRequires: python3-devel
%else
Obsoletes: python2-avahi < %{version}-%{release}
Obsoletes: python3-avahi < %{version}-%{release}
%endif
BuildRequires: gdbm-devel
BuildRequires: pkgconfig(pygobject-3.0)
BuildRequires: pkgconfig(libevent) >= 2.0.21
BuildRequires: intltool
BuildRequires: perl-XML-Parser
BuildRequires: xmltoman
@ -72,6 +116,7 @@ BuildRequires: monodoc-devel
BuildRequires: systemd
%{?systemd_requires}
BuildRequires: gcc
BuildRequires: gcc-c++
%if 0%{?beta:1}
Source0: https://github.com/lathiat/avahi/archive/%{version}-%{beta}.tar.gz#/%{name}-%{version}-%{beta}.tar.gz
@ -81,24 +126,29 @@ Source0: https://github.com/lathiat/avahi/releases/download/v%{version}
%endif
## upstream patches
Patch0001: 0001-avahi-python-Use-the-agnostic-DBM-interface.patch
Patch0002: 0002-avahi-python-Encode-unicode-strings-as-UTF-8.patch
Patch0003: 0003-Remove-empty-avahi_discover-Python-module.patch
# https://github.com/lathiat/avahi/pull/202
Patch0004: 0004-avahi-client-fix-resource-leak.patch
Patch0005: 0005-chroot-fix-bogus-assignments-in-assertions.patch
Patch0006: 0001-Emit-error-if-requested-service-is-not-found.patch
Patch0007: 0001-Ensure-each-label-is-at-least-one-byte-long.patch
Patch0008: 0001-core-make-sure-there-is-rdata-to-process-before-pars.patch
Patch0009: 0001-core-copy-resource-records-with-zero-length-rdata-pr.patch
Patch0010: 0001-common-derive-alternative-host-name-from-its-unescap.patch
Patch0011: 0001-core-extract-host-name-using-avahi_unescape_label.patch
Patch0012: 0001-core-return-errors-from-avahi_server_set_host_name-p.patch
Patch0013: 0001-core-reject-overly-long-TXT-resource-records.patch
Patch0014: 0001-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-.patch
Patch6: 0006-avahi-dnsconfd.service-Drop-Also-avahi-daemon.socket.patch
Patch7: 0007-man-add-missing-bshell.1-symlink.patch
Patch8: 0008-Ship-avahi-discover-1-bssh-1-and-bvnc-1-also-for-GTK.patch
Patch9: 0009-fix-requires-in-pc-file.patch
Patch10: 0010-fix-bytestring-decoding-for-proper-display.patch
Patch11: 0011-avahi_dns_packet_consume_uint32-fix-potential-undefi.patch
Patch12: 0001-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-.patch
Patch13: 0001-Fix-NULL-pointer-crashes-from-175.patch
Patch14: 0001-Emit-error-if-requested-service-is-not-found.patch
Patch15: 0001-common-derive-alternative-host-name-from-its-unescap.patch
Patch16: 0001-Ensure-each-label-is-at-least-one-byte-long.patch
Patch17: 0001-core-make-sure-there-is-rdata-to-process-before-pars.patch
Patch18: 0001-core-copy-resource-records-with-zero-length-rdata-pr.patch
Patch19: 0001-core-extract-host-name-using-avahi_unescape_label.patch
Patch20: 0001-core-return-errors-from-avahi_server_set_host_name-p.patch
Patch21: 0001-core-reject-overly-long-TXT-resource-records.patch
## downstream patches
Patch100: avahi-0.6.30-mono-libdir.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1897925
# https://github.com/lathiat/avahi/pull/312
Patch101: 0016-fix-QT3-build.patch
Patch102: avahi-0.8-no_undefined.patch
%description
Avahi is a system which facilitates service discovery on
@ -117,6 +167,26 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description tools
Command line tools that use avahi to browse and publish mDNS services.
%package ui-tools
Summary: UI tools for mDNS browsing
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
Requires: %{name}-ui-gtk3%{?_isa} = %{version}-%{release}
Requires: tigervnc
Requires: openssh-clients
%if %{WITH_PYTHON}
Requires: gdbm
Requires: pygtk2
Requires: pygtk2-libglade
Requires: python2-avahi = %{version}-%{release}
Requires: %{python2_dbus}
Requires: python2-gobject-base
%endif
%description ui-tools
Graphical user interface tools that use Avahi to browse for mDNS services.
%package glib
Summary: Glib libraries for avahi
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -152,6 +222,7 @@ Requires: %{name}-gobject%{?_isa} = %{version}-%{release}
The avahi-gobject-devel package contains the header files and libraries
necessary for developing programs using avahi-gobject.
%if %{without bootstrap}
%package ui
Summary: Gtk user interface library for Avahi (Gtk+ 2 version)
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
@ -180,6 +251,7 @@ Requires: %{name}-ui-gtk3%{?_isa} = %{version}-%{release}
%description ui-devel
The avahi-ui-devel package contains the header files and libraries
necessary for developing programs using avahi-ui.
%endif
%if %{WITH_QT3}
%package qt3
@ -217,6 +289,24 @@ Th avahi-qt4-devel package contains the header files and libraries
necessary for developing programs using avahi with Qt4.
%endif
%if %{WITH_QT5}
%package qt5
Summary: Qt5 libraries for avahi
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description qt5
Libraries for easy use of avahi from Qt5 applications.
%package qt5-devel
Summary: Libraries and header files for avahi Qt5 development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
%description qt5-devel
Th avahi-qt5-devel package contains the header files and libraries
necessary for developing programs using avahi with Qt5.
%endif
%if %{WITH_MONO}
%package sharp
Summary: Mono language bindings for avahi mono development
@ -235,6 +325,7 @@ Requires: %{name}-sharp%{?_isa} = %{version}-%{release}
Requires: mono-core >= 1.1.13
Requires: gtk-sharp2
BuildRequires: gtk-sharp2-devel
BuildRequires: make
%description ui-sharp
The avahi-sharp package contains the files needed to run
@ -328,6 +419,17 @@ avahi-dnsconfd connects to a running avahi-daemon and runs the script
local LAN. This is useful for configuring unicast DNS servers in a DHCP-like
fashion with mDNS.
%if %{WITH_PYTHON}
%package -n python2-avahi
Summary: Python2 Avahi bindings
Obsoletes: python-avahi < 0.7
Provides: python-avahi = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python2-avahi
%{summary}.
%package -n python3-avahi
Summary: Python3 Avahi bindings
Requires: %{name} = %{version}-%{release}
@ -335,6 +437,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python3-avahi
%{summary}.
%endif
%prep
@ -344,12 +447,11 @@ rm -fv docs/INSTALL
%build
# patch100 requires autogen
# patch100/101/102 requires autogen
# and kills rpaths a bonus
rm -fv missing
NOCONFIGURE=1 ./autogen.sh
export PYTHON=%{__python3}
%configure \
--with-distro=fedora \
--disable-monodoc \
@ -364,17 +466,29 @@ export PYTHON=%{__python3}
--enable-static=no \
--disable-silent-rules \
--disable-stack-protector \
%if %{without bootstrap}
--enable-gtk \
%else
--disable-gtk \
--disable-gtk3 \
%endif
%if ! %{WITH_PYTHON}
--disable-python \
%endif
%if %{WITH_COMPAT_DNSSD}
--enable-compat-libdns_sd \
%endif
%if %{WITH_COMPAT_HOWL}
--enable-compat-howl \
%endif
%if ! %{WITH_QT3}
--disable-qt3 \
%if %{WITH_QT3}
--enable-qt3 \
%endif
%if ! %{WITH_QT4}
--disable-qt4 \
%if %{WITH_QT4}
--enable-qt4 \
%endif
%if ! %{WITH_QT5}
--disable-qt5 \
%endif
%if ! %{WITH_MONO}
--disable-mono \
@ -415,13 +529,12 @@ ln -s avahi-compat-libdns_sd.pc %{buildroot}/%{_libdir}/pkgconfig/libdns_sd.pc
ln -s avahi-compat-libdns_sd/dns_sd.h %{buildroot}/%{_includedir}/
%endif
%if %{WITH_PYTHON}
# Add python3 support
mkdir -p %{buildroot}%{python3_sitelib}/avahi/
cp -r %{buildroot}%{python2_sitelib}/avahi/* %{buildroot}%{python3_sitelib}/avahi/
rm -fv %{buildroot}%{buildroot}%{python3_sitelib}/avahi/*.py{c,o}
rm -fv %{buildroot}%{buildroot}%{python3_sitelib}/avahi_discover/*.py{c,o}
rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-daemon
rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-dnsconfd
sed -i 's!/usr/bin/python2!/usr/bin/python3!' %{buildroot}%{python3_sitelib}/avahi/ServiceTypeDatabase.py
# avoid empty GenericName keys from .desktop files
for i in %{buildroot}%{_datadir}/applications/*.desktop ; do
@ -429,20 +542,26 @@ if [ -n "$(grep '^GenericName=$' $i)" ]; then
desktop-file-edit --copy-name-to-generic-name $i
fi
done
%else
# unpackaged files
rm -fv %{buildroot}%{_datadir}/applications/{bssh,bvnc}.desktop
rm -fv %{buildroot}%{_datadir}/avahi/interfaces/avahi-discover.ui
%endif
# Remove python2 files installed by default
rm -rfv %{buildroot}%{python2_sitelib}/avahi/
rm -rfv %{buildroot}%{python2_sitelib}/avahi_discover/
# Remove ui-tools that depend on python2
rm -rfv %{buildroot}/%{_datadir}/avahi/interfaces
rm -fv %{buildroot}/%{_datadir}/applications/avahi-discover.desktop
rm -fv %{buildroot}/%{_datadir}/applications/bssh.desktop
rm -fv %{buildroot}/%{_datadir}/applications/bvnc.desktop
rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-daemon
rm -fv %{buildroot}%{_sysconfdir}/rc.d/init.d/avahi-dnsconfd
%find_lang %{name}
%check
%if %{WITH_PYTHON}
for i in %{buildroot}%{_datadir}/applications/*.desktop ; do
desktop-file-validate $i
done
%endif
%pre
getent group avahi >/dev/null || groupadd -f -g 70 -r avahi
if ! getent passwd avahi > /dev/null ; then
@ -517,7 +636,9 @@ exit 0
%dir %{_datadir}/avahi
%{_datadir}/avahi/*.dtd
%dir %{_libdir}/avahi
%if %{WITH_PYTHON}
%{_libdir}/avahi/service-types.db
%endif
%{_mandir}/man5/*
%{_mandir}/man8/avahi-daemon.*
%{_unitdir}/avahi-daemon.service
@ -539,30 +660,64 @@ exit 0
%{_unitdir}/avahi-dnsconfd.service
%files tools
%{_bindir}/*
%{_mandir}/man1/*
%exclude %{_bindir}/b*
%exclude %{_bindir}/avahi-discover*
%exclude %{_bindir}/avahi-bookmarks
%exclude %{_mandir}/man1/b*
%exclude %{_mandir}/man1/avahi-discover*
%exclude %{_mandir}/man1/avahi-bookmarks*
%{_bindir}/avahi-browse
%{_bindir}/avahi-browse-domains
%{_bindir}/avahi-publish
%{_bindir}/avahi-publish-address
%{_bindir}/avahi-publish-service
%{_bindir}/avahi-resolve
%{_bindir}/avahi-resolve-address
%{_bindir}/avahi-resolve-host-name
%{_bindir}/avahi-set-host-name
%{_mandir}/man1/avahi-browse.1*
%{_mandir}/man1/avahi-browse-domains.1*
%{_mandir}/man1/avahi-publish.1*
%{_mandir}/man1/avahi-publish-address.1*
%{_mandir}/man1/avahi-publish-service.1*
%{_mandir}/man1/avahi-resolve.1*
%{_mandir}/man1/avahi-resolve-address.1*
%{_mandir}/man1/avahi-resolve-host-name.1*
%{_mandir}/man1/avahi-set-host-name.1*
%files ui-tools
%{_bindir}/bshell
%{_bindir}/bssh
%{_bindir}/bvnc
%{_bindir}/avahi-discover-standalone
%{_mandir}/man1/bshell.1*
%{_mandir}/man1/bssh.1*
%{_mandir}/man1/bvnc.1*
%if %{WITH_PYTHON}
# avahi-bookmarks is not really a UI tool, but I won't create a seperate package for it...
%{_bindir}/avahi-bookmarks
%{_mandir}/man1/avahi-discover*
%{_mandir}/man1/avahi-bookmarks*
%{_datadir}/applications/b*.desktop
%{_datadir}/applications/avahi-discover.desktop
%{_datadir}/avahi/interfaces/
%{python2_sitelib}/avahi_discover/
%endif
%files devel
%{_libdir}/libavahi-common.so
%{_libdir}/libavahi-core.so
%{_libdir}/libavahi-client.so
%{_libdir}/libavahi-libevent.so
%{_includedir}/avahi-client
%{_includedir}/avahi-common
%{_includedir}/avahi-core
%{_includedir}/avahi-libevent
%{_libdir}/pkgconfig/avahi-core.pc
%{_libdir}/pkgconfig/avahi-client.pc
%{_libdir}/pkgconfig/avahi-libevent.pc
%files libs
%doc README
%license LICENSE
%{_libdir}/libavahi-common.so.*
%{_libdir}/libavahi-client.so.*
%{_libdir}/libavahi-libevent.so.*
%files glib
%{_libdir}/libavahi-glib.so.*
@ -584,6 +739,7 @@ exit 0
#%{_datadir}/gir-1.0/Avahi-0.6.gir
#%{_datadir}/gir-1.0/AvahiCore-0.6.gir
%if %{without bootstrap}
%files ui
%{_libdir}/libavahi-ui.so.*
@ -596,6 +752,7 @@ exit 0
%{_includedir}/avahi-ui
%{_libdir}/pkgconfig/avahi-ui.pc
%{_libdir}/pkgconfig/avahi-ui-gtk3.pc
%endif
%if %{WITH_QT3}
%ldconfig_scriptlets qt3
@ -621,6 +778,18 @@ exit 0
%{_libdir}/pkgconfig/avahi-qt4.pc
%endif
%if %{WITH_QT5}
%ldconfig_scriptlets qt5
%files qt5
%{_libdir}/libavahi-qt5.so.*
%files qt5-devel
%{_libdir}/libavahi-qt5.so
%{_includedir}/avahi-qt5/
%{_libdir}/pkgconfig/avahi-qt5.pc
%endif
%if %{WITH_MONO}
%files sharp
%{_prefix}/lib/mono/avahi-sharp
@ -658,47 +827,114 @@ exit 0
%{_libdir}/pkgconfig/libdns_sd.pc
%endif
%if %{WITH_PYTHON}
%files -n python2-avahi
%{python2_sitelib}/avahi/
%files -n python3-avahi
# These are .py files only, so they don't go in lib64
%{python3_sitelib}/avahi/
%endif
%changelog
* Wed Dec 06 2023 Michal Sekletar <msekleta@redhat.com> - 0.7-21.1
- Fix CVE-2021-3468 (RHEL-18311)
- Fix CVE-2023-38469 (RHEL-17783)
- Fix CVE-2023-38470 (RHEL-17795)
- Fix CVE-2023-38471 (RHEL-17789)
- Fix CVE-2023-38472 (RHEL-17807)
- Fix CVE-2023-38473 (RHEL-17801)
* Wed Nov 08 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-20
- Fix CVE-2023-38469 (RHEL-5637)
* Wed Aug 23 2023 Michal Sekletar <msekleta@redhat.com> - 0.7-21
- Fix CVE-2023-1981 (#2186688)
* Wed Nov 08 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-19
- Fix CVE-2023-38471 (RHEL-5642)
* Tue Nov 03 2020 Michal Sekletár <msekleta@redhat.com> - 0.7-20
- rebuild to include UI related subpackages to CodeReady Builder repo (#1879714)
* Wed Nov 08 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-18
- Fix CVE-2023-38472 (RHEL-5645)
* Tue Oct 23 2018 Michal Sekletár <msekleta@redhat.com> - 0.7-19
- make sure we get compiled with -fstack-protector-strong (#1624099)
- fix issues reported by coverity (#1602449)
* Wed Nov 01 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-17
- Fix CVE-2023-38470 (RHEL-5641)
* Fri Aug 03 2018 Petr Viktorin <pviktori@redhat.com> - 0.7-18
- Remove unused BuildRequires on pygtk2 (#1561019)
* Wed Nov 01 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-16
- Fix CVE-2023-38473 (RHEL-5729)
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 0.7-17
- Rebuild with fixed binutils
* Wed Aug 23 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-15
- Fix CVE-2023-1981 (#2186689)
* Mon Jul 30 2018 Petr Kubat <pkubat@redhat.com> - 0.7-16
- One more bump for gdbm
* Wed Aug 23 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-14
- Fix CVE-2021-3502 (#1949949)
* Wed Jul 25 2018 Petr Kubat <pkubat@redhat.com> - 0.7-15
- Rebuilt for gdbm
* Thu Aug 17 2023 Michal Sekletar <msekleta@redhat.com> - 0.8-13
- Fix CVE-2021-3468 (#1944092)
* Wed Jun 20 2018 Tomas Orsava <torsava@redhat.com> - 0.7-14
- Switch hardcoded python3 shebangs into the %%{__python3} macro
* Mon Feb 21 2022 Michal Sekletár <msekleta@redhat.com> - 0.8-12
- make sure we get compiled with -fstack-protector-strong (#2044643)
* Fri May 18 2018 Michal Sekletar <msekleta@redhat.com> - 0.7-13
- drop avahi-python2 and avahi-ui-tools due to lacking python2 support (#1561019)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-11
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.8-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Feb 16 2021 Rex Dieter <rdieter@fedoraproject.org> - 0.8-9
- cleanup/fix conditionals (#1751484)
- disable lto, workaround FTBFS (#1907727)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Nov 17 2020 Rex Dieter <rdieter@fedoraproject.org> - 0.8-7
- fix undefined symbols in libavahi-qt3 (#1897925)
* Thu Oct 15 2020 Rex Dieter <rdieter@fedoraproject.org> - 0.8-6
- resurrect ui-tools, not just for python (#1885513)
* Mon Sep 21 2020 Michal Sekletar <msekleta@redhat.com> - 0.8-5
- Disable bootstrap
* Mon Sep 07 2020 Ondřej Lysoněk <olysonek@redhat.com> - 0.8-4
- Rebuilt due to libevent rebase
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sun Mar 22 2020 Rex Dieter <rdieter@fedoraproject.org> - 0.8-2
- pull in some upstream fixes
* Sun Mar 22 2020 Lubomir Rintel <lkundrak@v3.sk> - 0.8-1
- Update to version 0.8
* Thu Feb 20 2020 Petr Viktorin <pviktori@redhat.com> - 0.7-24
- Don't BuildRequire pygtk2 if building without Python
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Sep 19 2019 Rex Dieter <rdieter@fedoraproject.org> - 0.7-22
- drop python bindings/support (includes -ui-tools that use the bindings) on f31+ (#1751484)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.7-21
- Rebuilt for Python 3.8
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 22 2019 Michal Sekletár <msekleta@redhat.com> - 0.7-19
- add support for advertising services on the local machine only (i.e. on loopback)
* Mon Feb 04 2019 Kalev Lember <klember@redhat.com> - 0.7-18
- Update requires for pygobject3 -> python2-gobject rename
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jul 30 2018 Adam Williamson <awilliam@redhat.com> - 0.7-16
- Update python3 sed hack to avoid '/usr/bin/python32' dep
* Tue Jul 24 2018 Jan Grulich <jgrulich@redhat.com> - 0.7-15
- Requires: tigervnc
Tigervnc removed old obsoleted provides
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.7-13
- Rebuilt for Python 3.7
* Thu Apr 05 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.7-12
- use %%make_build %%ldconfig_scriptlets %%license

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (avahi-0.8.tar.gz) = c6ba76feb6e92f70289f94b3bf12e5f5c66c11628ce0aeb3cadfb72c13a5d1a9bd56d71bdf3072627a76cd103b9b056d9131aa49ffe11fa334c24ab3b596c7de

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/avahi/Sanity/Basic-sanity-test
# Description: Tests basic functionality of avahi.
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program 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 General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/avahi/Sanity/Basic-sanity-test
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE named.conf zonefile
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -e runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Tests basic functionality of avahi." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: avahi" >> $(METADATA)
@echo "Requires: avahi avahi-tools bind bind-chroot bind-utils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RedHatEnterpriseLinux3 -RedHatEnterpriseLinux4" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,15 @@
PURPOSE of /CoreOS/avahi/Sanity/Basic-sanity-test
Description: Tests basic functionality of avahi.
Author: Martin Cermak <mcermak@redhat.com>
My objective was to write a very basic sanity test for avahi.
As I'm the avahi newbie, I browsed avahi.org, experimented
a little with RHEL avahi packages and pinged Lennart, which
did not respond.
My result is a simple test for the avahi domain name resolver.
It requires the avahi-daemon running. As the RHTS/Beaker is/will
shortly be a closed system without the possibility to reach the
outside network, this test contains its own nameserver.

View File

@ -0,0 +1,11 @@
options {
directory "/var/named";
allow-query { any; };
};
zone "<DOMAIN>" IN {
type master;
file "<DOMAIN>.zone";
allow-update { none; };
};

View File

@ -0,0 +1,96 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/avahi/Sanity/Basic-sanity-test
# Description: Tests basic functionality of avahi.
# Author: Martin Cermak <mcermak@redhat.com>
# Author: Tomas Dolezal <todoleza@redhat.com> - rhel7 updates
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program 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 General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh
. /usr/lib/beakerlib/beakerlib.sh
TEMPSTR=$(date +%c%N | md5sum | awk '{print $1}' | cut -c -8)
ORIGPWD=$(pwd)
IP1='127.0.0.1'
IP2='::1'
rlJournalStart
rlPhaseStartSetup
rlAssertRpm 'avahi'
rlAssertRpm 'avahi-tools'
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
ROOTDIR="" #using non-chroot
rlFileBackup /etc/named.conf /etc/resolv.conf
rlFileBackup --clean /var/named/
cat $ORIGPWD/named.conf > /etc/named.conf
rlRun "TDOMAIN=$TEMPSTR.cz"
rlRun "TZONEFILE=$ROOTDIR/var/named/$TDOMAIN.zone"
# set up /etc/named.conf
rlRun "sed -i \"s/<DOMAIN>/$TDOMAIN/g\" /etc/named.conf"
# set up zonefile
rlRun "cp $ORIGPWD/zonefile $TZONEFILE"
rlRun "chmod a+r $TZONEFILE"
rlRun "sed -i \"s/<DOMAIN>/$TDOMAIN/g\" $TZONEFILE"
rlRun "sed -i \"s/<IP1>/$IP1/g\" $TZONEFILE"
rlRun "sed -i \"s/<IP2>/$IP2/g\" $TZONEFILE"
rlRun "sed -i \"s/<SERIAL>/$(date +%N)/g\" $TZONEFILE"
rlServiceStart named #using non-chroot
# set default resolver
rlRun "echo nameserver 127.0.0.1 > /etc/resolv.conf"
rlPhaseEnd
rlPhaseStartTest
# check bind
rlRun "dig @localhost server1.$TDOMAIN +short | grep $IP1"
rlRun "dig AAAA @localhost server2.$TDOMAIN +short | grep $IP2"
# turn on avahi or restart it with new resolv.conf
rlServiceStart "avahi-daemon"
# the test itself...
rlRun "avahi-resolve -4n server1.$TDOMAIN | grep '127.0.0.1'" 0 "Test the IPv4 avahi DN resolver."
rlRun "avahi-resolve -6n server2.$TDOMAIN | grep '::1'" 0 "Test the IPv6 avahi DN resolver."
rlPhaseEnd
rlPhaseStartCleanup
rlFileRestore
rlServiceStart avahi-daemon
rlServiceRestore named avahi-daemon
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,23 @@
$ORIGIN <DOMAIN>.
$TTL 86400
@ IN SOA dns1.<DOMAIN>. hostmaster.<DOMAIN>. (
<SERIAL> ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
IN NS dns1.<DOMAIN>.
IN NS dns2.<DOMAIN>.
IN MX 10 mail.<DOMAIN>.
IN MX 20 mail2.<DOMAIN>.
IN A <IP1>
server1 IN A <IP1>
server2 IN AAAA <IP2>
dns1 IN A <IP1>
dns2 IN A <IP1>

16
tests/tests.yml Normal file
View File

@ -0,0 +1,16 @@
---
# Tests that run in classic context
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- Basic-sanity-test
required_packages:
- avahi
- avahi-tools
- bind
- bind-chroot
- bind-utils