--- empty-expect-0.6.15b.orig/debian/examples
+++ empty-expect-0.6.15b/debian/examples
@@ -0,0 +1 @@
+examples/*
--- empty-expect-0.6.15b.orig/debian/copyright
+++ empty-expect-0.6.15b/debian/copyright
@@ -0,0 +1,43 @@
+This package was debianized by Bart Martens <bartm@knars.be> on
+Thu, 19 Jul 2007 20:49:02 +0200.
+
+It was downloaded from http://empty.sourceforge.net/
+
+Copyright and license:
+
+/* empty - run processes under pseudo-terminal sessions
+ * 
+ * Copyright (C) 2005-2007 Mikhail E. Zakharov
+ * empty was written by Mikhail E. Zakharov. This software was based on the 
+ * basic idea of pty version 4.0 Copyright (c) 1992, Daniel J. Bernstein, but
+ * no code was ported from pty4.
+ * 
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *  
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice immediately at the beginning of the file, without modification,
+ *     this list of conditions, and the following disclaimer.
+ *  2. 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.
+ *  3. The name of the author may not be used to endorse or promote products
+ *     derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+The Debian packaging is
+Copyright (C) 2007, Bart Martens <bartm@knars.be>
+and is licensed under the GPL version 2, see `/usr/share/common-licenses/GPL-2'.
--- empty-expect-0.6.15b.orig/debian/manpages
+++ empty-expect-0.6.15b/debian/manpages
@@ -0,0 +1 @@
+empty.1
--- empty-expect-0.6.15b.orig/debian/install
+++ empty-expect-0.6.15b/debian/install
@@ -0,0 +1 @@
+empty usr/bin/
--- empty-expect-0.6.15b.orig/debian/changelog
+++ empty-expect-0.6.15b/debian/changelog
@@ -0,0 +1,44 @@
+empty-expect (0.6.15b-1~bpo40+1) etch-backports; urgency=low
+
+  * Backport for stable.
+
+ -- Bart Martens <bartm@debian.org>  Wed,  6 Feb 2008 21:23:06 +0100
+
+empty-expect (0.6.15b-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Bart Martens <bartm@debian.org>  Sat, 02 Feb 2008 08:34:02 +0100
+
+empty-expect (0.6.14b-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Bart Martens <bartm@debian.org>  Wed, 05 Dec 2007 22:35:28 +0100
+
+empty-expect (0.6.12b-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Bart Martens <bartm@debian.org>  Sun, 04 Nov 2007 18:47:14 +0100
+
+empty-expect (0.6.11b-3) unstable; urgency=low
+
+  * empty.1, empty.c: Changed default mode of the log file from 0700 to 0600,
+    and added option "--logfile-mode=mode".  Closes: #443448.
+
+ -- Bart Martens <bartm@knars.be>  Sun, 23 Sep 2007 08:54:08 +0200
+
+empty-expect (0.6.11b-2) unstable; urgency=low
+
+  * debian/changelog, debian/control: Source and binary package renamed as
+    requested by ftpmaster.
+
+ -- Bart Martens <bartm@knars.be>  Thu, 02 Aug 2007 19:11:25 +0200
+
+empty (0.6.11b-1) unstable; urgency=low
+
+  * Initial release.  Closes: #433844.
+
+ -- Bart Martens <bartm@knars.be>  Thu, 19 Jul 2007 20:49:02 +0200
+
--- empty-expect-0.6.15b.orig/debian/watch
+++ empty-expect-0.6.15b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/empty/empty-(.*)\.t.*
--- empty-expect-0.6.15b.orig/debian/compat
+++ empty-expect-0.6.15b/debian/compat
@@ -0,0 +1 @@
+5
--- empty-expect-0.6.15b.orig/debian/rules
+++ empty-expect-0.6.15b/debian/rules
@@ -0,0 +1,6 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/makefile.mk
+
+DEB_INSTALL_CHANGELOGS_ALL += CHANGELOG
--- empty-expect-0.6.15b.orig/debian/control
+++ empty-expect-0.6.15b/debian/control
@@ -0,0 +1,19 @@
+Source: empty-expect
+Section: interpreters
+Priority: optional
+Maintainer: Bart Martens <bartm@debian.org>
+Build-Depends: cdbs, debhelper (>= 5)
+Standards-Version: 3.7.3
+Homepage: http://empty.sourceforge.net/
+
+Package: empty-expect
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Run processes and applications under pseudo-terminal
+ empty is a utility that provides an interface to execute and/or interact with
+ processes under pseudo-terminal sessions (PTYs). This tool is useful in
+ programming of shell scripts designed to communicate with interactive programs
+ like telnet, ssh, ftp, etc. In some cases empty can be the simplest
+ replacement for TCL/expect or other similar programming tools because empty
+ can be easily invoked directly from shell prompt or script, and does not use
+ TCL, Perl, PHP, Python or anything else as an underlying language.
--- empty-expect-0.6.15b.orig/empty.1
+++ empty-expect-0.6.15b/empty.1
@@ -175,6 +175,10 @@
 .B empty
 session to a file.
 .TP
+\-\-logfile-mode=mode
+This option allows to choose the mode of the log file created with the -L option.
+The default mode is 0600.
+.TP
 \-p file.pid
 Save PID of empty daemon process to a file
 .TP
--- empty-expect-0.6.15b.orig/empty.c
+++ empty-expect-0.6.15b/empty.c
@@ -38,6 +38,9 @@
 #endif
 
 
+#define _GNU_SOURCE
+#include <getopt.h>
+
 #include <unistd.h>
 #include <sys/types.h>
 
@@ -202,12 +205,28 @@
 	int	pgrp;
 #endif
 
+	unsigned int logfile_mode = S_IRUSR | S_IWUSR; // was: S_IRWXU;
+
+	static struct option long_options[] =
+	{
+		{ "logfile-mode", 1, 0, 0 },
+		{ NULL, 0, 0, 0 }
+	};
+
+	int option_index = -1;
+
 #ifndef __linux__
 	while ((ch = getopt(argc, argv, "Scvhfrb:kwslp:i:o:t:L:")) != -1)
 #else
-	while ((ch = getopt(argc, argv, "+Scvhfrb:kwslp:i:o:t:L:")) != -1)
+	while ((ch = getopt_long(argc, argv, "+Scvhfrb:kwslp:i:o:t:L:", long_options, &option_index)) != -1)
 #endif
 		switch (ch) {
+			case 0:
+				if( option_index >= 0
+				&& strcmp( long_options[option_index].name, "logfile-mode" ) == 0
+				&& optarg )
+					sscanf( optarg, "%o", &logfile_mode );
+				break;
 			case 'f':
 				fflg = 1;
 				break;
@@ -477,7 +496,7 @@
 	}
 
 	if (Lflg)
-		if ((lfd = open(sl, O_CREAT|O_WRONLY|O_APPEND, S_IRWXU)) == -1)
+		if ((lfd = open(sl, O_CREAT|O_WRONLY|O_APPEND, logfile_mode)) == -1)
 			(void)syslog(LOG_NOTICE,
 				"Warning: Can't open %s for session-log %m", sl);
 
