From b43314b6a50dae3038c098adee746171e8609ed9 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Fri, 20 Aug 2021 14:19:04 +0800 Subject: vsftpd: Upgrade to 3.0.5 Drop 2 seccomp patches as seccomp sandbox policy tweaks in new version [1]. [1] https://security.appspot.com/vsftpd/Changelog.txt Signed-off-by: Mingli Yu Signed-off-by: Khem Raj --- ...box.c-allow-newfstatat-and-pselect6-sysca.patch | 51 --------- ...c-Fix-with-musl-which-does-not-have-utmpx.patch | 26 ----- ...tpd-allow-syscalls-in-the-seccomp-sandbox.patch | 46 -------- .../vsftpd/vsftpd-3.0.3/makefile-destdir.patch | 52 --------- .../vsftpd/vsftpd-3.0.3/makefile-libs.patch | 30 ------ .../vsftpd/vsftpd-3.0.3/makefile-strip.patch | 25 ----- .../vsftpd-3.0.3/nopam-with-tcp_wrappers.patch | 26 ----- .../vsftpd/vsftpd-3.0.3/nopam.patch | 16 --- .../vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch | 89 ---------------- .../vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch | 26 ----- ...c-Fix-with-musl-which-does-not-have-utmpx.patch | 26 +++++ .../vsftpd/vsftpd-3.0.5/makefile-destdir.patch | 52 +++++++++ .../vsftpd/vsftpd-3.0.5/makefile-libs.patch | 30 ++++++ .../vsftpd/vsftpd-3.0.5/makefile-strip.patch | 25 +++++ .../vsftpd-3.0.5/nopam-with-tcp_wrappers.patch | 26 +++++ .../vsftpd/vsftpd-3.0.5/nopam.patch | 16 +++ .../vsftpd/vsftpd-3.0.5/vsftpd-2.1.0-filter.patch | 89 ++++++++++++++++ .../vsftpd-3.0.5/vsftpd-tcp_wrappers-support.patch | 26 +++++ .../recipes-daemons/vsftpd/vsftpd_3.0.3.bb | 116 --------------------- .../recipes-daemons/vsftpd/vsftpd_3.0.5.bb | 113 ++++++++++++++++++++ 20 files changed, 403 insertions(+), 503 deletions(-) delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-seccompsandbox.c-allow-newfstatat-and-pselect6-sysca.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-syscalls-in-the-seccomp-sandbox.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-destdir.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-libs.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-strip.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam-with-tcp_wrappers.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-2.1.0-filter.patch create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-tcp_wrappers-support.patch delete mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb create mode 100644 meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.5.bb (limited to 'meta-networking') diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-seccompsandbox.c-allow-newfstatat-and-pselect6-sysca.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-seccompsandbox.c-allow-newfstatat-and-pselect6-sysca.patch deleted file mode 100644 index 29ce85cc19..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-seccompsandbox.c-allow-newfstatat-and-pselect6-sysca.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 7bc261076ec94efa3197beaca39eba095d162b5e Mon Sep 17 00:00:00 2001 -From: Yi Zhao -Date: Fri, 26 Feb 2021 16:32:27 +0800 -Subject: [PATCH] seccompsandbox.c: allow newfstatat and pselect6 syscalls in - the seccomp sandbox - -Allow newfstatat and pselect6 in the seccomp sanbox for glibc 2.33. - -Fixes the following OOPS error: -root@qemux86-64:~# tnftp 192.168.1.1 -Connected to 192.168.1.1. -220 (vsFTPd 3.0.3) -Name (192.168.1.1:root): anonymous -331 Please specify the password. -Password: -230 Login successful. -Remote system type is UNIX. -Using binary mode to transfer files. -ftp> ls -OOPS: priv_sock_get_cmd - -Upstream-Status: Pending - -Signed-off-by: Yi Zhao ---- - seccompsandbox.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/seccompsandbox.c b/seccompsandbox.c -index 377c50e..f601241 100644 ---- a/seccompsandbox.c -+++ b/seccompsandbox.c -@@ -267,6 +267,7 @@ seccomp_sandbox_setup_data_connections() - 3, IPPROTO_TCP); - allow_nr(__NR_bind); - allow_nr(__NR_select); -+ allow_nr(__NR_pselect6); - if (tunable_port_enable) - { - allow_nr(__NR_connect); -@@ -411,6 +412,7 @@ seccomp_sandbox_setup_postlogin(const struct vsf_session* p_sess) - allow_nr(__NR_getdents); - allow_nr(__NR_getdents64); - allow_nr(__NR_sysinfo); -+ allow_nr(__NR_newfstatat); - /* Misc */ - allow_nr(__NR_umask); - --- -2.17.1 - diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch deleted file mode 100644 index d81c94a4aa..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c5caf52b9ed79da8916ef5722efe6df61a856e2f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 28 Mar 2017 20:09:12 -0700 -Subject: [PATCH] sysdeputil.c: Fix with musl which does not have utmpx - -Signed-off-by: Khem Raj - ---- - sysdeputil.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/sysdeputil.c b/sysdeputil.c -index 06f01f4..a8cff3b 100644 ---- a/sysdeputil.c -+++ b/sysdeputil.c -@@ -58,7 +58,9 @@ - #define VSF_SYSDEP_HAVE_SHADOW - #define VSF_SYSDEP_HAVE_USERSHELL - #define VSF_SYSDEP_HAVE_LIBCAP --#define VSF_SYSDEP_HAVE_UTMPX -+#if defined(__GLIBC__) -+ #define VSF_SYSDEP_HAVE_UTMPX -+#endif - - #define __USE_GNU - #include diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-syscalls-in-the-seccomp-sandbox.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-syscalls-in-the-seccomp-sandbox.patch deleted file mode 100644 index 7573c967fa..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-syscalls-in-the-seccomp-sandbox.patch +++ /dev/null @@ -1,46 +0,0 @@ -From dd353303f62d1dfe32cb000e482616b021708fbe Mon Sep 17 00:00:00 2001 -From: Mingli Yu -Date: Thu, 29 Nov 2018 00:47:34 -0800 -Subject: [PATCH] vsftpd: allow syscalls in the seccomp sandbox - -* Allow sysinfo() and getdents64 in the seccomp - sandbox otherwise comes below OOPS: priv_sock_get_cmd - as the syscall sysinfo() and getdents64 not allowed - -root@qemux86-64:~# tnftp 192.168.1.1 -Connected to 192.168.1.1. -220 (vsFTPd 3.0.3) -Name (192.168.1.1:root): anonymous -331 Please specify the password. -Password: -230 Login successful. -Remote system type is UNIX. -Using binary mode to transfer files. -ftp> prompt -Interactive mode off. -ftp> mget small* -OOPS: priv_sock_get_cmd - -Upstream-Status: Pending - -Signed-off-by: Mingli Yu ---- - seccompsandbox.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/seccompsandbox.c b/seccompsandbox.c -index 2c350a9..377c50e 100644 ---- a/seccompsandbox.c -+++ b/seccompsandbox.c -@@ -409,6 +409,8 @@ seccomp_sandbox_setup_postlogin(const struct vsf_session* p_sess) - allow_nr(__NR_getcwd); - allow_nr(__NR_chdir); - allow_nr(__NR_getdents); -+ allow_nr(__NR_getdents64); -+ allow_nr(__NR_sysinfo); - /* Misc */ - allow_nr(__NR_umask); - --- -2.17.1 - diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch deleted file mode 100644 index 5ad5c14e7a..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch +++ /dev/null @@ -1,52 +0,0 @@ -From bab3f62f1fd5b7c2ab197f4311ad191bf18816b9 Mon Sep 17 00:00:00 2001 -From: Paul Eggleton -Date: Mon, 20 Feb 2012 13:51:49 +0000 -Subject: [PATCH] Use DESTDIR within install to allow installing under a prefix - -Upstream-Status: Pending - -Signed-off-by: Paul Eggleton - ---- - Makefile | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/Makefile b/Makefile -index c63ed1b..9e4f35f 100644 ---- a/Makefile -+++ b/Makefile -@@ -29,21 +29,21 @@ vsftpd: $(OBJS) - $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS) - - install: -- if [ -x /usr/local/sbin ]; then \ -- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ -+ if [ -x ${DESTDIR}/usr/local/sbin ]; then \ -+ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \ - else \ -- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi -- if [ -x /usr/local/man ]; then \ -- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ -- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ -- elif [ -x /usr/share/man ]; then \ -- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ -- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ -+ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi -+ if [ -x ${DESTDIR}/usr/local/man ]; then \ -+ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \ -+ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \ -+ elif [ -x ${DESTDIR}/usr/share/man ]; then \ -+ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \ -+ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \ - else \ -- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ -- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi -- if [ -x /etc/xinetd.d ]; then \ -- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi -+ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \ -+ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi -+ if [ -x ${DESTDIR}/etc/xinetd.d ]; then \ -+ $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi - - clean: - rm -f *.o *.swp vsftpd diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch deleted file mode 100644 index d2e58a3254..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 328799d0cd5c523ad7a814fefec16d8a84aa8010 Mon Sep 17 00:00:00 2001 -From: Paul Eggleton -Date: Tue, 16 Apr 2013 10:53:55 +0000 -Subject: [PATCH] Hardcode LIBS instead of using a script to determine - available libs - -We want to avoid this dynamic detection so we have a deterministic -build. - -Upstream-Status: Inappropriate [config] - -Signed-off-by: Paul Eggleton - ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 9e4f35f..3a5535d 100644 ---- a/Makefile -+++ b/Makefile -@@ -8,7 +8,7 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ - -D_FORTIFY_SOURCE=2 \ - #-pedantic -Wconversion - --LIBS = `./vsf_findlibs.sh` -+LIBS = -lssl -lcrypto -lnsl -lresolv - LINK = -Wl,-s - LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now - diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch deleted file mode 100644 index e596073887..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 261874ea47973ea156141185082252fc92081906 Mon Sep 17 00:00:00 2001 -From: Paul Eggleton -Date: Tue, 16 Apr 2013 10:53:55 +0000 -Subject: [PATCH] Disable stripping at link time - -Upstream-Status: Inappropriate [config] - -Signed-off-by: Paul Eggleton - ---- - Makefile | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 3a5535d..e78019a 100644 ---- a/Makefile -+++ b/Makefile -@@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ - #-pedantic -Wconversion - - LIBS = -lssl -lcrypto -lnsl -lresolv --LINK = -Wl,-s - LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now - - OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch deleted file mode 100644 index a4387c132b..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 71628ddc91b6efb9b922a3fcf8cc18522f5387be Mon Sep 17 00:00:00 2001 -From: "Roy.Li" -Date: Mon, 20 Feb 2012 13:51:49 +0000 -Subject: [PATCH] Disable PAM - -Upstream-Status: Inappropriate [config] - -Signed-off-by: Roy.Li - ---- - builddefs.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/builddefs.h b/builddefs.h -index 0106d1a..f48a568 100644 ---- a/builddefs.h -+++ b/builddefs.h -@@ -2,7 +2,7 @@ - #define VSF_BUILDDEFS_H - - #define VSF_BUILD_TCPWRAPPERS --#define VSF_BUILD_PAM -+#undef VSF_BUILD_PAM - #undef VSF_BUILD_SSL - - #endif /* VSF_BUILDDEFS_H */ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch deleted file mode 100644 index cf0d68e272..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch +++ /dev/null @@ -1,16 +0,0 @@ -Disable PAM - -Upstream-Status: Inappropriate [config] - -diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h ---- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 -+++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 -@@ -2,7 +2,7 @@ - #define VSF_BUILDDEFS_H - - #undef VSF_BUILD_TCPWRAPPERS --#define VSF_BUILD_PAM -+#undef VSF_BUILD_PAM - #undef VSF_BUILD_SSL - - #endif /* VSF_BUILDDEFS_H */ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch deleted file mode 100644 index 590eb58579..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch +++ /dev/null @@ -1,89 +0,0 @@ -From b756444854c5ab3b1284fd7113043fe8860e99ec Mon Sep 17 00:00:00 2001 -From: Roy Li -Date: Fri, 24 Apr 2015 09:36:48 +0800 -Subject: [PATCH] Fix the CVE-2015-1419 - -Upstream-Status: Pending - -Try to fix deny_file parsing to do more what is expected. Taken -from fedora. CVE-2015-1419 - -ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/v/vsftpd-3.0.2-13.fc22.src.rpm - -Signed-off-by: Roy Li - ---- - ls.c | 26 ++++++++++++++++++++++++-- - str.c | 11 +++++++++++ - str.h | 1 + - 3 files changed, 36 insertions(+), 2 deletions(-) - -diff --git a/ls.c b/ls.c -index 7e1376d..e9302dd 100644 ---- a/ls.c -+++ b/ls.c -@@ -246,9 +246,31 @@ vsf_filename_passes_filter(const struct mystr* p_filename_str, - int ret = 0; - char last_token = 0; - int must_match_at_current_pos = 1; -+ -+ - str_copy(&filter_remain_str, p_filter_str); -- str_copy(&name_remain_str, p_filename_str); -- -+ -+ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) { -+ if (str_get_char_at(p_filter_str, 0) == '/') { -+ if (str_get_char_at(p_filename_str, 0) != '/') { -+ str_getcwd (&name_remain_str); -+ -+ if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */ -+ str_append_char (&name_remain_str, '/'); -+ -+ str_append_str (&name_remain_str, p_filename_str); -+ } -+ else -+ str_copy (&name_remain_str, p_filename_str); -+ } else { -+ if (str_get_char_at(p_filter_str, 0) != '{') -+ str_basename (&name_remain_str, p_filename_str); -+ else -+ str_copy (&name_remain_str, p_filename_str); -+ } -+ } else -+ str_copy(&name_remain_str, p_filename_str); -+ - while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX) - { - static struct mystr s_match_needed_str; -diff --git a/str.c b/str.c -index 6596204..ba4b92a 100644 ---- a/str.c -+++ b/str.c -@@ -711,3 +711,14 @@ str_replace_unprintable(struct mystr* p_str, char new_char) - } - } - -+void -+str_basename (struct mystr* d_str, const struct mystr* path) -+{ -+ static struct mystr tmp; -+ -+ str_copy (&tmp, path); -+ str_split_char_reverse(&tmp, d_str, '/'); -+ -+ if (str_isempty(d_str)) -+ str_copy (d_str, path); -+} -diff --git a/str.h b/str.h -index ab0a9a4..3a21b50 100644 ---- a/str.h -+++ b/str.h -@@ -100,6 +100,7 @@ void str_replace_unprintable(struct mystr* p_str, char new_char); - int str_atoi(const struct mystr* p_str); - filesize_t str_a_to_filesize_t(const struct mystr* p_str); - unsigned int str_octal_to_uint(const struct mystr* p_str); -+void str_basename (struct mystr* d_str, const struct mystr* path); - - /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string - * buffer, starting at character position 'p_pos'. The extracted line will diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch deleted file mode 100644 index c558aee0aa..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c026b0c0de4eebb189bc77b2d4c3b9528454ac04 Mon Sep 17 00:00:00 2001 -From: "Roy.Li" -Date: Fri, 19 Jul 2013 10:19:25 +0800 -Subject: [PATCH] Enable tcp_wrapper. - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Roy.Li - ---- - builddefs.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/builddefs.h b/builddefs.h -index e908352..0106d1a 100644 ---- a/builddefs.h -+++ b/builddefs.h -@@ -1,7 +1,7 @@ - #ifndef VSF_BUILDDEFS_H - #define VSF_BUILDDEFS_H - --#undef VSF_BUILD_TCPWRAPPERS -+#define VSF_BUILD_TCPWRAPPERS - #define VSF_BUILD_PAM - #undef VSF_BUILD_SSL - diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch new file mode 100644 index 0000000000..d81c94a4aa --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch @@ -0,0 +1,26 @@ +From c5caf52b9ed79da8916ef5722efe6df61a856e2f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 28 Mar 2017 20:09:12 -0700 +Subject: [PATCH] sysdeputil.c: Fix with musl which does not have utmpx + +Signed-off-by: Khem Raj + +--- + sysdeputil.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sysdeputil.c b/sysdeputil.c +index 06f01f4..a8cff3b 100644 +--- a/sysdeputil.c ++++ b/sysdeputil.c +@@ -58,7 +58,9 @@ + #define VSF_SYSDEP_HAVE_SHADOW + #define VSF_SYSDEP_HAVE_USERSHELL + #define VSF_SYSDEP_HAVE_LIBCAP +-#define VSF_SYSDEP_HAVE_UTMPX ++#if defined(__GLIBC__) ++ #define VSF_SYSDEP_HAVE_UTMPX ++#endif + + #define __USE_GNU + #include diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-destdir.patch new file mode 100644 index 0000000000..5ad5c14e7a --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-destdir.patch @@ -0,0 +1,52 @@ +From bab3f62f1fd5b7c2ab197f4311ad191bf18816b9 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +Date: Mon, 20 Feb 2012 13:51:49 +0000 +Subject: [PATCH] Use DESTDIR within install to allow installing under a prefix + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton + +--- + Makefile | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index c63ed1b..9e4f35f 100644 +--- a/Makefile ++++ b/Makefile +@@ -29,21 +29,21 @@ vsftpd: $(OBJS) + $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS) + + install: +- if [ -x /usr/local/sbin ]; then \ +- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ ++ if [ -x ${DESTDIR}/usr/local/sbin ]; then \ ++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \ + else \ +- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi +- if [ -x /usr/local/man ]; then \ +- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ +- elif [ -x /usr/share/man ]; then \ +- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ ++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi ++ if [ -x ${DESTDIR}/usr/local/man ]; then \ ++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \ ++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \ ++ elif [ -x ${DESTDIR}/usr/share/man ]; then \ ++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \ ++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \ + else \ +- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ +- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi +- if [ -x /etc/xinetd.d ]; then \ +- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi ++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \ ++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi ++ if [ -x ${DESTDIR}/etc/xinetd.d ]; then \ ++ $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi + + clean: + rm -f *.o *.swp vsftpd diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-libs.patch new file mode 100644 index 0000000000..d2e58a3254 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-libs.patch @@ -0,0 +1,30 @@ +From 328799d0cd5c523ad7a814fefec16d8a84aa8010 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +Date: Tue, 16 Apr 2013 10:53:55 +0000 +Subject: [PATCH] Hardcode LIBS instead of using a script to determine + available libs + +We want to avoid this dynamic detection so we have a deterministic +build. + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Paul Eggleton + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 9e4f35f..3a5535d 100644 +--- a/Makefile ++++ b/Makefile +@@ -8,7 +8,7 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ + -D_FORTIFY_SOURCE=2 \ + #-pedantic -Wconversion + +-LIBS = `./vsf_findlibs.sh` ++LIBS = -lssl -lcrypto -lnsl -lresolv + LINK = -Wl,-s + LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now + diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-strip.patch new file mode 100644 index 0000000000..e596073887 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/makefile-strip.patch @@ -0,0 +1,25 @@ +From 261874ea47973ea156141185082252fc92081906 Mon Sep 17 00:00:00 2001 +From: Paul Eggleton +Date: Tue, 16 Apr 2013 10:53:55 +0000 +Subject: [PATCH] Disable stripping at link time + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Paul Eggleton + +--- + Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 3a5535d..e78019a 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ + #-pedantic -Wconversion + + LIBS = -lssl -lcrypto -lnsl -lresolv +-LINK = -Wl,-s + LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now + + OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam-with-tcp_wrappers.patch new file mode 100644 index 0000000000..a4387c132b --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam-with-tcp_wrappers.patch @@ -0,0 +1,26 @@ +From 71628ddc91b6efb9b922a3fcf8cc18522f5387be Mon Sep 17 00:00:00 2001 +From: "Roy.Li" +Date: Mon, 20 Feb 2012 13:51:49 +0000 +Subject: [PATCH] Disable PAM + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Roy.Li + +--- + builddefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/builddefs.h b/builddefs.h +index 0106d1a..f48a568 100644 +--- a/builddefs.h ++++ b/builddefs.h +@@ -2,7 +2,7 @@ + #define VSF_BUILDDEFS_H + + #define VSF_BUILD_TCPWRAPPERS +-#define VSF_BUILD_PAM ++#undef VSF_BUILD_PAM + #undef VSF_BUILD_SSL + + #endif /* VSF_BUILDDEFS_H */ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam.patch new file mode 100644 index 0000000000..cf0d68e272 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/nopam.patch @@ -0,0 +1,16 @@ +Disable PAM + +Upstream-Status: Inappropriate [config] + +diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h +--- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 ++++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 +@@ -2,7 +2,7 @@ + #define VSF_BUILDDEFS_H + + #undef VSF_BUILD_TCPWRAPPERS +-#define VSF_BUILD_PAM ++#undef VSF_BUILD_PAM + #undef VSF_BUILD_SSL + + #endif /* VSF_BUILDDEFS_H */ diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-2.1.0-filter.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-2.1.0-filter.patch new file mode 100644 index 0000000000..590eb58579 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-2.1.0-filter.patch @@ -0,0 +1,89 @@ +From b756444854c5ab3b1284fd7113043fe8860e99ec Mon Sep 17 00:00:00 2001 +From: Roy Li +Date: Fri, 24 Apr 2015 09:36:48 +0800 +Subject: [PATCH] Fix the CVE-2015-1419 + +Upstream-Status: Pending + +Try to fix deny_file parsing to do more what is expected. Taken +from fedora. CVE-2015-1419 + +ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/v/vsftpd-3.0.2-13.fc22.src.rpm + +Signed-off-by: Roy Li + +--- + ls.c | 26 ++++++++++++++++++++++++-- + str.c | 11 +++++++++++ + str.h | 1 + + 3 files changed, 36 insertions(+), 2 deletions(-) + +diff --git a/ls.c b/ls.c +index 7e1376d..e9302dd 100644 +--- a/ls.c ++++ b/ls.c +@@ -246,9 +246,31 @@ vsf_filename_passes_filter(const struct mystr* p_filename_str, + int ret = 0; + char last_token = 0; + int must_match_at_current_pos = 1; ++ ++ + str_copy(&filter_remain_str, p_filter_str); +- str_copy(&name_remain_str, p_filename_str); +- ++ ++ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) { ++ if (str_get_char_at(p_filter_str, 0) == '/') { ++ if (str_get_char_at(p_filename_str, 0) != '/') { ++ str_getcwd (&name_remain_str); ++ ++ if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */ ++ str_append_char (&name_remain_str, '/'); ++ ++ str_append_str (&name_remain_str, p_filename_str); ++ } ++ else ++ str_copy (&name_remain_str, p_filename_str); ++ } else { ++ if (str_get_char_at(p_filter_str, 0) != '{') ++ str_basename (&name_remain_str, p_filename_str); ++ else ++ str_copy (&name_remain_str, p_filename_str); ++ } ++ } else ++ str_copy(&name_remain_str, p_filename_str); ++ + while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX) + { + static struct mystr s_match_needed_str; +diff --git a/str.c b/str.c +index 6596204..ba4b92a 100644 +--- a/str.c ++++ b/str.c +@@ -711,3 +711,14 @@ str_replace_unprintable(struct mystr* p_str, char new_char) + } + } + ++void ++str_basename (struct mystr* d_str, const struct mystr* path) ++{ ++ static struct mystr tmp; ++ ++ str_copy (&tmp, path); ++ str_split_char_reverse(&tmp, d_str, '/'); ++ ++ if (str_isempty(d_str)) ++ str_copy (d_str, path); ++} +diff --git a/str.h b/str.h +index ab0a9a4..3a21b50 100644 +--- a/str.h ++++ b/str.h +@@ -100,6 +100,7 @@ void str_replace_unprintable(struct mystr* p_str, char new_char); + int str_atoi(const struct mystr* p_str); + filesize_t str_a_to_filesize_t(const struct mystr* p_str); + unsigned int str_octal_to_uint(const struct mystr* p_str); ++void str_basename (struct mystr* d_str, const struct mystr* path); + + /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string + * buffer, starting at character position 'p_pos'. The extracted line will diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-tcp_wrappers-support.patch new file mode 100644 index 0000000000..c558aee0aa --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.5/vsftpd-tcp_wrappers-support.patch @@ -0,0 +1,26 @@ +From c026b0c0de4eebb189bc77b2d4c3b9528454ac04 Mon Sep 17 00:00:00 2001 +From: "Roy.Li" +Date: Fri, 19 Jul 2013 10:19:25 +0800 +Subject: [PATCH] Enable tcp_wrapper. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Roy.Li + +--- + builddefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/builddefs.h b/builddefs.h +index e908352..0106d1a 100644 +--- a/builddefs.h ++++ b/builddefs.h +@@ -1,7 +1,7 @@ + #ifndef VSF_BUILDDEFS_H + #define VSF_BUILDDEFS_H + +-#undef VSF_BUILD_TCPWRAPPERS ++#define VSF_BUILD_TCPWRAPPERS + #define VSF_BUILD_PAM + #undef VSF_BUILD_SSL + diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb deleted file mode 100644 index cf3d7fc966..0000000000 --- a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb +++ /dev/null @@ -1,116 +0,0 @@ -SUMMARY = "Very Secure FTP server" -HOMEPAGE = "https://security.appspot.com/vsftpd.html" -SECTION = "net" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" - -DEPENDS = "libcap openssl" - -SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ - file://makefile-destdir.patch \ - file://makefile-libs.patch \ - file://makefile-strip.patch \ - file://init \ - file://vsftpd.conf \ - file://vsftpd.user_list \ - file://vsftpd.ftpusers \ - file://change-secure_chroot_dir.patch \ - file://volatiles.99_vsftpd \ - file://vsftpd.service \ - file://vsftpd-2.1.0-filter.patch \ - file://0001-vsftpd-allow-syscalls-in-the-seccomp-sandbox.patch \ - ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \ - file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \ - file://0001-seccompsandbox.c-allow-newfstatat-and-pselect6-sysca.patch \ - " - -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/v/vsftpd/" -UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)\.orig\.tar" - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ - file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ - file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" -SRC_URI[md5sum] = "da119d084bd3f98664636ea05b5bb398" -SRC_URI[sha256sum] = "9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7" - - -PACKAGECONFIG ??= "tcp-wrappers" -PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" - -DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" -RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" -PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" -WRAPLIB = "${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '-lwrap', '', d)}" -NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" - -inherit update-rc.d useradd systemd - -CONFFILES:${PN} = "${sysconfdir}/vsftpd.conf" -LDFLAGS:append =" -lcrypt -lcap" -CFLAGS:append:libc-musl = " -D_GNU_SOURCE -include fcntl.h" -EXTRA_OEMAKE = "-e MAKEFLAGS=" - -do_configure() { - # Fix hardcoded /usr, /etc, /var mess. - cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ - |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new - mv tunables.c.new tunables.c -} - -do_compile() { - oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} ${WRAPLIB}" -} - -do_install() { - install -d ${D}${sbindir} - install -d ${D}${mandir}/man8 - install -d ${D}${mandir}/man5 - oe_runmake 'DESTDIR=${D}' install - install -d ${D}${sysconfdir} - install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf - install -d ${D}${sysconfdir}/init.d/ - install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd - install -d ${D}/${sysconfdir}/default/volatiles - install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd - - install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ - install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ - if ! test -z "${PAMLIB}" ; then - install -d ${D}${sysconfdir}/pam.d/ - cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd - sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd - sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd - fi - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d - echo "d /var/run/vsftpd/empty 0755 root root -" \ - > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf - fi - - # Install systemd unit files - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system - sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service -} - -INITSCRIPT_PACKAGES = "${PN}" -INITSCRIPT_NAME:${PN} = "vsftpd" -INITSCRIPT_PARAMS:${PN} = "defaults 80" - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM:${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ - --shell /bin/false ftp " -GROUPADD_PARAM:${PN} = "-r ftp" - -SYSTEMD_SERVICE:${PN} = "vsftpd.service" - -pkg_postinst:${PN}() { - if [ -z "$D" ]; then - if type systemd-tmpfiles >/dev/null; then - systemd-tmpfiles --create - elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then - ${sysconfdir}/init.d/populate-volatile.sh update - fi - fi -} diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.5.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.5.bb new file mode 100644 index 0000000000..08238c1a3c --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.5.bb @@ -0,0 +1,113 @@ +SUMMARY = "Very Secure FTP server" +HOMEPAGE = "https://security.appspot.com/vsftpd.html" +SECTION = "net" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" + +DEPENDS = "libcap openssl" + +SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ + file://makefile-destdir.patch \ + file://makefile-libs.patch \ + file://makefile-strip.patch \ + file://init \ + file://vsftpd.conf \ + file://vsftpd.user_list \ + file://vsftpd.ftpusers \ + file://change-secure_chroot_dir.patch \ + file://volatiles.99_vsftpd \ + file://vsftpd.service \ + file://vsftpd-2.1.0-filter.patch \ + ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \ + file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \ + " + +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/v/vsftpd/" +UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)\.orig\.tar" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ + file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ + file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" +SRC_URI[sha256sum] = "26b602ae454b0ba6d99ef44a09b6b9e0dfa7f67228106736df1f278c70bc91d3" + + +PACKAGECONFIG ??= "tcp-wrappers" +PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" + +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" +RDEPENDS:${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" +PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" +WRAPLIB = "${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '-lwrap', '', d)}" +NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" + +inherit update-rc.d useradd systemd + +CONFFILES:${PN} = "${sysconfdir}/vsftpd.conf" +LDFLAGS:append =" -lcrypt -lcap" +CFLAGS:append:libc-musl = " -D_GNU_SOURCE -include fcntl.h" +EXTRA_OEMAKE = "-e MAKEFLAGS=" + +do_configure() { + # Fix hardcoded /usr, /etc, /var mess. + cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ + |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new + mv tunables.c.new tunables.c +} + +do_compile() { + oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} ${WRAPLIB}" +} + +do_install() { + install -d ${D}${sbindir} + install -d ${D}${mandir}/man8 + install -d ${D}${mandir}/man5 + oe_runmake 'DESTDIR=${D}' install + install -d ${D}${sysconfdir} + install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf + install -d ${D}${sysconfdir}/init.d/ + install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd + install -d ${D}/${sysconfdir}/default/volatiles + install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd + + install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ + install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ + if ! test -z "${PAMLIB}" ; then + install -d ${D}${sysconfdir}/pam.d/ + cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd + sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd + sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd + fi + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "d /var/run/vsftpd/empty 0755 root root -" \ + > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf + fi + + # Install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system + sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service +} + +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME:${PN} = "vsftpd" +INITSCRIPT_PARAMS:${PN} = "defaults 80" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ + --shell /bin/false ftp " +GROUPADD_PARAM:${PN} = "-r ftp" + +SYSTEMD_SERVICE:${PN} = "vsftpd.service" + +pkg_postinst:${PN}() { + if [ -z "$D" ]; then + if type systemd-tmpfiles >/dev/null; then + systemd-tmpfiles --create + elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then + ${sysconfdir}/init.d/populate-volatile.sh update + fi + fi +} -- cgit 1.2.3-korg