forked from pool/atftp
Marcus Meissner
003aa9ceb8
- Update to version 0.7.5 [bsc#1190522, CVE-2021-41054] * text files: mark/convert all textfiles to UTF-8 * fix some compiler warnings * fix buffer overflow in atftpd (CVE-2021-41054) * test.sh: check for root no longer necessary * tftpd.c: Only drop privs if requested or running as root + check for failure * fix invalid read of 1 byte in tftp_send_request. * Check return value of fseek(), abort if != 0 * options.c: Proper fix for the read-past-end-of-array * configure.ac: Add -std=gnu89 if gcc/clang is detected * tftpd.c: Fix memleak if thread spawning fails * atftp: Check return value of fgets, buffer might be uninitialized on NULL * Fix check for argz support (HAVE_ARGZ -> HAVE_ARGZ_H) * replace LICENSE with current version * Remove patches fixed upstream: - atftp-0.7-sorcerers_apprentice.patch - atftp-0.7-server_receive_race.patch - atftp-0.7-ack_heuristic.patch * Rebase patches: - atftp-drop_privileges_non-daemon.patch - atftp-0.7-default_dir_man.patch - atftp-0.7-default_user_man.patch OBS-URL: https://build.opensuse.org/request/show/919255 OBS-URL: https://build.opensuse.org/package/show/network/atftp?expand=0&rev=51
122 lines
3.9 KiB
RPMSpec
122 lines
3.9 KiB
RPMSpec
#
|
|
# spec file for package atftp
|
|
#
|
|
# Copyright (c) 2021 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
#
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
%if ! %{defined _fillupdir}
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
%endif
|
|
|
|
Name: atftp
|
|
Version: 0.7.5
|
|
Release: 0
|
|
Summary: Advanced TFTP Server and Client
|
|
License: GPL-2.0-or-later
|
|
Group: System/Daemons
|
|
URL: https://sourceforge.net/projects/atftp/
|
|
Source: https://sourceforge.net/projects/atftp/files/%{name}-%{version}.tar.gz
|
|
Source2: atftpd.sysconfig
|
|
Source3: atftpd.logrotate
|
|
Source5: atftpd.service
|
|
Source6: atftpd.socket
|
|
Patch1: atftp-0.7-default_user_man.patch
|
|
# PATCH-FIX-SUSE update default directory in man (bnc#507011)
|
|
Patch2: atftp-0.7-default_dir_man.patch
|
|
Patch3: atftp-drop_privileges_non-daemon.patch
|
|
BuildRequires: autoconf
|
|
BuildRequires: automake
|
|
BuildRequires: pcre-devel
|
|
BuildRequires: readline-devel
|
|
BuildRequires: tcpd-devel
|
|
Requires(pre): %fillup_prereq
|
|
Requires(pre): user(tftp) group(tftp)
|
|
Recommends: logrotate
|
|
Conflicts: tftp
|
|
Provides: tftp(client)
|
|
Provides: tftp(server)
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
%description
|
|
atftp stands for Advanced Trivial File Transfer Protocol. It is called
|
|
"advanced", in contrast to others TFTP servers, for two reasons. First,
|
|
it is intended to be fully compliant with all related RFCs. This
|
|
includes RFC1350, RFC2090, RFC2347, RFC2348, and RFC2349. Second, atftp
|
|
is intended for serving boot files to large clusters. It is
|
|
multithreaded and will eventually support multicast, allowing faster
|
|
boot of hundreds of machines simultaneously.
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%build
|
|
autoreconf -fi
|
|
CFLAGS="%optflags -fgnu89-inline"
|
|
%configure
|
|
make %{?_smp_mflags}
|
|
|
|
%install
|
|
%make_install
|
|
# SuSE rc
|
|
install -D -m 0644 %{SOURCE5} %{buildroot}/%{_unitdir}/atftpd.service
|
|
install -D -m 0644 %{SOURCE6} %{buildroot}/%{_unitdir}/atftpd.socket
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcatftpd
|
|
install -D -m 0644 %{SOURCE2} %{buildroot}%{_fillupdir}/sysconfig.atftpd
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
install -d -m 0755 %{buildroot}/srv/tftpboot
|
|
install -d -m 0750 %{buildroot}%{_localstatedir}/log/atftpd
|
|
|
|
%pre
|
|
# fix sysconfig to get new defaults on Update
|
|
if [ -f %{_sysconfdir}/sysconfig/atftpd ]; then
|
|
sed -i -e "s@^\(ATFTPD_OPTIONS=\"--daemon \"\)@#\1@" %{_sysconfdir}/sysconfig/atftpd
|
|
sed -i -e "s@^\(ATFTPD_DIRECTORY=\"/tftpboot\"\)@#\1@" %{_sysconfdir}/sysconfig/atftpd
|
|
fi
|
|
%service_add_pre atftpd.service atftpd.socket
|
|
|
|
%preun
|
|
%service_del_preun atftpd.service atftpd.socket
|
|
|
|
%post
|
|
%service_add_post atftpd.service atftpd.socket
|
|
%{fillup_only -n atftpd}
|
|
|
|
%postun
|
|
%service_del_postun atftpd.service atftpd.socket
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%license LICENSE
|
|
%doc BUGS FAQ README README.MCAST README.PCRE TODO
|
|
%{_bindir}/atftp
|
|
%{_sbindir}/atftpd
|
|
%{_sbindir}/in.tftpd
|
|
%{_sbindir}/rcatftpd
|
|
%{_unitdir}/atftpd.service
|
|
%{_unitdir}/atftpd.socket
|
|
%config %{_sysconfdir}/logrotate.d/%{name}
|
|
%{_fillupdir}/sysconfig.atftpd
|
|
%{_mandir}/man1/atftp.1.gz
|
|
%{_mandir}/man8/atftpd.8.gz
|
|
%{_mandir}/man8/in.tftpd.8.gz
|
|
|
|
%dir %attr(0755,tftp,tftp) /srv/tftpboot
|
|
%dir %attr(0750,tftp,tftp) %{_localstatedir}/log/atftpd/
|
|
|
|
%changelog
|