5692fb
Name:			openslp
5692fb
Version:		2.0.0
62b8ef
Release:		8%{?dist}
5692fb
Epoch:			1
5692fb
Summary:		Open implementation of Service Location Protocol V2
5692fb
5692fb
Group:			System Environment/Libraries
5692fb
License:		BSD
5692fb
URL:			http://www.openslp.org
5692fb
Source0:		http://downloads.sourceforge.net/openslp/%{name}-%{version}.tar.gz
5692fb
# Source1,2: simple man pages (slightly modified help2man output)
5692fb
Source1:		slpd.8.gz
5692fb
Source2:		slptool.1.gz
5692fb
# Source3: service file
5692fb
Source3:		slpd.service
5692fb
BuildRoot:		%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
5692fb
5692fb
# Patch0: creates script from upstream init script that sets multicast
5692fb
#     prior to the start of the service
5692fb
Patch0:			openslp-2.0.0-multicast-set.patch
5692fb
# Patch1: fixes buffer overflow, rhbz#1181474
5692fb
Patch1:			openslp-2.0.0-fortify-source-buffer-overflow.patch
5692fb
# Patch2: fixes heap memory corruption in slpd/slpd_process.c, which allows
5692fb
#   denial of service or potentially code execution,
5692fb
#   backported form upstream, CVE-2017-17833
5692fb
Patch2:  openslp-2.0.0-cve-2017-17833.patch
62b8ef
# Patch3: fixes a heap-based buffer overflow vulnerability
62b8ef
#   leading to remote code execution
62b8ef
Patch3:  openslp-2.0.0-cve-2019-5544.patch
5692fb
5692fb
BuildRequires:		bison flex openssl-devel doxygen
5692fb
BuildRequires:		automake libtool
5692fb
BuildRequires:		systemd-units
5692fb
5692fb
%description
5692fb
Service Location Protocol is an IETF standards track protocol that
5692fb
provides a framework to allow networking applications to discover the
5692fb
existence, location, and configuration of networked services in
5692fb
enterprise networks.
5692fb
5692fb
OpenSLP is an open source implementation of the SLPv2 protocol as defined
5692fb
by RFC 2608 and RFC 2614.
5692fb
5692fb
%package server
5692fb
Summary:		OpenSLP server daemon
5692fb
Group:			System Environment/Daemons
5692fb
Requires:		%{name} = %{epoch}:%{version}-%{release}
5692fb
Requires:		/bin/netstat
5692fb
Requires(preun):	chkconfig, /sbin/service
5692fb
Requires(post):		chkconfig
5692fb
Requires(postun):	/sbin/service
5692fb
5692fb
%description server
5692fb
Service Location Protocol is an IETF standards track protocol that
5692fb
provides a framework that allows networking applications to discover
5692fb
the existence, location, and configuration of networked services in
5692fb
enterprise networks.
5692fb
5692fb
This package contains the SLP server. Every system, which provides any
5692fb
services that should be used via an SLP client must run this server and
5692fb
register the service.
5692fb
5692fb
%package devel
5692fb
Summary:		OpenSLP headers and libraries
5692fb
Group:			Development/Libraries
5692fb
Requires:		%{name} = %{epoch}:%{version}-%{release}
5692fb
5692fb
%description devel
5692fb
Service Location Protocol is an IETF standards track protocol that
5692fb
provides a framework that allows networking applications to discover
5692fb
the existence, location, and configuration of networked services in
5692fb
enterprise networks.
5692fb
5692fb
This package contains header and library files to compile applications
5692fb
with SLP support. It also contains developer documentation to develop
5692fb
such applications.
5692fb
5692fb
%prep
5692fb
%setup -q
5692fb
%patch0 -p1 -b .multicast-set
5692fb
%patch1 -p1 -b .fortify-source-buffer-overflow
5692fb
%patch2 -p1 -b .cve-2017-17833
62b8ef
%patch3 -p1 -b .cve-2019-5544
5692fb
5692fb
5692fb
%build
5692fb
export CFLAGS="-fPIC -fno-strict-aliasing -fPIE -DPIE $RPM_OPT_FLAGS"
5692fb
export LDFLAGS="-pie -Wl,-z,now"
5692fb
%configure \
5692fb
  --prefix=%{_prefix} \
5692fb
  --libdir=%{_libdir} \
5692fb
  --sysconfdir=%{_sysconfdir} \
5692fb
  --enable-async-api \
5692fb
  --disable-rpath \
5692fb
  --enable-slpv2-security \
5692fb
  --localstatedir=/var
