diff -Nru vsftpd-3.0.2/debian/changelog vsftpd-3.0.2/debian/changelog --- vsftpd-3.0.2/debian/changelog 2013-05-16 14:45:01.000000000 +0000 +++ vsftpd-3.0.2/debian/changelog 2014-04-28 17:21:46.000000000 +0000 @@ -1,3 +1,11 @@ +vsftpd (3.0.2-1ubuntu3) UNRELEASED; urgency=medium + + * Add dep8 smoke test. + * d/p/seccomp-gettimeofday.patch: permit gettimeofday() for logging calls + (LP: #1219857). + + -- Robie Basak Mon, 28 Apr 2014 17:12:29 +0000 + vsftpd (3.0.2-1ubuntu2) saucy; urgency=low * debian/patches/13-disable-clone-newpid.patch diff -Nru vsftpd-3.0.2/debian/control vsftpd-3.0.2/debian/control --- vsftpd-3.0.2/debian/control 2013-05-16 14:44:01.000000000 +0000 +++ vsftpd-3.0.2/debian/control 2014-04-28 15:05:48.000000000 +0000 @@ -8,6 +8,7 @@ libwrap0-dev, dh-apport Standards-Version: 3.9.3 Homepage: http://vsftpd.beasts.org/ +XS-Testsuite: autopkgtest Package: vsftpd Architecture: any diff -Nru vsftpd-3.0.2/debian/patches/seccomp-gettimeofday.patch vsftpd-3.0.2/debian/patches/seccomp-gettimeofday.patch --- vsftpd-3.0.2/debian/patches/seccomp-gettimeofday.patch 1970-01-01 00:00:00.000000000 +0000 +++ vsftpd-3.0.2/debian/patches/seccomp-gettimeofday.patch 2014-04-28 17:11:55.000000000 +0000 @@ -0,0 +1,17 @@ +Description: permit gettimeofday() in seccomp sandbox + This permits log message generation, without which vsftpd fails completely. +Author: Robie Basak +Bug-Ubuntu: https://launchpad.net/bugs/1219857 +Forwarded: to Chris Evans (no upstream VCS or bug tracker evident) +Last-Update: 2014-04-28 + +--- a/seccompsandbox.c ++++ b/seccompsandbox.c +@@ -300,6 +300,7 @@ + reject_nr(__NR_mremap, ENOSYS); + + /* Misc simple low-risk calls. */ ++ allow_nr(__NR_gettimeofday); /* Used by logging */ + allow_nr(__NR_rt_sigreturn); /* Used to handle SIGPIPE. */ + allow_nr(__NR_restart_syscall); + allow_nr(__NR_close); diff -Nru vsftpd-3.0.2/debian/patches/series vsftpd-3.0.2/debian/patches/series --- vsftpd-3.0.2/debian/patches/series 2013-05-16 14:44:01.000000000 +0000 +++ vsftpd-3.0.2/debian/patches/series 2014-04-28 14:16:48.000000000 +0000 @@ -13,3 +13,4 @@ 09-disable-anonymous.patch 12-ubuntu-use-snakeoil-ssl.patch 13-disable-clone-newpid.patch +seccomp-gettimeofday.patch diff -Nru vsftpd-3.0.2/debian/tests/control vsftpd-3.0.2/debian/tests/control --- vsftpd-3.0.2/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ vsftpd-3.0.2/debian/tests/control 2014-04-28 16:43:44.000000000 +0000 @@ -0,0 +1,5 @@ +# This is a breaks-testbed test, but it is not declared here. See: +# https://lists.ubuntu.com/archives/ubuntu-quality/2013-November/004679.html + +Tests: smoke +Restrictions: needs-root allow-stderr diff -Nru vsftpd-3.0.2/debian/tests/smoke vsftpd-3.0.2/debian/tests/smoke --- vsftpd-3.0.2/debian/tests/smoke 1970-01-01 00:00:00.000000000 +0000 +++ vsftpd-3.0.2/debian/tests/smoke 2014-04-28 16:42:29.000000000 +0000 @@ -0,0 +1,46 @@ +#!/bin/sh +set -ex + +# Simple smoke test for vsftpd. Tests get and put functionality. +# Author: Robie Basak +# dep8 restrictions: breaks-bestbed needs-root allow-stderr + +# Written in response to https://launchpad.net/bugs/1219857 +# This passed on LXC, affecting qemu only. So it is advisable to test both, +# using isolation-container and isolation-machine as needed. + +# Enable writes, to test both get and put +sed -i 's/#\(write_enable=YES\)/\1/' /etc/vsftpd.conf +service vsftpd reload + +# Create test user +adduser --disabled-password --gecos '' ftptest +echo ftptest:dep8|chpasswd ftptest + +# Set up .netrc so that the ftp client can login in automatically +> ~ftptest/.netrc +chown ftptest: ~ftptest/.netrc +chmod 600 ~ftptest/.netrc +cat > ~ftptest/.netrc < ~ftptest/local/put +echo "Hello, world! 2." > ~ftptest/remote/get +chown -R ftptest: ~ftptest/local ~ftptest/remote + +su -c 'ftp localhost' - ftptest <