diff --git a/SOURCES/python-ethtool-0.8-check-libnl-return-codes.patch b/SOURCES/python-ethtool-0.8-check-libnl-return-codes.patch new file mode 100644 index 0000000..eacbdfc --- /dev/null +++ b/SOURCES/python-ethtool-0.8-check-libnl-return-codes.patch @@ -0,0 +1,48 @@ +--- a/python-ethtool/etherinfo.c.orig 2014-01-13 13:38:58.716919961 +0100 ++++ b/python-ethtool/etherinfo.c 2014-01-13 13:52:15.838033480 +0100 +@@ -327,6 +327,9 @@ + */ + if( ethinf->index < 0 ) { + link_cache = rtnl_link_alloc_cache(*data->nlc); ++ if( link_cache == NULL ) { ++ return 0; ++ } + ethinf->index = rtnl_link_name2i(link_cache, ethinf->device); + if( ethinf->index < 0 ) { + return 0; +@@ -339,6 +342,9 @@ + case NLQRY_LINK: + /* Extract MAC/hardware address of the interface */ + link_cache = rtnl_link_alloc_cache(*data->nlc); ++ if( link_cache == NULL ) { ++ return 0; ++ } + link = rtnl_link_alloc(); + rtnl_link_set_ifindex(link, ethinf->index); + nl_cache_foreach_filter(link_cache, (struct nl_object *)link, callback_nl_link, ethinf); +@@ -350,7 +356,14 @@ + case NLQRY_ADDR: + /* Extract IP address information */ + addr_cache = rtnl_addr_alloc_cache(*data->nlc); ++ if( addr_cache == NULL ) { ++ return 0; ++ } + addr = rtnl_addr_alloc(); ++ if( addr == NULL ) { ++ nl_cache_free(addr_cache); ++ return 0; ++ } + rtnl_addr_set_ifindex(addr, ethinf->index); + + /* Make sure we don't have any old IPv6 addresses saved */ +@@ -409,7 +422,9 @@ + + /* No earlier connections exists, establish a new one */ + *data->nlc = nl_handle_alloc(); +- nl_connect(*data->nlc, NETLINK_ROUTE); ++ if( nl_connect(*data->nlc, NETLINK_ROUTE) != 0 ) { ++ return 0; ++ } + if( (*data->nlc != NULL) ) { + /* Force O_CLOEXEC flag on the NETLINK socket */ + if( fcntl(nl_socket_get_fd(*data->nlc), F_SETFD, FD_CLOEXEC) == -1 ) { diff --git a/SPECS/python-ethtool.spec b/SPECS/python-ethtool.spec index e6e461a..b17391c 100644 --- a/SPECS/python-ethtool.spec +++ b/SPECS/python-ethtool.spec @@ -4,11 +4,13 @@ Summary: Ethernet settings python bindings Name: python-ethtool Version: 0.8 -Release: 2%{?dist} +Release: 5%{?dist} URL: http://git.fedorahosted.org/cgit/python-ethtool.git Source: https://fedorahosted.org/releases/p/y/python-ethtool/python-ethtool-%{version}.tar.bz2 Patch0: python-ethtool-0.6-make-pifconfig-output-all-ipv4-addresses-for-interface.patch Patch1: python-ethtool-0.6-return-ipv6-only-interface-names.patch +# Properly check libnl return codes and don't fall with segfault +Patch2: python-ethtool-0.8-check-libnl-return-codes.patch License: GPLv2 Group: System Environment/Libraries BuildRequires: python-devel libnl-devel asciidoc @@ -26,6 +28,7 @@ PCI locations. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %{__python} setup.py build @@ -56,6 +59,16 @@ rm -rf %{buildroot} %endif %changelog +* Fri Jan 24 2014 Daniel Mach - 0.8-5 +- Mass rebuild 2014-01-24 + +* Mon Jan 13 2014 Bohuslav Kabrda - 0.8-4 +- Properly check libnl return codes, don't segfault. +Resolves: rhbz#1051392 + +* Fri Dec 27 2013 Daniel Mach - 0.8-3 +- Mass rebuild 2013-12-27 + * Thu Nov 07 2013 Bohuslav Kabrda - 0.8-2 - Fixed reporting of more IPv4 addresses per interface Resolves: rhbz#1027685