From 05ca8372d08f4b613cb8b5617d8c0988e6daac1c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 7 Jul 2024 17:28:19 +0000 Subject: [PATCH] Revert "Drop vsftpd which isn't actively maintained any more" This reverts commit 56720befc7e6beafc5e200c0a777422bdbdccc1a. Signed-off-by: Michael Tremer --- config/backup/includes/vsftpd | 2 + config/etc/group | 1 + config/etc/passwd | 1 + config/rootfiles/packages/vsftpd | 13 ++++ config/vsftpd/vsftpd.conf | 51 ++++++++++++++++ config/vsftpd/vsftpd.user_list | 0 lfs/vsftpd | 100 +++++++++++++++++++++++++++++++ make.sh | 1 + src/initscripts/packages/vsftpd | 45 ++++++++++++++ src/paks/vsftpd/install.sh | 29 +++++++++ src/paks/vsftpd/uninstall.sh | 41 +++++++++++++ src/paks/vsftpd/update.sh | 28 +++++++++ 12 files changed, 312 insertions(+) create mode 100644 config/backup/includes/vsftpd create mode 100644 config/rootfiles/packages/vsftpd create mode 100644 config/vsftpd/vsftpd.conf create mode 100644 config/vsftpd/vsftpd.user_list create mode 100644 lfs/vsftpd create mode 100644 src/initscripts/packages/vsftpd create mode 100644 src/paks/vsftpd/install.sh create mode 100644 src/paks/vsftpd/uninstall.sh create mode 100644 src/paks/vsftpd/update.sh diff --git a/config/backup/includes/vsftpd b/config/backup/includes/vsftpd new file mode 100644 index 0000000000..876ea300c4 --- /dev/null +++ b/config/backup/includes/vsftpd @@ -0,0 +1,2 @@ +/etc/vsftpd.conf +/etc/vsftpd.user_list diff --git a/config/etc/group b/config/etc/group index f1767b30cd..5ae90d8513 100644 --- a/config/etc/group +++ b/config/etc/group @@ -18,6 +18,7 @@ squid:x:23:nobody ntp:x:38: dip:x:40: ftp:x:45: +vsftpd:x:47: rsyncd:x:48: stunnel:x:51: dhcpcd:x:52: diff --git a/config/etc/passwd b/config/etc/passwd index cb04280851..e6326992ca 100644 --- a/config/etc/passwd +++ b/config/etc/passwd @@ -5,6 +5,7 @@ mail:x:8:12:mail:/var/spool/mail:/bin/false squid:x:23:23:ftp:/var/spool/squid:/bin/false ntp:x:38:38::/etc/ntp:/bin/false ftp:x:45:45:anonymous_user:/home/ftp:/bin/false +vsftpd:x:47:47:vsftpd User:/home/ftp:/bin/false rsyncd:x:48:48:rsyncd Daemon:/home/rsync:/bin/false stunnel:x:51:51:stunnel Daemon:/var/lib/stunnel:/bin/false dhcpcd:x:52:52:dhcpcd privsep user:/run/dhcpcd/chroot:/bin/false diff --git a/config/rootfiles/packages/vsftpd b/config/rootfiles/packages/vsftpd new file mode 100644 index 0000000000..e0f59c3dac --- /dev/null +++ b/config/rootfiles/packages/vsftpd @@ -0,0 +1,13 @@ +var/ipfire/backup/addons/includes/vsftpd +etc/rc.d/init.d/vsftpd +etc/rc.d/rc0.d/K35vsftpd +etc/rc.d/rc6.d/K35vsftpd +etc/rc.d/rc3.d/S65vsftpd +etc/vsftpd.conf +etc/vsftpd.user_list +home/ftp +usr/sbin/vsftpd +#usr/share/man/man5/vsftpd.conf.5 +#usr/share/man/man8/vsftpd.8 +var/ftp +var/ftp/empty diff --git a/config/vsftpd/vsftpd.conf b/config/vsftpd/vsftpd.conf new file mode 100644 index 0000000000..e7206ee80a --- /dev/null +++ b/config/vsftpd/vsftpd.conf @@ -0,0 +1,51 @@ +# Default config for vsftpd on ipfire +background=YES +listen=YES +# +nopriv_user=vsftpd +# +local_enable=YES +write_enable=YES +# +local_umask=022 +# +#anonymous_enable=YES +#anon_upload_enable=YES +#anon_mkdir_write_enable=YES +# +dirmessage_enable=YES +# +xferlog_enable=YES +xferlog_file=/var/log/vsftpd.log +xferlog_std_format=YES +# +connect_from_port_20=YES +# +#chown_uploads=YES +#chown_username=whoever +# +idle_session_timeout=600 +data_connection_timeout=120 +# +#async_abor_enable=YES +#ascii_upload_enable=YES +#ascii_download_enable=YES +# +ftpd_banner=Welcome to IPFire FTP service. +# +chroot_local_user=YES +#chroot_list_enable=YES +secure_chroot_dir=/var/ftp/empty +# +ls_recurse_enable=YES +require_ssl_reuse=NO +# +#ssl_enable=YES +#force_local_data_ssl=NO +#force_local_logins_ssl=NO +#rsa_cert_file=/etc/vsftpd.pem +# +userlist_deny=NO +userlist_enable=YES +userlist_file=/etc/vsftpd.user_list +# diff --git a/config/vsftpd/vsftpd.user_list b/config/vsftpd/vsftpd.user_list new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lfs/vsftpd b/lfs/vsftpd new file mode 100644 index 0000000000..07dda30985 --- /dev/null +++ b/lfs/vsftpd @@ -0,0 +1,100 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2009 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 2.3.4 + +THISAPP = vsftpd-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = vsftpd +PAK_VER = 8 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 2ea5d19978710527bb7444d93b67767a + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + $(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && echo "#define VSF_BUILD_SSL" >>builddefs.h + cd $(DIR_APP) && install -v -d -m 0755 /var/ftp/empty + cd $(DIR_APP) && install -v -d -m 0755 /home/ftp + chown vsftpd.vsftpd /home/ftp + cd $(DIR_APP) && make + cd $(DIR_APP) && install -v -m 755 vsftpd /usr/sbin/vsftpd + cd $(DIR_APP) && install -v -m 644 vsftpd.8 /usr/share/man/man8 + cd $(DIR_APP) && install -v -m 644 vsftpd.conf.5 /usr/share/man/man5 + cd $(DIR_APP) && install -v -m 644 $(DIR_SRC)/config/vsftpd/vsftpd.conf /etc + cd $(DIR_APP) && install -v -m 644 $(DIR_SRC)/config/vsftpd/vsftpd.user_list /etc + + #install initscripts + $(call INSTALL_INITSCRIPT,vsftpd) + + ln -sf ../init.d/vsftpd /etc/rc.d/rc3.d/S65vsftpd + ln -sf ../init.d/vsftpd /etc/rc.d/rc0.d/K35vsftpd + ln -sf ../init.d/vsftpd /etc/rc.d/rc6.d/K35vsftpd + install -v -m 644 $(DIR_SRC)/config/backup/includes/vsftpd \ + /var/ipfire/backup/addons/includes/vsftpd + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 9bbbeb0f1d..c80868bf53 100755 --- a/make.sh +++ b/make.sh @@ -1473,6 +1473,7 @@ buildipfire() { lfsmake2 etherwake lfsmake2 bwm-ng lfsmake2 sysstat + lfsmake2 vsftpd lfsmake2 strongswan lfsmake2 rng-tools lfsmake2 lsof diff --git a/src/initscripts/packages/vsftpd b/src/initscripts/packages/vsftpd new file mode 100644 index 0000000000..62d838ade4 --- /dev/null +++ b/src/initscripts/packages/vsftpd @@ -0,0 +1,45 @@ +#!/bin/sh +# Begin $rc_base/init.d/vsftpd + +# Based on sysklogd script from LFS-3.1 and earlier. +# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org + +#$LastChangedBy: bdubbs $ +#$Date: 2005-08-01 14:29:19 -0500 (Mon, 01 Aug 2005) $ + +. /etc/sysconfig/rc +. $rc_functions + +case "$1" in + start) + boot_mesg "Starting vsFTPD Server..." + loadproc /usr/sbin/vsftpd + ;; + + stop) + boot_mesg "Stopping vsFTPD Server..." + killproc /usr/sbin/vsftpd + ;; + + reload) + boot_mesg "Reloading vsFTPD Server..." + reloadproc /usr/sbin/vsftpd + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + status) + statusproc /usr/sbin/vsftpd + ;; + + *) + echo "Usage: $0 {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/vsftpd diff --git a/src/paks/vsftpd/install.sh b/src/paks/vsftpd/install.sh new file mode 100644 index 0000000000..fb865dd038 --- /dev/null +++ b/src/paks/vsftpd/install.sh @@ -0,0 +1,29 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +# Disable vsftpd by default due to lack of configuration file +mkdir -p /etc/rc.d/rc3.d/off +mv -f /etc/rc.d/rc3.d/S??${NAME} /etc/rc.d/rc3.d/off diff --git a/src/paks/vsftpd/uninstall.sh b/src/paks/vsftpd/uninstall.sh new file mode 100644 index 0000000000..63205f8436 --- /dev/null +++ b/src/paks/vsftpd/uninstall.sh @@ -0,0 +1,41 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +stop_service ${NAME} + +#Create a backupinclude if it not exist +if [ ! -e "/var/ipfire/backup/addons/includes/vsftpd" ]; then + echo /etc/vsftpd.conf > /var/ipfire/backup/addons/includes/vsftpd + echo /etc/vsftpd.user_list >> /var/ipfire/backup/addons/includes/vsftpd +fi +#Fix wrong backupinclude +sed -i 's|^etc|/etc|g' /var/ipfire/backup/addons/includes/vsftpd +make_backup ${NAME} +#Remove userdate from rootfile +cat /opt/pakfire/db/rootfiles/vsftpd | \ + grep -v "home/ftp" | \ + grep -v "var/ftp" > /opt/pakfire/db/rootfiles/vsftpd.tmp +mv /opt/pakfire/db/rootfiles/vsftpd.tmp /opt/pakfire/db/rootfiles/vsftpd + +remove_files diff --git a/src/paks/vsftpd/update.sh b/src/paks/vsftpd/update.sh new file mode 100644 index 0000000000..e42310f205 --- /dev/null +++ b/src/paks/vsftpd/update.sh @@ -0,0 +1,28 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +./uninstall.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME} -- 2.39.5