5692fb
make %{?_smp_mflags}
5692fb
5692fb
5692fb
%install
5692fb
rm -rf $RPM_BUILD_ROOT
5692fb
make install DESTDIR=$RPM_BUILD_ROOT
5692fb
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}/slp.reg.d
5692fb
# install script that sets multicast
5692fb
mkdir -p ${RPM_BUILD_ROOT}/usr/lib/%{name}-server
5692fb
install -m 0755 etc/slpd.all_init ${RPM_BUILD_ROOT}/usr/lib/%{name}-server/slp-multicast-set.sh
5692fb
# install service file
5692fb
mkdir -p ${RPM_BUILD_ROOT}/%{_unitdir}
5692fb
install -p -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}/%{_unitdir}/slpd.service
5692fb
# install man page
5692fb
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man8/
5692fb
mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man1/
5692fb
cp %SOURCE1 ${RPM_BUILD_ROOT}/%{_mandir}/man8/
5692fb
cp %SOURCE2 ${RPM_BUILD_ROOT}/%{_mandir}/man1/
5692fb
rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.a
5692fb
rm -f  $RPM_BUILD_ROOT%{_libdir}/lib*.la
5692fb
5692fb
5692fb
%clean
5692fb
rm -rf $RPM_BUILD_ROOT
5692fb
5692fb
5692fb
%post -p /sbin/ldconfig
5692fb
5692fb
%postun -p /sbin/ldconfig
5692fb
5692fb
%post server
5692fb
%systemd_post slpd.service
5692fb
5692fb
%postun server
5692fb
%systemd_postun_with_restart slpd.service
5692fb
5692fb
%preun server
5692fb
%systemd_preun slpd.service
5692fb
5692fb
5692fb
%files
5692fb
%defattr(-,root,root,-)
5692fb
%doc AUTHORS COPYING ChangeLog NEWS README
5692fb
%doc doc/doc/*
5692fb
%{_libdir}/libslp.so.*
5692fb
%{_bindir}/slptool
5692fb
%config(noreplace) %{_sysconfdir}/slp.conf
5692fb
%config(noreplace) %{_sysconfdir}/slp.spi
5692fb
%{_mandir}/man1/*
5692fb
5692fb
%files server
5692fb
%defattr(-,root,root,-)
5692fb
%dir /%{_sysconfdir}/slp.reg.d/
5692fb
%dir /usr/lib/%{name}-server
5692fb
/usr/lib/%{name}-server/slp-multicast-set.sh
5692fb
%{_sbindir}/slpd
5692fb
%config(noreplace) %{_sysconfdir}/slp.reg
5692fb
%{_unitdir}/slpd.service
5692fb
%{_mandir}/man8/*
5692fb
5692fb
%files devel
5692fb
%defattr(-,root,root,-)
5692fb
%{_includedir}/slp.h
5692fb
%{_libdir}/libslp.so
5692fb
5692fb
5692fb
%changelog
62b8ef
* Tue Dec 10 2019 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-8
62b8ef
- Fix a heap-based buffer overflow vulnerability leading to
62b8ef
  remote code execution, CVE-2019-5544
62b8ef
  Resolves: #1781701
62b8ef
5692fb
* Tue Jul 03 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-7
5692fb
- Fix possible heap memory corruption, CVE-2017-17833
62b8ef
  Resolves: #1597725
5692fb
5692fb
* Tue Jun 28 2016 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-6
5692fb
- Fix buffer overflow termination of slpd with -D_FORTIFY_SOURCE=2
5692fb
  Resolves: #1181474
5692fb
5692fb
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1:2.0.0-5
5692fb
- Mass rebuild 2014-01-24
5692fb
5692fb
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1:2.0.0-4
5692fb
- Mass rebuild 2013-12-27
5692fb
5692fb
* Wed Oct 16 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-3
5692fb
- Fix full relro
5692fb
  Resolves: #881226
5692fb
5692fb
* Mon Jul 15 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-2
5692fb
- Fix -devel requires
5692fb
5692fb
* Tue Jun 25 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 1:2.0.0-1
5692fb
- Update to openslp-2.0.0
5692fb
- Add systemd support
5692fb
- Require /bin/netstat
5692fb
5692fb
* Wed May 15 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.3.beta2
5692fb
- Add man pages for slptool and slpd
5692fb
- Add CFLAGS and LDFLAGS for full relro
5692fb
5692fb
* Thu Jul 28 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.2.beta2
5692fb
- Build with -fno-strict-aliasing
5692fb
5692fb
* Wed Jul 20 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0-0.1.beta2
5692fb
- Fix N-V-R
5692fb
5692fb
* Wed Jul 20 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.beta2-2
5692fb
- Build
5692fb
5692fb
* Tue Jul 19 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.beta2-1
5692fb
- Initial support