diff --git a/.gitignore b/.gitignore index 7ad02b6..5df5e60 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /pappl-1.4.1.tar.gz /pappl-1.4.2.tar.gz /pappl-1.4.3.tar.gz +/pappl-1.4.4.tar.gz diff --git a/0001-device-network.c-Fix-crash-in-pappl_dnssd_list-with-.patch b/0001-device-network.c-Fix-crash-in-pappl_dnssd_list-with-.patch new file mode 100644 index 0000000..6f2cc90 --- /dev/null +++ b/0001-device-network.c-Fix-crash-in-pappl_dnssd_list-with-.patch @@ -0,0 +1,50 @@ +From 0a880d5a3fd8d924d570d47e91cd2b521b0dc2e9 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Thu, 11 Jan 2024 15:40:09 +0100 +Subject: [PATCH] device-network.c: Fix crash in `pappl_dnssd_list()` with + Avahi + +If PAPPL testsuite runs in isolated environment, e.g. in mock, we cannot +generate Avahi client, because Avahi is not running. This causes +`_papplDNSSDInit()` to return NULL, which is later sent into +`avahi_service_browser_new()`, which uses `assert()` for this argument +and make the binary crash if the input is NULL. + +The crash makes the testsuite fail during the build, which is useful +sanity check before the package is built. +--- + pappl/device-network.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/pappl/device-network.c b/pappl/device-network.c +index 108db3a..e866edd 100644 +--- a/pappl/device-network.c ++++ b/pappl/device-network.c +@@ -443,6 +443,7 @@ pappl_dnssd_list( + DNSServiceRef pdl_ref; // Browse reference for _pdl-datastream._tcp + # else + AvahiServiceBrowser *pdl_ref; // Browse reference for _pdl-datastream._tcp ++ _pappl_dns_sd_t dnssd; // DNS-SD service + # endif // HAVE_MDNSRESPONDER + + +@@ -467,7 +468,15 @@ pappl_dnssd_list( + _PAPPL_DEBUG("pappl_dnssd_find: pdl_ref=%p (after)\n", pdl_ref); + + # else +- if ((pdl_ref = avahi_service_browser_new(_papplDNSSDInit(NULL), AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_pdl-datastream._tcp", NULL, 0, pappl_dnssd_browse_cb, devices)) == NULL) ++ if ((dnssd = _papplDNSSDInit(NULL)) == NULL) ++ { ++ _papplDeviceError(err_cb, err_data, "Unable to create DNSSD service."); ++ cupsArrayDelete(devices); ++ _papplDNSSDUnlock(); ++ return (ret); ++ } ++ ++ if ((pdl_ref = avahi_service_browser_new(dnssd, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_pdl-datastream._tcp", NULL, 0, pappl_dnssd_browse_cb, devices)) == NULL) + { + _papplDeviceError(err_cb, err_data, "Unable to create service browser."); + cupsArrayDelete(devices); +-- +2.43.0 + diff --git a/pappl.spec b/pappl.spec index 58b5c07..9c00271 100644 --- a/pappl.spec +++ b/pappl.spec @@ -9,12 +9,15 @@ Summary: Printer Application Framework (PAPPL) Name: pappl -Version: 1.4.3 +Version: 1.4.4 Release: 1%{?dist} License: Apache-2.0 WITH LLVM-exception Source: https://github.com/michaelrsweet/pappl/releases/download/v%{version}/pappl-%{version}.tar.gz Url: https://www.msweet.org/pappl +# https://github.com/michaelrsweet/pappl/pull/320 +Patch001: 0001-device-network.c-Fix-crash-in-pappl_dnssd_list-with-.patch + BuildRequires: avahi-devel BuildRequires: cups-devel BuildRequires: gcc @@ -56,20 +59,24 @@ This package provides the PAPPL headers and development environment. %autosetup -S git %build -export DSOFLAGS="$DSOFLAGS -Wl,-z,now,--as-needed" #need this to enable build with '-D_TIME_BITS=64' flag export CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" -%configure +%configure --enable-libjpeg\ + --enable-libpng\ + --enable-libusb\ + --disable-static\ + --with-dnssd=avahi\ + --with-tls=gnutls\ + --with-dsoflags="$DSOFLAGS -Wl,-z,now,--as-needed" +# add --enable-libpam once there is a new version - cosmetic issue, libpam is used when +# found in buildroot, which is taken care of by BuilrRequires for pam-devel %make_build %install %make_install BUILDROOT=%{buildroot} -# Removal of the static library. -rm -f %{buildroot}/%{_libdir}/libpappl.a %check -#new upstream tests from v1.3.0 are failing in mock -#make test +make test %files %{_libdir}/libpappl.so.* @@ -77,17 +84,30 @@ rm -f %{buildroot}/%{_libdir}/libpappl.a %license LICENSE NOTICE %files devel -%{_bindir}/* %doc %{_docdir}/pappl/* -%{_mandir}/*/* %dir %{_datadir}/pappl +%dir %{_docdir}/pappl %dir %{_includedir}/pappl +%{_bindir}/pappl-makeresheader %{_datadir}/pappl/* %{_includedir}/pappl/*.h %{_libdir}/libpappl.so %{_libdir}/pkgconfig/pappl.pc +%{_mandir}/man1/pappl.1.gz +%{_mandir}/man1/pappl-makeresheader.1.gz +%{_mandir}/man3/pappl-client.3.gz +%{_mandir}/man3/pappl-device.3.gz +%{_mandir}/man3/pappl-job.3.gz +%{_mandir}/man3/pappl-log.3.gz +%{_mandir}/man3/pappl-mainloop.3.gz +%{_mandir}/man3/pappl-printer.3.gz +%{_mandir}/man3/pappl-resource.3.gz +%{_mandir}/man3/pappl-system.3.gz %changelog +* Thu Jan 11 2024 Zdenek Dohnal - 1.4.4-1 +- 2255704 - pappl-1.4.4 is available + * Mon Dec 18 2023 Richard Lescak - 1.4.3-1 - rebase to version 1.4.3 (#2250222) diff --git a/sources b/sources index 284af55..6593976 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pappl-1.4.3.tar.gz) = 5526dd209944ba7df779439888776485f1100cdf60eed4af90b566e9aee6814d43d49f81652edb59c04b92a008b1d842918df29a8d379f4b55ab2e1bfa99bf9d +SHA512 (pappl-1.4.4.tar.gz) = 59351f0cbe72ee8109d89b74e4f7623f87128c548944529ec1e63556a0c516b22cb46eaf8e87a63b4a55d2e08d93866565c1e60e0b9eee3fe99277d8b56edd5d