From 4be52779272698eaf223899b4569e5a23c5bf55e808429c4bb1d951dbe1ca1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 3 Apr 2018 14:56:04 +0000 Subject: [PATCH] Accepting request 593212 from home:vitezslav_cizek:branches:network - Add firewalld service file (bsc#1083705) OBS-URL: https://build.opensuse.org/request/show/593212 OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=123 --- vsftpd.changes | 5 +++++ vsftpd.firewalld | 8 ++++++++ vsftpd.spec | 37 ++++++++++++++++++++++++++++++------- 3 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 vsftpd.firewalld diff --git a/vsftpd.changes b/vsftpd.changes index d217641..347db40 100644 --- a/vsftpd.changes +++ b/vsftpd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 3 11:48:08 UTC 2018 - vcizek@suse.com + +- Add firewalld service file (bsc#1083705) + ------------------------------------------------------------------- Wed Dec 13 09:41:39 UTC 2017 - tchvatal@suse.com diff --git a/vsftpd.firewalld b/vsftpd.firewalld new file mode 100644 index 0000000..c567b35 --- /dev/null +++ b/vsftpd.firewalld @@ -0,0 +1,8 @@ + + + vsftpd ports + vsftpd ports for both active and passive connections + + + + diff --git a/vsftpd.spec b/vsftpd.spec index 3784296..69937b6 100644 --- a/vsftpd.spec +++ b/vsftpd.spec @@ -1,7 +1,7 @@ # # spec file for package vsftpd # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,6 +21,11 @@ %else %global with_systemd 0 %endif +%if 0%{?suse_version} >= 1500 +%define use_firewalld 1 +%else +%define use_firewalld 0 +%endif Name: vsftpd Version: 3.0.3 Release: 0 @@ -38,6 +43,7 @@ Source7: vsftpd.service Source8: vsftpd@.service Source9: %{name}.keyring Source10: vsftpd.socket +Source11: %{name}.firewalld Source1000: https://security.appspot.com/downloads/%{name}-%{version}.tar.gz.asc Patch1: vsftpd-2.0.4-lib64.diff Patch3: vsftpd-2.0.4-xinetd.diff @@ -81,13 +87,15 @@ BuildRequires: libopenssl-devel BuildRequires: pam-devel Requires: logrotate Requires(pre): shadow +Provides: ftp-server +%if %{use_firewalld} +Requires(post): firewall-macros +%endif %if 0%{?suse_version} >= 1330 -Requires(pre): group(nobody) Requires: group(nobody) Requires: user(ftp) +Requires(pre): group(nobody) %endif -Provides: ftp-server -BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with_systemd} BuildRequires: systemd %{?systemd_requires} @@ -164,8 +172,13 @@ install -D -m 0644 %{SOURCE10} %{buildroot}/%{_unitdir}/%{name}.socket install -D -m 755 %{SOURCE3} %{buildroot}%{_initddir}/%{name} ln -sf %{_initddir}/%{name} %{buildroot}/%{_sbindir}/rc%{name} %endif +# install firewall information file +%if %{use_firewalld} +install -D -m 644 %{SOURCE11} %{buildroot}%{_libexecdir}/firewalld/services/%{name}.xml +%else install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} +%endif %pre getent passwd ftpsecure >/dev/null || useradd -r -g nobody -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure @@ -187,6 +200,9 @@ getent passwd ftpsecure >/dev/null || useradd -r -g nobody -s /bin/false -c "Sec %insserv_cleanup %restart_on_update %{name} %endif +%if %{use_firewalld} +%{firewalld_reload} +%endif %postun %if %{with_systemd} @@ -197,7 +213,6 @@ getent passwd ftpsecure >/dev/null || useradd -r -g nobody -s /bin/false -c "Sec %endif %files -%defattr(-,root,root) %if %{with_systemd} %{_unitdir}/%{name}.service %{_unitdir}/%{name}.socket @@ -216,9 +231,17 @@ getent passwd ftpsecure >/dev/null || useradd -r -g nobody -s /bin/false -c "Sec %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_mandir}/man5/%{name}.conf.* %{_mandir}/man8/%{name}.* -%doc BUGS AUDIT Changelog LICENSE README README.security -%doc REWARD SPEED TODO SECURITY TUNING SIZE FAQ EXAMPLE COPYING +%license LICENSE +%doc BUGS AUDIT Changelog README README.security +%license COPYING +%doc REWARD SPEED TODO SECURITY TUNING SIZE FAQ EXAMPLE %doc README.SUSE +%if %{use_firewalld} +%dir %{_libexecdir}/firewalld +%dir %{_libexecdir}/firewalld/services +%{_libexecdir}/firewalld/services/%{name}.xml +%else %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} +%endif %changelog