Compare commits
No commits in common. "c9s" and "c8" have entirely different histories.
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1 @@
|
|||||||
/libusb-compat-0.1.4.tar.bz2
|
SOURCES/libusb-compat-0.1.5.tar.bz2
|
||||||
/libusb-compat-0.1.5.tar.bz2
|
|
||||||
/libusb-compat-0.1.7.tar.bz2
|
|
||||||
|
@ -1 +1 @@
|
|||||||
335724bbf99369a53e7eec21e1e6b04618459575 libusb-compat-0.1.7.tar.bz2
|
062319276d913c753a4b1341036e6a2e42abccc9 SOURCES/libusb-compat-0.1.5.tar.bz2
|
||||||
|
51
SOURCES/0001-Link-with-znodelete-to-disallow-unloading.patch
Normal file
51
SOURCES/0001-Link-with-znodelete-to-disallow-unloading.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
From a9e8373030b39aadfc33af67443085df83e9e344 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Daniel Berrange <berrange@redhat.com>
|
||||||
|
Date: Wed, 14 Aug 2013 16:00:56 +0200
|
||||||
|
Subject: [libusb-compat PATCH] Link with -znodelete to disallow unloading
|
||||||
|
|
||||||
|
Since libusb-0.1 did not have any init / exit function, code using the
|
||||||
|
libusb-0.1 API will not call libusb_exit.
|
||||||
|
|
||||||
|
Now, libgphoto uses libusb and will dlopen() and dlclose() it. Unfortunately
|
||||||
|
since there is no way to ensure libusb_close() is called, when libgphoto
|
||||||
|
dlcloses the libusb.so library, the thread from libusbx.so will not be
|
||||||
|
stopped. So a thread will remain running, executing code from a memory
|
||||||
|
region that has now been freed. Crash-tastic results ensue.
|
||||||
|
|
||||||
|
I don't see a good way to fix this from libusb or libusbx, given the need to
|
||||||
|
preserve the existing API of libusb.
|
||||||
|
|
||||||
|
If, however, we link libusb.so using -znodelete, we will prevent it from
|
||||||
|
ever being unloaded, despite the dlclose() calls. This is not ideal, but
|
||||||
|
better than allowing it to be unloaded which is a guaranteed crash.
|
||||||
|
|
||||||
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
---
|
||||||
|
libusb/Makefile.am | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/libusb/Makefile.am b/libusb/Makefile.am
|
||||||
|
index 33a609a..a20fdb5 100644
|
||||||
|
--- a/libusb/Makefile.am
|
||||||
|
+++ b/libusb/Makefile.am
|
||||||
|
@@ -5,5 +5,5 @@ libusb_la_SOURCES = core.c usbi.h
|
||||||
|
libusb_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS)
|
||||||
|
libusb_la_LIBADD = $(LIBUSB_1_0_LIBS)
|
||||||
|
libusb_la_LDFLAGS = -version-info $(LT_MAJOR):$(LT_REVISION):$(LT_AGE) \
|
||||||
|
- -release 0.1
|
||||||
|
+ -release 0.1 -Wl,-z -Wl,nodelete
|
||||||
|
|
||||||
|
--- libusb-compat-0.1.5.orig/libusb/Makefile.in 2013-05-21 00:40:35.000000000 +0100
|
||||||
|
+++ libusb-compat-0.1.5.orig/libusb/Makefile.in 2013-08-13 22:20:32.831532426 +0100
|
||||||
|
@@ -297,7 +297,7 @@ libusb_la_SOURCES = core.c usbi.h
|
||||||
|
libusb_la_CFLAGS = -fvisibility=hidden $(AM_CFLAGS) $(LIBUSB_1_0_CFLAGS)
|
||||||
|
libusb_la_LIBADD = $(LIBUSB_1_0_LIBS)
|
||||||
|
libusb_la_LDFLAGS = -version-info $(LT_MAJOR):$(LT_REVISION):$(LT_AGE) \
|
||||||
|
- -release 0.1
|
||||||
|
+ -release 0.1 -Wl,-z -Wl,nodelete
|
||||||
|
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
55
SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch
Normal file
55
SOURCES/0002-Revert-use-atexit-to-call-libusb_exit.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
From eb590b4dac00a5188b93e1d6ebdd60b06f9ab3d7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
Date: Thu, 13 Feb 2014 17:25:27 +0100
|
||||||
|
Subject: [libusb-compat PATCH 2/2] Revert "use atexit() to call libusb_exit()"
|
||||||
|
|
||||||
|
The use of atexit() breaks various users of libusb-compat,
|
||||||
|
see ie: https://bugzilla.redhat.com/show_bug.cgi?id=1003193
|
||||||
|
|
||||||
|
This reverts commit 0be16b8dd25733d242ae32b57823a9513ec21353.
|
||||||
|
|
||||||
|
Closes libusbx/libusb-compat-0.1#2
|
||||||
|
|
||||||
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||||
|
---
|
||||||
|
libusb/core.c | 10 ----------
|
||||||
|
1 file changed, 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libusb/core.c b/libusb/core.c
|
||||||
|
index c0ccb1f..2dd1b5f 100644
|
||||||
|
--- a/libusb/core.c
|
||||||
|
+++ b/libusb/core.c
|
||||||
|
@@ -21,7 +21,6 @@
|
||||||
|
#include <config.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
-#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
@@ -137,13 +136,6 @@ static void usbi_log(enum usbi_log_level level, const char *function,
|
||||||
|
fprintf(stream, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
-static void _usb_finalize(void) {
|
||||||
|
- if (ctx) {
|
||||||
|
- libusb_exit(ctx);
|
||||||
|
- ctx = NULL;
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
API_EXPORTED void usb_init(void)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
@@ -159,8 +151,6 @@ API_EXPORTED void usb_init(void)
|
||||||
|
/* usb_set_debug can be called before usb_init */
|
||||||
|
if (usb_debug)
|
||||||
|
libusb_set_debug(ctx, 3);
|
||||||
|
-
|
||||||
|
- atexit(_usb_finalize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.5.3
|
||||||
|
|
@ -1,27 +1,28 @@
|
|||||||
Name: libusb
|
Name: libusb
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 0.1.7
|
Version: 0.1.5
|
||||||
Release: 5%{?dist}
|
Release: 12%{?dist}
|
||||||
Summary: Compatibility shim around libusb-1.0 offering the old 0.1 API
|
Summary: A library which allows userspace access to USB devices
|
||||||
License: LGPLv2+
|
Group: System Environment/Libraries
|
||||||
URL: https://github.com/libusb/libusb-compat-0.1
|
License: LGPLv2+
|
||||||
Source0: https://github.com/libusb/libusb-compat-0.1/releases/download/v%{version}/libusb-compat-%{version}.tar.bz2
|
URL: http://sourceforge.net/projects/libusb/
|
||||||
Patch0: libusb-config-multilib.patch
|
Source0: http://downloads.sourceforge.net/libusb/libusb-compat-%{version}.tar.bz2
|
||||||
BuildRequires: gcc libtool
|
Patch0: libusb-config-multilib.patch
|
||||||
BuildRequires: libusb1-devel
|
Patch1: 0001-Link-with-znodelete-to-disallow-unloading.patch
|
||||||
BuildRequires: make
|
Patch2: 0002-Revert-use-atexit-to-call-libusb_exit.patch
|
||||||
|
BuildRequires: libusb1-devel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package provides a shim / compatibility layer on top of libusb-1.0
|
This package provides a way for applications to access USB devices.
|
||||||
offering the old 0.1 API for applications which do not have been ported
|
Legacy libusb-0.1 is no longer supported by upstream, therefore content of this
|
||||||
to the new 1.0 API yet. Where ever possible applications really should
|
package was replaced by libusb-compat. It provides compatibility layer allowing
|
||||||
use and / or be ported to the new 1.0 API instead of relying on this
|
applications written for libusb-0.1 to work with libusb-1.0.
|
||||||
compatibility library.
|
|
||||||
|
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for libusb
|
Summary: Development files for libusb
|
||||||
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
|
Group: Development/Libraries
|
||||||
|
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
This package contains the header files, libraries and documentation needed to
|
This package contains the header files, libraries and documentation needed to
|
||||||
@ -29,45 +30,28 @@ develop applications that use libusb-0.1. However new applications should use
|
|||||||
libusb-1.0 library instead of this one.
|
libusb-1.0 library instead of this one.
|
||||||
|
|
||||||
|
|
||||||
%package tests-examples
|
|
||||||
Summary: Tests and examples for %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
|
|
||||||
|
|
||||||
%description tests-examples
|
|
||||||
This package contains tests and examples for %{name}.
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n libusb-compat-%{version}
|
%setup -q -n libusb-compat-%{version}
|
||||||
autoreconf -ivf
|
%patch0 -p1 -b .config-multilib
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --disable-static --enable-examples-build
|
%configure --disable-static
|
||||||
%make_build
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
rm $RPM_BUILD_ROOT%{_libdir}/libusb.la
|
rm $RPM_BUILD_ROOT%{_libdir}/libusb.la
|
||||||
for i in lsusb testlibusb; do
|
|
||||||
install -m 755 examples/.libs/$i \
|
|
||||||
$RPM_BUILD_ROOT%{_bindir}/libusb-compat-0.1-$i
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
|
||||||
LD_LIBRARY_PATH=libusb/.libs ldd -r $RPM_BUILD_ROOT%{_bindir}/libusb-compat-0.1-lsusb
|
|
||||||
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-compat-0.1-lsusb
|
|
||||||
LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-compat-0.1-testlibusb
|
|
||||||
|
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc AUTHORS NEWS README
|
%doc AUTHORS COPYING ChangeLog NEWS README
|
||||||
%license COPYING
|
|
||||||
%{_libdir}/libusb-0.1.so.*
|
%{_libdir}/libusb-0.1.so.*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
@ -76,41 +60,8 @@ LD_LIBRARY_PATH=libusb/.libs $RPM_BUILD_ROOT%{_bindir}/libusb-compat-0.1-testlib
|
|||||||
%{_libdir}/pkgconfig/libusb.pc
|
%{_libdir}/pkgconfig/libusb.pc
|
||||||
%{_bindir}/libusb-config
|
%{_bindir}/libusb-config
|
||||||
|
|
||||||
%files tests-examples
|
|
||||||
%{_bindir}/libusb-compat-0.1-lsusb
|
|
||||||
%{_bindir}/libusb-compat-0.1-testlibusb
|
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1:0.1.7-5
|
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
|
||||||
Related: rhbz#1991688
|
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:0.1.7-4
|
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.7-3
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.7-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Mar 14 2020 Hans de Goede <hdegoede@redhat.com> - 1:0.1.7-1
|
|
||||||
- New upstream release 0.1.7 (rhbz#1805154)
|
|
||||||
- Add tests-examples sub-package and %%check
|
|
||||||
|
|
||||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-16
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-15
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-14
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-13
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-12
|
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.1.5-12
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
# -devel and -tests-examples do not have docs / manpages
|
|
||||||
addFilter("W: no-documentation")
|
|
||||||
addFilter("W: no-manual-page-for-binary .*")
|
|
Loading…
Reference in New Issue
Block a user