debian/0000755000000000000000000000000011765263726007205 5ustar debian/rules0000755000000000000000000000041511765261267010263 0ustar #!/usr/bin/make -f CFLAGS += -D_LARGEFILE64_SOURCE %: dh $@ override_dh_auto_configure: sed -i -e "s/cc \(.*\)/cc ${CFLAGS} \1/" conf-cc sed -i -e "s/cc -s/cc ${LDFLAGS}/" conf-ld # Skip running make check, as it isn't useful for us override_dh_auto_test: true debian/compat0000644000000000000000000000000211764472257010403 0ustar 9 debian/safecat.docs0000644000000000000000000000000711347156323011450 0ustar README debian/safecat.examples0000644000000000000000000000002511347156323012336 0ustar maildir.sh maildir.1 debian/safecat.install0000644000000000000000000000002011347156323012161 0ustar safecat usr/bin debian/control0000644000000000000000000000112711765263700010601 0ustar Source: safecat Section: utils Priority: optional Maintainer: Teemu Hukkanen Build-Depends: groff-base, debhelper (>= 9) Standards-Version: 3.9.3 Homepage: http://pobox.com/~lbudney/linux/software/safecat.html Package: safecat Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Safely copy stdin to a file Safecat is a program which implements Daniel Bernstein's maildir algorithm to copy stdin safely to a file in a specified directory. It can be used to write mail messages to a qmail-style maildir, or to write data to a "spool" directory reliably. debian/patches/0000755000000000000000000000000011764620113010616 5ustar debian/patches/01-respect-umask.patch0000644000000000000000000000105311650767000014640 0ustar Description: Use a permissive mode for the output file by default This allows modifying the mode by using umask. Origin: vendor Bug-Debian: http://bugs.debian.org/211546 --- a/safecat.c +++ b/safecat.c @@ -95,7 +95,7 @@ /* Step 4: Create the file tempdir/time.MusecPpid.host */ alarm(86400); - outfd = open(tmppath.s,O_WRONLY | O_EXCL | O_CREAT | O_LARGEFILE,0644); + outfd = open(tmppath.s,O_WRONLY | O_EXCL | O_CREAT | O_LARGEFILE,0666); if(outfd == -1) { strerr_die2sys(111,"safecat: fatal: ","couldn't create output file: "); } debian/patches/04-manpage-dashes.patch0000644000000000000000000000066611764620025014747 0ustar Description: Quote dashes in manpage --- a/safecat.1 +++ b/safecat.1 @@ -219,8 +219,8 @@ try() { $* 2>/dev/null || echo NO 1>&2 } set `( try $MYPROGRAM | try safecat $TEMPDIR $DESTDIR ) 2>&1` -test "$?" = "0" || exit -1 -test "$1" = "NO" && { rm -f $DESTDIR/$2; exit -1; } +test "$?" = "0" || exit \-1 +test "$1" = "NO" && { rm \-f $DESTDIR/$2; exit \-1; } .sp .fi This script illustrates the pitfalls of writing secure programs debian/patches/02-do-not-mention-procmail.patch0000644000000000000000000000223311764620051016532 0ustar Description: Remove mention of procmail from manpage Bug-Debian: http://bugs.debian.org/479020 --- safecat-1.13.orig/safecat.1 +++ safecat-1.13/safecat.1 @@ -152,34 +152,6 @@ consider converting your inbox to for its superior reliability. If your home directory is NFS mounted, qmail forces you to use .IR maildir . -On the downside, the lovely tool -.IR procmail , -which filters your spam, does not know -.IR maildir . -Rather than running the patched -.IR procmail , -you might consider -using -.I safecat -to deliver to your inbox. That allows you to use the latest -.I procmail -without waiting for the -.I maildir -patches to be applied to it. - -(Note: the previous paragraph was written before -.I procmail -started handling maildir delivery. Since maildir delivery has been added, -my point is made -.IR stronger ! -.IR Procmail 's -maildir support does not comply with Dan's algorithm, and so does -not offer the reliability promised by maildir delivery. -.I Procmail -plus -.I safecat -has always offered reliable maildir delivery. Another victory for -modularity!) If you write CGI applications to collect data over the World Wide Web, you might find debian/patches/03-no-RPLINE-DTLINE.patch0000644000000000000000000000135211764620033014441 0ustar Description: Do not add RPLINE and DTLINE to files Qmail includes the contents of the environment variables RPLINE and DTLINE in files written to a Maildir. This is unnecessary with safecat. Bug-Debian: http://bugs.debian.org/240647 --- a/writefile.c +++ b/writefile.c @@ -24,12 +24,14 @@ substdio_fdbuf(&ssout,write,fd,outbuf,sizeof(outbuf)); /* Print DTLINE and RPLINE, if supplied. */ + /* dtline = env_get("DTLINE"); rpline = env_get("RPLINE"); if (dtline && rpline) { if(substdio_puts(&ssout,rpline) == -1) goto fail; if(substdio_puts(&ssout,dtline) == -1) goto fail; } + */ /* Copy stdin to the output file, watching the return values each time. */ if (substdio_copy(&ssout,&ssin) < 0) goto fail; debian/patches/series0000644000000000000000000000015211764617542012045 0ustar 01-respect-umask.patch 02-do-not-mention-procmail.patch 03-no-RPLINE-DTLINE.patch 04-manpage-dashes.patch debian/changelog0000644000000000000000000000622611765261275011062 0ustar safecat (1.13-2) unstable; urgency=low * Bump to debhelper compatibility level 9. * Ignore source changes to conf-(cc|ld) (Closes: #643268). * Do not include RPLINE and DTLINE environment variables in files (Closes: #240647). * Add patch quoting dashes in the manpage. * Update watch file. * Rewrite copyright file in machine readable format. * Bump to Standards-Version 3.9.3, no changes needed. -- Teemu Hukkanen Sat, 09 Jun 2012 11:05:20 +0100 safecat (1.13-1) unstable; urgency=low * Add watch file. * Minimal rules file with debhelper. * Add Homepage control field. * Remove obsolete references to procmail from the manpage (Closes: #479020). * Update Standards-Version to 3.8.4.0. * Update to new source format (3.0 (quilt)). * Make the mode for creating new files more permissive to allow changing it with umask (Closes: #211546). * For completeness, update to new upstream version (no code changes). -- Teemu Hukkanen Sun, 14 Mar 2010 15:28:01 +0200 safecat (1.12-1) unstable; urgency=low * New upstream release. Includes largefile patch and some typo fixes. * Effectively rebuilds, fixing relocation error (Closes: #321608) * debian/rules: respects DEB_BUILD_OPTIONS. * Removed debian/one-liners.txt, updated debian/copyright accordingly. * Updated to Standards-Version 3.6.2.0. -- Teemu Hukkanen Sat, 17 Sep 2005 02:15:17 +0300 safecat (1.11-1) unstable; urgency=low * New upstream release. (Closes: #224798) * Updated upstream URL. * Updated to Standards-Version 3.6.1.0. * No longer breaks on input stream longer than 2GB. Thanks to Kai Hendry for kicking me into doing this. (Closes: #222124) -- Teemu Hukkanen Tue, 10 Feb 2004 23:08:38 +0200 safecat (1.9-1) unstable; urgency=low * New upstream version. (Contains fixes for Solaris) (Closes: #158826) * Fix build for Hurd. (Closes: #112859) * And just for completeness, include maildir script in examples. (Closes: #132520) * Upgraded to Standards-Version 3.5.7.0. * Cleanups proposed by linda: * Upstream Author(s) -> Upstream Author in debian/copyright * No upstream changelog -> Install CHANGES as changelog -- Teemu Hukkanen Mon, 21 Oct 2002 18:55:44 +0300 safecat (1.8-1) unstable; urgency=low * New upstream version. -- Teemu Hukkanen Wed, 13 Jun 2001 20:20:44 +0300 safecat (1.4-1) unstable; urgency=low * New upstream version. No changes to the binaries. -- Teemu Hukkanen Sat, 25 Nov 2000 19:08:33 +0200 safecat (1.3-1) unstable; urgency=low * New upstream version. -- Teemu Hukkanen Sun, 23 Jul 2000 01:57:38 +0300 safecat (1.0-2) unstable; urgency=low * Cleaned up the rules. -- Teemu Hukkanen Thu, 2 Dec 1999 14:37:56 +0200 safecat (1.0-1) unstable; urgency=low * New upstream version. * FHS * Added one-liners.html from upstream website -- Teemu Hukkanen Tue, 26 Oct 1999 19:30:22 +0300 safecat (0.1-1) unstable; urgency=low * Initial Release. -- Teemu Hukkanen Mon, 18 Jan 1999 09:18:17 +0200 debian/source/0000755000000000000000000000000011764603471010477 5ustar debian/source/format0000644000000000000000000000001411347203012011665 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000004511764603460012112 0ustar extend-diff-ignore = "conf-(cc|ld)$" debian/copyright0000644000000000000000000001130111764620702011122 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: http://pobox.com/~lbudney/linux/software/safecat.html Files: * Copyright: 2000-2001, Len Budney License: Copying permissions for safecat comes in two parts: . 1. All code written by me is offered under the BSD license. See below for the text of the BSD license. Original content is clearly marked with a copyright notice and my name. . 2. Other components of the package, like the programs ``setup'' and ``instcheck'', were derived from code written by Dan Bernstein. Dan has not specified the licensing of (some of) his code; some of his code he has released into the public domain. . My best understanding of Dan's position, based on what he has written on the subject, is that he doesn't mind if people borrow his code--as long as you make supporting that code your own problem. In particular, the following considerations apply: . a. If you have problems with safecat or anything in this distribution, contact me about it--. Do NOT bother Dan. . b. If you think you've found problems in Dan's code, as contained in this distribution, contact me first anyway. If I can verify that the bug exists and isn't mine, I'll pass the info on to Dan. Do NOT bother Dan. . c. If you want to use Dan's code for your own projects, then 1) you do so at your own risk, and 2) you should assume full responsibility for maintenance of your project, including borrowed code, just as I'm doing here for safecat. . The BSD License states: . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . - All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. . - Neither name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: debian/* Copyright: 1999-2012, Teemu Hukkanen License: BSD-2-clause Copyright (c) 1999-2012, Teemu Hukkanen All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/watch0000644000000000000000000000014211764620676010233 0ustar version=3 http://pobox.com/~lbudney/linux/software/safecat.html \ safecat/safecat-(.*)\.tar\.gz debian/safecat.manpages0000644000000000000000000000001211347156323012307 0ustar safecat.1