summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2014-07-26 09:58:12 +0200
committerGerrit Pape <pape@smarden.org>2014-07-26 09:58:12 +0200
commit85cb5085b2dfbeb428cdf0b1097ebc012981dc62 (patch)
tree961cc90064386dede92ce27893fbe5475551c1f1
parent6399ccc0a3abc45458bc3c7902e241d785b96045 (diff)
twoftpd (1.42-1) unstable; urgency=low
* new upstream version (closes: #661646, thx Anton Khalikov). * debian/etc/twoftpd[-anon]/run: raise memory limit to 12000000 bytes. * debian/rules: target clean: depend on target patch. * debian/twoftpd-run.postrm: purge: make sure all twoftpd services are down; be less verbose. [dgit import package twoftpd 1.42-1]
-rw-r--r--debian/README.Debian.diet15
-rw-r--r--debian/changelog253
-rw-r--r--debian/control41
-rw-r--r--debian/copyright15
-rw-r--r--debian/diff/0001-conf.c-use-ipsvd-and-runit-tools-instead-og-ucspi-tcp.diff71
-rw-r--r--debian/diff/0002-TARGETS-remove-.html-they-re-shipped-in-orig.tar.gz.diff33
-rw-r--r--debian/diff/0003-Makefile-avoid-rpath.diff25
-rw-r--r--debian/etc/twoftpd-anon/env/CHROOT1
-rw-r--r--debian/etc/twoftpd-anon/env/GID1
-rw-r--r--debian/etc/twoftpd-anon/env/GROUP1
-rw-r--r--debian/etc/twoftpd-anon/env/HOME1
-rw-r--r--debian/etc/twoftpd-anon/env/UID1
-rw-r--r--debian/etc/twoftpd-anon/env/USER1
-rw-r--r--debian/etc/twoftpd-anon/log/run4
-rw-r--r--debian/etc/twoftpd-anon/run7
-rw-r--r--debian/etc/twoftpd/env/CHROOT1
-rw-r--r--debian/etc/twoftpd/log/run4
-rw-r--r--debian/etc/twoftpd/run7
-rw-r--r--debian/implicit93
-rwxr-xr-xdebian/rules109
-rw-r--r--debian/twoftpd-run.README.Debian32
-rw-r--r--debian/twoftpd-run.conffiles11
-rw-r--r--debian/twoftpd-run.postinst29
-rw-r--r--debian/twoftpd-run.postrm27
-rw-r--r--debian/twoftpd-run.prerm9
-rw-r--r--debian/twoftpd.README.Debian49
-rw-r--r--debian/twoftpd.docs9
27 files changed, 850 insertions, 0 deletions
diff --git a/debian/README.Debian.diet b/debian/README.Debian.diet
new file mode 100644
index 0000000..3651e8c
--- /dev/null
+++ b/debian/README.Debian.diet
@@ -0,0 +1,15 @@
+Building twoftpd with the diet libc
+-----------------------------------
+
+This package optionally can be built with the diet libc instead of the glibc
+to provide small statically linked programs. The resulting package has no
+dependency on any other package.
+
+To use the diet libc, make sure the latest versions of the dietlibc-dev and
+bglibs-dev packages are installed, and set DEB_BUILD_OPTIONS=diet in the
+environment when building the package, e.g.:
+
+ # apt-get install dietlibc-dev bglibs-dev
+ $ DEB_BUILD_OPTIONS=diet fakeroot apt-get source -b twoftpd
+
+ -- Gerrit Pape <pape@smarden.org>, Sat, 22 Jan 2005 12:25:41 +0000
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e29686a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,253 @@
+twoftpd (1.42-1) unstable; urgency=low
+
+ * new upstream version (closes: #661646, thx Anton Khalikov).
+ * debian/etc/twoftpd[-anon]/run: raise memory limit to 12000000 bytes.
+ * debian/rules: target clean: depend on target patch.
+ * debian/twoftpd-run.postrm: purge: make sure all twoftpd services are
+ down; be less verbose.
+
+ -- Gerrit Pape <pape@smarden.org> Sat, 26 Jul 2014 07:58:12 +0000
+
+twoftpd (1.41-1) unstable; urgency=low
+
+ * debian/twoftpd-run.postrm: purge: services' supervise dirs are now
+ located in /var/lib/supervise/, remove those; purge: remove log
+ files.
+ * new upstream version.
+ * debian/diff/0002-Makefile-force-use-of-cvm-v1client-lib-cvm...diff:
+ remove; obsolete.
+ * debian/diff/0003-Makefile-avoid-rpath.diff: new; avoid rpath.
+ * debian/control: Standards-Version: 3.8.4.0.
+
+ -- Gerrit Pape <pape@smarden.org> Mon, 19 Apr 2010 22:34:18 +0000
+
+twoftpd (1.21-8) unstable; urgency=low
+
+ * debian/control: Build-Depends: libbg1-dev, libcvm1-dev; add
+ Vcs-Git:.
+ * debian/diff/0002-Makefile-force-use-of-cvm-v1client-lib...diff:
+ new: Makefile: force use of cvm-v1client lib, cvm-client now
+ defaults to v2.
+ * debian/twoftpd.README.Debian, debian/twoftpd-run.README.Debian:
+ talk about the update-service program, instead of dealing with
+ service directory symlinks manually.
+ * debian/diff/0003-TARGETS-remove-.html-they-re-shipped...diff: new:
+ TARGETS: remove *.html, they're shipped in orig.tar.gz.
+
+ -- Gerrit Pape <pape@smarden.org> Sun, 25 May 2008 18:51:16 +0000
+
+twoftpd (1.21-7) unstable; urgency=low
+
+ * debian/control: package twoftpd-run: Depends: runit (>= 1.8.0-2) (fix
+ typo).
+
+ -- Gerrit Pape <pape@smarden.org> Wed, 20 Feb 2008 09:27:31 +0000
+
+twoftpd (1.21-6) unstable; urgency=low
+
+ * debian/control: package twoftpd-run: Depends: runit (>> 1.8.0-2) (1st
+ version that provides the update-service program).
+
+ -- Gerrit Pape <pape@smarden.org> Sun, 17 Feb 2008 16:07:58 +0000
+
+twoftpd (1.21-5) unstable; urgency=low
+
+ * debian/implicit: add proper dependencies to support 'parallel build'
+ through make -j (thx Daniel Schepler for the patch).
+ * debian/diff/debian-conf.diff: redo with git as
+ debian/diff/0001-conf.c-use-ipsvd-and-runit-tools-instead-og-ucspi.diff.
+ * debian/rules: apply patches from debian/diff/ with -p1 instead of -p0.
+ * debian/twoftpd-run.postinst, debian/twoftpd-run.prerm,
+ debian/twoftpd-run.postrm: use runit's update-service program to
+ add/remove the twoftpd services, instead of dealing with symlinks in
+ /var/service/ directly (closes: #464951).
+ * debian/control: Standards-Version: 3.7.3.0.
+ * debian/rules: no longer include symlinks for ./supervise/ subdirectories,
+ update-service now takes care of this; no longer include directories in
+ /var/run/.
+
+ -- Gerrit Pape <pape@smarden.org> Sun, 17 Feb 2008 15:50:34 +0000
+
+twoftpd (1.21-4) unstable; urgency=medium
+
+ * debian/etc/twoftpd/run, debian/etc/twoftpd-anon/run: raise memory limit
+ for services from 3MB to 7MB (amd64 requires at least 6.5MB, thx Alvaro
+ Herrera; closes: #400118).
+
+ -- Gerrit Pape <pape@smarden.org> Tue, 19 Dec 2006 20:21:08 +0000
+
+twoftpd (1.21-3) unstable; urgency=medium
+
+ * debian/twoftpd-run.postrm: check for deluser being available, if not,
+ print warning and don't remove system users (ref: #398539); suppress
+ error message if directories cannot be removed on purge.
+
+ -- Gerrit Pape <pape@smarden.org> Fri, 17 Nov 2006 20:12:41 +0000
+
+twoftpd (1.21-2) unstable; urgency=low
+
+ * debian/twoftpd-run.postinst: don't make the log service system user
+ ftplog member of group adm, but nogroup; ftplog's home directory is
+ /nonexistent; make log directories mode 2750, owner ftplog:adm (closes:
+ #396687).
+
+ -- Gerrit Pape <pape@smarden.org> Mon, 6 Nov 2006 20:30:50 +0000
+
+twoftpd (1.21-1) unstable; urgency=low
+
+ * new upstream release.
+ * debian/twoftod.docs: add twoftpd-auth.1.html, twoftpd-switch.1.html,
+ twoftpd-xfer.1.html.
+ * debian/diff/libbg.diff: remove; obsolete.
+ * debian/rules: adapt.
+ * debian/control: Build-Depends: man2html.
+
+ -- Gerrit Pape <pape@smarden.org> Mon, 1 May 2006 18:53:37 +0000
+
+twoftpd (1.20-3) unstable; urgency=low
+
+ * debian/twoftpd-run.prerm: use sv program instead of svwaitdown to
+ shutdown services.
+ * debian/control: twoftpd-run Depends: runit (>> 1.3.0-0), adduser.
+ * debian/twoftpd-run.postrm: minor.
+ * debian/twoftpd-run.postinst: on configure always enable twoftpd service
+ if twoftpd-anon service isn't used.
+
+ -- Gerrit Pape <pape@smarden.org> Wed, 12 Oct 2005 10:36:15 +0000
+
+twoftpd (1.20-2) unstable; urgency=low
+
+ * debian/diff/libbg.diff: new; upstream Makefile: add -lbg when linking
+ inst* programs (required by recent bglibs >> 1.021-0).
+ * debian/control: fix typos in long descriptions (closes: #300055,
+ #300056); remove version restrictions from Build-Depends: bglibs-dev,
+ cvm-dev; Standards-Version: 3.6.2.0.
+
+ -- Gerrit Pape <pape@smarden.org> Sun, 3 Jul 2005 14:06:52 +0000
+
+twoftpd (1.20-1) unstable; urgency=low
+
+ * new upstream release.
+ * debian/implicit: update to revision 1.10.
+ * debian/twoftpd.README.Debian: minor; remove statement about contrib/
+ directory.
+ * twoftpd-run.README.Debian: minor.
+ * debian/control: Build-Depends: bglibs-dev (>> 1.019-0), cvm-dev (>>
+ 0.32-0); minor.
+ * debian/copyright: adapt, 2005; remove copyright statement about contrib/
+ directory.
+ * debian/rules: cleanup; support diet, noopt in DEB_BUILD_OPTIONS; no longer
+ build, install contrib/set-tcp-env.
+ * twoftpd-run.postinst, twoftpd-run.postrm, twoftpd-run.prerm: cleanup.
+ * debian/README.Debian.diet: new; how to build package with the diet libc.
+ * debian/twoftpd.docs: add debian/README.Debian.diet.
+ * contrib/: remove; this package no longer provides the set-tcp-env program.
+
+ -- Gerrit Pape <pape@smarden.org> Sat, 22 Jan 2005 18:03:03 +0000
+
+twoftpd (1.17-6) unstable; urgency=low
+
+ * debian/control: no longer Build-Depends: debhelper; Standards-Version:
+ 3.6.1.0.
+ * debian/rules: stop using debhelper, use implicit rules.
+ * debian/implicit: new; implicit Makefile rules.
+ * debian/copyright: include explicit copyright statement; contrib/ and
+ debian/ is in the Public domain.
+ * debian/README.Debian: rename to debian/twoftpd.README.Debian.
+ * debian/dirs, debian/docs, debian/twoftpd-run.dirs,
+ debian/twoftpd-run.links: remove; obsolete.
+ * debian/twoftpd-run.conffiles, debian/twoftpd.docs: new.
+ * debian/twoftpd-run.postinst, debian/twoftpd-run.postrm,
+ debian/twoftpd-run.prerm: minor cleanup.
+ * debian/etc/twoftpd/run, debian/etc/twoftpd-anon/run: raise memory limit
+ to 3000000.
+
+ -- Gerrit Pape <pape@smarden.org> Mon, 29 Dec 2003 15:34:08 +0000
+
+twoftpd (1.17-5) unstable; urgency=low
+
+ * debian/control: bglibs-dev no longer provides cvm development files,
+ hence Build-Depends: bglibs-dev (>> 1.011-0), cvm-dev (>> 0.18-0)
+ (closes: #223217).
+
+ -- Gerrit Pape <pape@smarden.org> Wed, 10 Dec 2003 09:42:07 +0000
+
+twoftpd (1.17-4) unstable; urgency=low
+
+ * debian/control: package twoftpd: Recommends: runit (>> 0.11.2-0);
+ package twoftpd-run: Depends: runit (>> 0.11.2-0) (closes: #212315).
+
+ -- Gerrit Pape <pape@smarden.org> Thu, 25 Sep 2003 11:27:12 +0000
+
+twoftpd (1.17-3) unstable; urgency=low
+
+ * debian/control: new package twoftpd-run: provides ftp service (listener
+ on 0.0.0.0:21); Provides: ftp-server, Conflicts: ftp-server, Depends:
+ twoftpd, runit (>> 0.11.0-0), ipsvd, cvm (closes: #204214).
+ * debian/control: package twoftpd: provides programs only, Recommends:
+ twoftpd-run, runit (>> 0.11.0-0), ipsvd, cvm.
+ * debian/control: Standards-Version: 3.6.0; adapt long descriptions.
+ * debian/rules: build binary-indep package twoftpd-run.
+ * debian/diff/debian-conf.diff: adapt, make twoftpd-conf and
+ twoftpd-anon-conf utilize the chpst program from the runit package.
+ * debian/etc/*: new; twoftpd and twoftpd-anon service directories.
+ * debian/twoftpd-run.dirs, debian/twoftpd-run.links,
+ debian/twoftpd-run.postinst, debian/twoftpd-run.postrm,
+ debian/twoftpd-run.prerm, debian/twoftpd-run.README.Debian: new.
+ * contrib/daemontools-pd-0.76/error.h: '#include <errno.h>' instead of
+ 'extern int errno;'.
+ * debian/README.inetd, debian/in.twoftpd, debian/in.twoftpd-anon: remove;
+ obsolete, the package no longer provides running twoftpd services from
+ inetd.
+ * debian/undocumented, debian/examples: remove; obsolete.
+ * debian/docs: adapt.
+
+ -- Gerrit Pape <pape@smarden.org> Sun, 24 Aug 2003 19:18:09 +0200
+
+twoftpd (1.17-2) unstable; urgency=low
+
+ * debian/diff/debian-conf.diff: new; change twoftpd-conf and
+ twoftpd-anon-conf to create service directories that utilize programs
+ from the runit and ipsvd packages.
+ * debian/control: Recommends: runit, ipsvd; remove Suggests:;
+ Standards-Version: 3.5.10.
+ * debian/README.Debian: instructions on how to configure and enable
+ twoftpd services.
+
+ -- Gerrit Pape <pape@smarden.org> Sat, 5 Jul 2003 15:38:34 +0200
+
+twoftpd (1.17-1) unstable; urgency=low
+
+ * new upstream version.
+ * debian/control: Standards-Version: 3.5.8; Build-Depends: bglibs-dev
+ (>> 1.006-0); Recommends: runit | daemontools.
+ * debian/copyright: refer to common-licenses/GPL-2.
+ * debian/rules: minor adaptions.
+
+ -- Gerrit Pape <pape@smarden.org> Thu, 6 Mar 2003 14:04:09 +0100
+
+twoftpd (1.16-1) unstable; urgency=low
+
+ * new upstream version; Build-Depends on bglibs-dev.
+
+ -- Gerrit Pape <pape@smarden.org> Tue, 25 Jun 2002 15:56:26 +0200
+
+twoftpd (1.15-1) unstable; urgency=low
+
+ * new upstream version.
+ * unexpected UID setting fix: included in upstream.
+
+ -- Gerrit Pape <pape@smarden.org> Fri, 19 Apr 2002 11:52:09 +0200
+
+twoftpd (1.14-1) unstable; urgency=low
+
+ * Initial Release (closes: #119871)
+ * contrib/ added
+ * example configuration for use with inetd
+ * unexpected UID setting fixed in twoftpd-anon-conf.c
+
+ -- Gerrit Pape <pape@smarden.org> Fri, 23 Nov 2001 16:15:12 +0100
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..0d12d16
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,41 @@
+Source: twoftpd
+Section: net
+Priority: optional
+Maintainer: Gerrit Pape <pape@smarden.org>
+Build-Depends: libbg1-dev, libcvm1-dev, man2html
+Standards-Version: 3.8.4.0
+Vcs-Git: http://smarden.org/git/twoftpd.git/
+
+Package: twoftpd
+Architecture: any
+Depends: ${shlibs:Depends}
+Recommends: twoftpd-run, runit, ipsvd, cvm
+Description: a simple secure efficient FTP server (programs)
+ This is twoftpd, an FTP server that strives to be secure, simple, and
+ efficient. None of the commands can cause execution of other programs,
+ and the normal model of execution does a chroot to the logged in user's
+ directory immediately after authentication.
+ .
+ The name "twoftpd" comes from the fact that there were two parts to the
+ server -- an authenticating front end, which contains no file or data
+ transfer code, and a back end, which contains all the data transfer
+ code.
+ .
+ This package contains the twoftpd programs.
+
+Package: twoftpd-run
+Architecture: all
+Section: admin
+Depends: twoftpd, runit (>= 1.8.0-2), ipsvd, cvm, adduser
+Provides: ftp-server
+Conflicts: ftp-server
+Suggests: runit-run
+Description: a simple secure efficient FTP server
+ This is twoftpd, an FTP server that strives to be secure, simple, and
+ efficient. None of the commands can cause execution of other programs,
+ and the normal model of execution does a chroot to the logged in user's
+ directory immediately after authentication.
+ .
+ This package sets up the twoftpd service to listen on 0.0.0.0:21, and
+ additionally provides a service directory to run an anonymous twoftpd
+ service.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..2c7b4ea
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,15 @@
+This package was debianized by Gerrit Pape <pape@smarden.org> on
+Mon, 19 Nov 2001 13:25:17 +0100.
+
+It was downloaded from http://untroubled.org/twoftpd/
+
+Upstream Author: Bruce Guenter <bruceg@em.ca>
+
+Copyright:
+
+This program is Copyright(C) 2001-2005 Bruce Guenter, and may be copied
+according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later
+version. A copy of this license is included with this package. This
+package comes with no warranty of any kind.
+
+The full text of the GPL can be found at /usr/share/common-licenses/GPL-2.
diff --git a/debian/diff/0001-conf.c-use-ipsvd-and-runit-tools-instead-og-ucspi-tcp.diff b/debian/diff/0001-conf.c-use-ipsvd-and-runit-tools-instead-og-ucspi-tcp.diff
new file mode 100644
index 0000000..a5e0f60
--- /dev/null
+++ b/debian/diff/0001-conf.c-use-ipsvd-and-runit-tools-instead-og-ucspi-tcp.diff
@@ -0,0 +1,71 @@
+From af31ad1efa3dad4ab40528fd9e9c47838d807669 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Sun, 17 Feb 2008 15:21:58 +0000
+Subject: [PATCH 1/3] *-conf.c: use ipsvd and runit tools instead og ucspi-tcp
+ and daemontools.
+
+---
+ twoftpd-anon-conf.c | 11 +++++------
+ twoftpd-conf.c | 16 +++++++---------
+ 2 files changed, 12 insertions(+), 15 deletions(-)
+
+diff --git a/twoftpd-anon-conf.c b/twoftpd-anon-conf.c
+index 2db7302..365b516 100644
+--- a/twoftpd-anon-conf.c
++++ b/twoftpd-anon-conf.c
+@@ -92,15 +92,14 @@ int main(int argc, char* argv[])
+ "exec 2>&1\n"
+ "umask 022\n"
+ "exec \\\n"
+- "tcpserver -DRHv -llocalhost ", ip, " 21 \\\n"
+- "softlimit -m 2000000 \\\n"
+- "envdir ", maindir, "/env \\\n",
+- conf_bin, "/twoftpd-anon");
++ "tcpsvd -v -llocalhost ", ip, " 21 \\\n"
++ " chpst -m2000000 -e./env \\\n"
++ " twoftpd-anon", 0, 0, 0, 0);
+ make_file("log/run", 0755,
+ "#!/bin/sh\n"
+ "exec \\\n"
+- "setuidgid ", logname, " \\\n"
+- "multilog t ", logdir, 0, 0, 0);
++ "chpst -u", logname, " \\\n"
++ " svlogd -t ", logdir, 0, 0, 0);
+ make_fileu("env/CHROOT", 1);
+ make_fileu("env/GID", ftpgid);
+ make_file("env/HOME", 0644, ftpdir, 0, 0, 0, 0, 0, 0);
+diff --git a/twoftpd-conf.c b/twoftpd-conf.c
+index 8d98fed..8301be4 100644
+--- a/twoftpd-conf.c
++++ b/twoftpd-conf.c
+@@ -84,20 +84,18 @@ int main(int argc, char* argv[])
+ "exec 2>&1\n"
+ "umask 022\n"
+ "exec \\\n"
+- "tcpserver -DRHv -llocalhost ", ip, " 21 \\\n"
+- "envdir ", maindir, "/env \\\n");
+- obuf_put7s(&conf_out,
+- "softlimit -m 2000000 \\\n",
+- conf_bin, "/twoftpd-auth \\\n",
+- cvmpath, " \\\n",
+- conf_bin, "/twoftpd-xfer");
++ "tcpsvd -v -llocalhost ", ip, " 21 \\\n"
++ " chpst -m2000000 -e./env \\\n"
++ " twoftpd-auth ",
++ cvmpath,
++ " twoftpd-xfer");
+ end_file();
+
+ make_file("log/run", 0755,
+ "#!/bin/sh\n"
+ "exec \\\n"
+- "setuidgid ", logacct->pw_name, " \\\n"
+- "multilog t ", logdir, 0, 0, 0);
++ "chpst -u", logacct->pw_name, " \\\n"
++ " svlogd -t ", logdir, 0, 0, 0);
+
+ if (dochroot) make_fileu("env/CHROOT", 1);
+
+--
+2.0.1
+
diff --git a/debian/diff/0002-TARGETS-remove-.html-they-re-shipped-in-orig.tar.gz.diff b/debian/diff/0002-TARGETS-remove-.html-they-re-shipped-in-orig.tar.gz.diff
new file mode 100644
index 0000000..4eb76aa
--- /dev/null
+++ b/debian/diff/0002-TARGETS-remove-.html-they-re-shipped-in-orig.tar.gz.diff
@@ -0,0 +1,33 @@
+From a2a31390defd7af85745e942b69eef51e43cd493 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Sun, 25 May 2008 18:50:43 +0000
+Subject: [PATCH 2/3] TARGETS: remove *.html, they're shipped in orig.tar.gz.
+
+---
+ TARGETS | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/TARGETS b/TARGETS
+index e2f6190..239b6a1 100644
+--- a/TARGETS
++++ b/TARGETS
+@@ -35,7 +35,6 @@ twoftpd-anon-conf
+ twoftpd-anon-conf.o
+ twoftpd-anon.o
+ twoftpd-auth
+-twoftpd-auth.1.html
+ twoftpd-auth.o
+ twoftpd-bind-port
+ twoftpd-bind-port.o
+@@ -44,8 +43,6 @@ twoftpd-conf.o
+ twoftpd-drop
+ twoftpd-drop.o
+ twoftpd-switch
+-twoftpd-switch.1.html
+ twoftpd-switch.o
+ twoftpd-xfer
+-twoftpd-xfer.1.html
+ twoftpd-xfer.o
+--
+2.0.1
+
diff --git a/debian/diff/0003-Makefile-avoid-rpath.diff b/debian/diff/0003-Makefile-avoid-rpath.diff
new file mode 100644
index 0000000..f5a5b02
--- /dev/null
+++ b/debian/diff/0003-Makefile-avoid-rpath.diff
@@ -0,0 +1,25 @@
+From 0e63fa0fb919e5394704c3c6dff87ed776c41d2a Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Mon, 19 Apr 2010 22:20:11 +0000
+Subject: [PATCH 3/3] Makefile: avoid rpath
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 9a66ba4..a8c65aa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -59,7 +59,7 @@ load: conf-ld conf-bglibs
+ ( bglibs=`head -n 1 conf-bglibs`; \
+ echo '#!/bin/sh';\
+ echo 'main="$$1"; shift';\
+- echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" "-Wl,-R'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
++ echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
+ ) >load
+ chmod 755 load
+
+--
+2.0.1
+
diff --git a/debian/etc/twoftpd-anon/env/CHROOT b/debian/etc/twoftpd-anon/env/CHROOT
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/CHROOT
@@ -0,0 +1 @@
+1
diff --git a/debian/etc/twoftpd-anon/env/GID b/debian/etc/twoftpd-anon/env/GID
new file mode 100644
index 0000000..e8f3792
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/GID
@@ -0,0 +1 @@
+65534
diff --git a/debian/etc/twoftpd-anon/env/GROUP b/debian/etc/twoftpd-anon/env/GROUP
new file mode 100644
index 0000000..c4db1fa
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/GROUP
@@ -0,0 +1 @@
+ftp
diff --git a/debian/etc/twoftpd-anon/env/HOME b/debian/etc/twoftpd-anon/env/HOME
new file mode 100644
index 0000000..3ba4aaa
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/HOME
@@ -0,0 +1 @@
+/var/ftp
diff --git a/debian/etc/twoftpd-anon/env/UID b/debian/etc/twoftpd-anon/env/UID
new file mode 100644
index 0000000..e8f3792
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/UID
@@ -0,0 +1 @@
+65534
diff --git a/debian/etc/twoftpd-anon/env/USER b/debian/etc/twoftpd-anon/env/USER
new file mode 100644
index 0000000..c4db1fa
--- /dev/null
+++ b/debian/etc/twoftpd-anon/env/USER
@@ -0,0 +1 @@
+ftp
diff --git a/debian/etc/twoftpd-anon/log/run b/debian/etc/twoftpd-anon/log/run
new file mode 100644
index 0000000..4a2c9a3
--- /dev/null
+++ b/debian/etc/twoftpd-anon/log/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec \
+chpst -uftplog \
+ svlogd -t /var/log/twoftpd-anon
diff --git a/debian/etc/twoftpd-anon/run b/debian/etc/twoftpd-anon/run
new file mode 100644
index 0000000..fc6df16
--- /dev/null
+++ b/debian/etc/twoftpd-anon/run
@@ -0,0 +1,7 @@
+#!/bin/sh
+exec 2>&1
+umask 022
+exec \
+tcpsvd -v -llocalhost 0 21 \
+ chpst -m12000000 -e./env \
+ twoftpd-anon
diff --git a/debian/etc/twoftpd/env/CHROOT b/debian/etc/twoftpd/env/CHROOT
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/debian/etc/twoftpd/env/CHROOT
@@ -0,0 +1 @@
+1
diff --git a/debian/etc/twoftpd/log/run b/debian/etc/twoftpd/log/run
new file mode 100644
index 0000000..5299487
--- /dev/null
+++ b/debian/etc/twoftpd/log/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec \
+chpst -uftplog \
+ svlogd -t /var/log/twoftpd
diff --git a/debian/etc/twoftpd/run b/debian/etc/twoftpd/run
new file mode 100644
index 0000000..5e1d05a
--- /dev/null
+++ b/debian/etc/twoftpd/run
@@ -0,0 +1,7 @@
+#!/bin/sh
+exec 2>&1
+umask 022
+exec \
+tcpsvd -v -llocalhost 0 21 \
+ chpst -m12000000 -e./env \
+ twoftpd-auth cvm-unix twoftpd-xfer
diff --git a/debian/implicit b/debian/implicit
new file mode 100644
index 0000000..639532b
--- /dev/null
+++ b/debian/implicit
@@ -0,0 +1,93 @@
+# $Id: a09db2e42c8b6a2d820754d741558e5894944746 $
+
+.PHONY: deb-checkdir deb-checkuid
+
+deb-checkdir:
+ @test -e debian/control || sh -cx '! : wrong directory'
+deb-checkuid:
+ @test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb: %.deb-docs %.deb-DEBIAN
+ @rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \
+ $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \
+ $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.udeb: %.deb-DEBIAN
+ @rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \
+ $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums
+
+%.deb-checkdir: install
+ @test -d debian/$* || sh -cx '! : directory debian/$* missing'
+ @test "`id -u`" -eq 0 || sh -cx '! : need root privileges'
+
+%.deb-docs-base: install
+ : implicit
+ @rm -f debian/$*/usr/share/doc/$*/* || :
+ @install -d -m0755 debian/$*/usr/share/doc/$*
+ : debian/$*/usr/share/doc/$*/
+ @sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/'
+ @sh -cx 'install -m0644 debian/changelog \
+ debian/$*/usr/share/doc/$*/changelog.Debian'
+ @test ! -r changelog || \
+ sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/'
+ @test -r debian/$*/usr/share/doc/$*/changelog || \
+ sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \
+ debian/$*/usr/share/doc/$*/changelog'
+ @test -s debian/$*/usr/share/doc/$*/changelog || \
+ sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog'
+ @gzip -9 debian/$*/usr/share/doc/$*/changelog*
+%.deb-docs-docs: %.deb-docs-base
+ @for i in `cat debian/$*.docs 2>/dev/null || :`; do \
+ if test -d $$i; then \
+ sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \
+ for j in $$i/*; do \
+ sh -cx "install -m0644 $$j \
+ debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \
+ done || exit 1; \
+ continue; \
+ fi; \
+ sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \
+ done
+ @test ! -r debian/$*.README.Debian || \
+ sh -cx 'install -m0644 debian/$*.README.Debian \
+ debian/$*/usr/share/doc/$*/README.Debian'
+ @if test -r debian/$*.NEWS.Debian; then \
+ sh -cx 'install -m0644 debian/$*.NEWS.Debian \
+ debian/$*/usr/share/doc/$*/NEWS.Debian && \
+ gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \
+ fi
+%.deb-docs-examples: %.deb-docs-docs
+ @rm -rf debian/$*/usr/share/doc/$*/examples
+ : debian/$*/usr/share/doc/$*/examples/
+ @test ! -r debian/$*.examples || \
+ install -d -m0755 debian/$*/usr/share/doc/$*/examples
+ @for i in `cat debian/$*.examples 2>/dev/null || :`; do \
+ sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \
+ || exit 1; \
+ done
+%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples
+ : debian/$*/usr/share/doc/$*/ ok
+
+%.deb-DEBIAN-base: install
+ @rm -rf debian/$*/DEBIAN
+ : debian/$*/DEBIAN/
+ @install -d -m0755 debian/$*/DEBIAN
+ @for i in conffiles shlibs templates; do \
+ test ! -r debian/$*.$$i || \
+ sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+ || exit 1; \
+ done
+%.deb-DEBIAN-scripts: %.deb-DEBIAN-base
+ @for i in preinst prerm postinst postrm config; do \
+ test ! -r debian/$*.$$i || \
+ sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \
+ || exit 1; \
+ done
+%.deb-DEBIAN-md5sums: %.deb-DEBIAN-base %.deb-docs
+ : debian/$*/DEBIAN/md5sums
+ @rm -f debian/$*/DEBIAN/md5sums
+ @cd debian/$* && find * -path 'DEBIAN' -prune -o \
+ -type f -exec md5sum {} >>DEBIAN/md5sums \;
+%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \
+ %.deb-DEBIAN-md5sums
+ : debian/$*/DEBIAN/ ok
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..da95ab0
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,109 @@
+#!/usr/bin/make -f
+
+STRIP =strip
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ STRIP =: nostrip
+endif
+
+CFLAGS =-g -O2 -Wall
+LDFLAGS =
+CC =gcc
+BGLIBS =/usr/lib/bglibs
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS =-g -O0 -Wall
+endif
+ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS)))
+ CC =diet -v -Os gcc -nostdinc
+ BGLIBS =/usr/lib/diet/bglibs
+endif
+
+DIR =$(shell pwd)/debian/twoftpd
+
+patch: deb-checkdir patch-stamp
+patch-stamp:
+ for i in `ls -1 debian/diff/*.diff || :`; do \
+ patch -p1 <$$i || exit 1; \
+ done
+ touch patch-stamp
+
+build: deb-checkdir build-arch-stamp build-indep-stamp
+
+build-arch: deb-checkdir build-arch-stamp
+build-arch-stamp: patch-stamp
+ -gcc -v
+ for i in conf-*; do \
+ test -e $${i%'{orig}'}'{orig}' || cp -v $$i $$i'{orig}'; \
+ done
+ echo '$(CC) $(CFLAGS)' >conf-cc
+ echo '$(CC) $(LDFLAGS)' >conf-ld
+ echo '/usr/bin' >conf-bin
+ echo '$(BGLIBS)/include' >conf-bgincs
+ echo '$(BGLIBS)/lib' >conf-bglibs
+ $(MAKE)
+ touch build-arch-stamp
+
+build-indep: deb-checkdir build-indep-stamp
+build-indep-stamp:
+ touch build-indep-stamp
+
+clean: deb-checkdir deb-checkuid patch
+ $(MAKE) clean
+ for i in `ls *'{orig}' || :`; do mv -vf $$i $${i%'{orig}'}; done
+ test ! -e patch-stamp || \
+ for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done
+ rm -f build-arch-stamp build-indep-stamp patch-stamp
+ rm -rf '$(DIR)' '$(DIR)'-run
+ rm -f debian/files debian/substvars changelog
+
+install: install-arch install-indep
+install-arch: deb-checkdir deb-checkuid build-arch-stamp
+ rm -rf '$(DIR)'
+ install -d -m0755 '$(DIR)'/usr/bin
+ install -d -m0755 '$(DIR)'/usr/share/man/man1
+ echo '$(DIR)'/usr/bin >conf-bin
+ echo '$(DIR)'/usr/share/man >conf-man
+ PATH=$$PATH:/usr/lib/bglibs/bin/ $(MAKE) install
+ $(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/*
+ chmod 0644 '$(DIR)'/usr/share/man/man1/*.1
+ gzip -9 '$(DIR)'/usr/share/man/man1/*.1
+ test -r changelog || ln -s ChangeLog changelog
+
+install-indep: deb-checkdir deb-checkuid build-indep-stamp
+ rm -rf '$(DIR)'-run
+ install -d -m0755 '$(DIR)'-run/etc/twoftpd/log
+ install -d -m0755 '$(DIR)'-run/etc/twoftpd/env
+ install -m0755 debian/etc/twoftpd/run '$(DIR)'-run/etc/twoftpd/
+ install -m0755 debian/etc/twoftpd/log/run '$(DIR)'-run/etc/twoftpd/log/
+ for i in debian/etc/twoftpd/env/*; do \
+ test -d $$i || install -m0644 $$i '$(DIR)'-run/etc/twoftpd/env/ \
+ || exit 1; \
+ done
+ install -d -m0755 '$(DIR)'-run/etc/twoftpd-anon/log
+ install -d -m0755 '$(DIR)'-run/etc/twoftpd-anon/env
+ install -m0755 debian/etc/twoftpd-anon/run \
+ '$(DIR)'-run/etc/twoftpd-anon/run
+ install -m0755 debian/etc/twoftpd-anon/log/run \
+ '$(DIR)'-run/etc/twoftpd-anon/log/run
+ for i in debian/etc/twoftpd-anon/env/*; do \
+ test -d $$i || install -m0644 $$i '$(DIR)'-run/etc/twoftpd-anon/env/ \
+ || exit 1; \
+ done
+ install -d -m0755 '$(DIR)'-run/var/log/twoftpd
+ install -d -m0755 '$(DIR)'-run/var/log/twoftpd-anon
+ test -r changelog || ln -s ChangeLog changelog
+
+binary-arch: deb-checkdir deb-checkuid install-arch twoftpd.deb
+ test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/usr/bin/*
+ dpkg-gencontrol -isp -ptwoftpd -P'$(DIR)'
+ dpkg -b '$(DIR)' ..
+
+binary-indep: deb-checkdir deb-checkuid install-indep twoftpd-run.deb
+ dpkg-gencontrol -isp -ptwoftpd-run -P'$(DIR)'-run
+ dpkg -b '$(DIR)'-run ..
+
+binary: binary-indep binary-arch
+
+.PHONY: patch build build-arch build-indep clean install install-arch \
+install-indep binary-arch binary-indep binary
+
+include debian/implicit
diff --git a/debian/twoftpd-run.README.Debian b/debian/twoftpd-run.README.Debian
new file mode 100644
index 0000000..3eeb0e9
--- /dev/null
+++ b/debian/twoftpd-run.README.Debian
@@ -0,0 +1,32 @@
+twoftpd-run for Debian
+----------------------
+
+This package sets up the twoftpd service to listen on 0.0.0.0:21, and
+additionally provides a service directory to set up an anonymous twoftpd
+service.
+
+The twoftpd service directory is /etc/twoftpd/, the twoftpd-anon service
+directory is /etc/twoftpd-anon/. The installation of this package
+automatically adds the twoftpd service to runit's service supervision
+through the update-service(8) program. Please see the documentation of
+the runit package on how this works.
+
+To enable the twoftpd-anon anonymous ftp service, just run the
+update-service(8) program manually, e.g.
+
+ # update-service --add /etc/twoftpd-anon
+
+Note that you cannot run the default twoftpd and twoftpd-anon services
+simultaneously unless you specify separate IP addresses or ports for the
+services to listen on. To do so, edit the corresponding run scripts
+/etc/twoftpd/run and /etc/twoftpd-anon/run.
+
+The twoftpd-run package provides the virtual package ``ftp-server'' and
+conflicts with other packages providing ``ftp-server''. This ensures that
+twoftpd is the only service that listens on the address 0.0.0.0:21 on a
+system, and also satisfies packages that depend on a running ftp service.
+The twoftpd package without the twoftpd-run package can be installed
+alongside other ftp-server packages on a system, e.g. to provide different
+ftp services on different addresses simultaneously.
+
+ -- Gerrit Pape <pape@smarden.org>, Sun, 24 Aug 2003 19:08:49 +0200
diff --git a/debian/twoftpd-run.conffiles b/debian/twoftpd-run.conffiles
new file mode 100644
index 0000000..ccf0159
--- /dev/null
+++ b/debian/twoftpd-run.conffiles
@@ -0,0 +1,11 @@
+/etc/twoftpd/log/run
+/etc/twoftpd/env/CHROOT
+/etc/twoftpd/run
+/etc/twoftpd-anon/log/run
+/etc/twoftpd-anon/env/CHROOT
+/etc/twoftpd-anon/env/GID
+/etc/twoftpd-anon/env/GROUP
+/etc/twoftpd-anon/env/HOME
+/etc/twoftpd-anon/env/UID
+/etc/twoftpd-anon/env/USER
+/etc/twoftpd-anon/run
diff --git a/debian/twoftpd-run.postinst b/debian/twoftpd-run.postinst
new file mode 100644
index 0000000..206418b
--- /dev/null
+++ b/debian/twoftpd-run.postinst
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'configure' || exit 0
+
+getent passwd ftp >/dev/null || \
+ adduser --system --home /var/ftp --no-create-home ftp
+getent passwd ftplog >/dev/null || \
+ adduser --system --home /nonexistent --no-create-home ftplog
+
+READD=twoftpd
+test -z "$2" || dpkg --compare-versions "$2" gt '1.21-4' || {
+ update-service --remove /etc/twoftpd 2>/dev/null || :
+ if update-service --check twoftpd-anon; then
+ update-service --remove /etc/twoftpd-anon || :
+ READD=twoftpd-anon
+ fi
+ sleep 6
+ for i in twoftpd twoftpd-anon; do
+ rm -rf /var/run/$i /var/run/$i.log
+ done
+}
+update-service --add /etc/$READD
+
+test -z "$2" || exit 0
+
+# new install
+chown ftplog:adm /var/log/twoftpd /var/log/twoftpd-anon
+chmod 2750 /var/log/twoftpd /var/log/twoftpd-anon
diff --git a/debian/twoftpd-run.postrm b/debian/twoftpd-run.postrm
new file mode 100644
index 0000000..566dbc0
--- /dev/null
+++ b/debian/twoftpd-run.postrm
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'purge' || exit 0
+
+sv force-stop /etc/twoftpd /etc/twoftpd-anon >/dev/null 2>&1 || :
+sv force-stop /etc/twoftpd/log /etc/twoftpd-anon/log >/dev/null 2>&1 || :
+
+for i in twoftpd twoftpd-anon; do
+ rm -rf /etc/$i/supervise /etc/$i/log/supervise 2>/dev/null
+ rm -rf /var/lib/supervise/$i /var/lib/supervise/$i.log 2>/dev/null
+done
+
+for i in twoftpd twoftpd-anon; do
+ for j in '@*' current config lock state; do
+ rm -f /var/log/$i/$j
+ done
+ rmdir /var/log/$i || :
+done
+
+getent passwd ftp >/dev/null || getent passwd ftplog >/dev/null || exit 0
+if ! deluser --version >/dev/null 2>&1; then
+ echo 'deluser program not available, not removing system users "ftp", "ftplog".' >&2
+ exit 0
+fi
+deluser ftp
+deluser ftplog
diff --git a/debian/twoftpd-run.prerm b/debian/twoftpd-run.prerm
new file mode 100644
index 0000000..ab7d84a
--- /dev/null
+++ b/debian/twoftpd-run.prerm
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+test "$1" = 'remove' || test "$1" = 'deconfigure' || \
+ test "$1" = 'failed-upgrade' || exit 0
+
+for i in twoftpd twoftpd-anon; do
+ update-service --remove /etc/$i 2>/dev/null || :
+done
diff --git a/debian/twoftpd.README.Debian b/debian/twoftpd.README.Debian
new file mode 100644
index 0000000..280d4a8
--- /dev/null
+++ b/debian/twoftpd.README.Debian
@@ -0,0 +1,49 @@
+twoftpd for Debian
+------------------
+
+The binaries are installed in /usr/bin/. Normally the twoftpd services are
+run under tcpserver from the ucspi-tcp package, set up with the daemontools
+package to log to a multilog process.
+
+In Debian, the twoftpd-conf and twoftpd-anon-conf programs are changed to
+create service directories that utilize programs from the runit and ipsvd
+packages instead.
+
+If you want to run twoftpd as default ftp service on your machine, install
+the twoftpd-run package. The twoftpd-run package sets up the twoftpd service
+to listen on 0.0.0.0:21, and additionally provides a service directory to set
+up an anonymous twoftpd service.
+
+If you want another ftp-server to be installed as the default, and to run a
+twoftpd service for example on a virtual interface, you can use the
+twoftpd-conf program to create a service directory
+
+ # twoftpd-conf logacct /etc/twoftpd4 /var/log/twoftpd4 cvm 1.2.3.4 1
+
+where logacct is a user name, the logging process will run under the uid
+and gid of logacct; /etc/twoftpd4 is the service directory; /var/log/twoftpd4
+is the log directory; 1.2.3.4 the IP address the service listens on, and cvm
+is a credential validation module (from the cvm package, .e.g. cvm-unix).
+
+To configure an anonymous twoftpd service, use the twoftpd-anon-conf program
+
+ # twoftpd-anon-conf acct logacct /etc/twoftpd-anon4 /var/log/twoftpd-anon4 \
+ /var/ftp 1.2.3.4
+
+where acct and logacct are user names, the twoftpd-anon process will run
+under the uid and gid of acct, and the logging process will run under the
+uid and gid of logacct; /etc/twoftpd-anon4 is the service directory;
+/var/log/twoftpd-anon4 is the log directory; and /var/ftp is the ftp root.
+
+To enable twoftpd services, make sure that the ipsvd and runit packages
+are installed, and runit's service supervision is enabled. Then use the
+update-service(8) program, e.g.
+
+ # update-service --add /etc/twoftpd-anon4
+
+The service will be started within 5 seconds and automatically on system
+boot.
+
+Running twoftpd services from inetd is no longer supported by this package.
+
+ -- Gerrit Pape <pape@smarden.org>, Sat, 05 Jul 2003 15:37:17 +0200
diff --git a/debian/twoftpd.docs b/debian/twoftpd.docs
new file mode 100644
index 0000000..2cae48c
--- /dev/null
+++ b/debian/twoftpd.docs
@@ -0,0 +1,9 @@
+ANNOUNCEMENT
+NEWS
+README
+TODO
+VERSION
+twoftpd-auth.1.html
+twoftpd-switch.1.html
+twoftpd-xfer.1.html
+debian/README.Debian.diet