From ffdb3d153b09424bdf4963023eeb68ae8d3f261132638d260bb82e1c3c930d0b Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 19 Sep 2016 11:43:40 +0000 Subject: [PATCH] Add vsftpd-3.0.2-fix-chown-uploads.patch to fix a bug in vsftpd where files uploaded by an anonymous user could not be chown()ed to the desired UID as specified in the daemon's configuration file. [bnc#996370] OBS-URL: https://build.opensuse.org/package/show/network/vsftpd?expand=0&rev=106 --- vsftpd-3.0.2-fix-chown-uploads.patch | 28 ++++++++++++++++++++++++++++ vsftpd.changes | 8 ++++++++ vsftpd.spec | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 vsftpd-3.0.2-fix-chown-uploads.patch diff --git a/vsftpd-3.0.2-fix-chown-uploads.patch b/vsftpd-3.0.2-fix-chown-uploads.patch new file mode 100644 index 0000000..8771b54 --- /dev/null +++ b/vsftpd-3.0.2-fix-chown-uploads.patch @@ -0,0 +1,28 @@ +Index: vsftpd-3.0.2/seccompsandbox.c +=================================================================== +--- vsftpd-3.0.2.orig/seccompsandbox.c ++++ vsftpd-3.0.2/seccompsandbox.c +@@ -475,6 +475,10 @@ seccomp_sandbox_setup_postlogin(const st + /* Need to send file descriptors to privileged broker. */ + allow_nr_1_arg_match(__NR_sendmsg, 3, 0); + } ++ if (is_anon && tunable_chown_uploads) ++ { ++ allow_nr(__NR_fchmod); ++ } + } + + if (tunable_syslog_enable) +@@ -538,6 +542,12 @@ seccomp_sandbox_setup_postlogin_broker() + seccomp_sandbox_setup_base(); + seccomp_sandbox_setup_data_connections(); + allow_nr_1_arg_match(__NR_sendmsg, 3, 0); ++ if (tunable_chown_uploads) ++ { ++ allow_nr(__NR_fstat); ++ allow_nr(__NR_fchown); ++ allow_nr_1_arg_match(__NR_recvmsg, 3, 0); ++ } + } + + void diff --git a/vsftpd.changes b/vsftpd.changes index 8242e36..28e1b0b 100644 --- a/vsftpd.changes +++ b/vsftpd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Sep 19 11:39:04 UTC 2016 - psimons@suse.com + +- Add vsftpd-3.0.2-fix-chown-uploads.patch to fix a bug in vsftpd + where files uploaded by an anonymous user could not be chown()ed + to the desired UID as specified in the daemon's configuration + file. [bnc#996370] + ------------------------------------------------------------------- Wed Aug 31 17:21:04 UTC 2016 - dimstar@opensuse.org diff --git a/vsftpd.spec b/vsftpd.spec index b32da1c..8149213 100644 --- a/vsftpd.spec +++ b/vsftpd.spec @@ -69,6 +69,7 @@ Patch22: vsftpd-path-normalize.patch Patch23: vsftpd-ls-memleak.patch #PATCH-FIX-UPSTREAM: bnc#970982 Patch24: vsftpd-3.0.2-wnohang.patch +Patch25: vsftpd-3.0.2-fix-chown-uploads.patch BuildRequires: libcap-devel BuildRequires: openssl-devel BuildRequires: pam-devel @@ -118,6 +119,7 @@ tests. %patch22 -p1 %patch23 -p1 %patch24 -p1 +%patch25 -p1 %build %define seccomp_opts -D_GNU_SOURCE -DUSE_SECCOMP