--- empty-expect-0.6.17b.orig/empty.c +++ empty-expect-0.6.17b/empty.c @@ -38,6 +38,9 @@ #endif +#define _GNU_SOURCE +#include + #include #include @@ -206,12 +209,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; @@ -484,7 +503,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); --- empty-expect-0.6.17b.orig/empty.1 +++ empty-expect-0.6.17b/empty.1 @@ -175,6 +175,10 @@ .B empty session to a file. Marks >>> and <<< show the directions of data flow. .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.17b.orig/debian/compat +++ empty-expect-0.6.17b/debian/compat @@ -0,0 +1 @@ +5 --- empty-expect-0.6.17b.orig/debian/changelog +++ empty-expect-0.6.17b/debian/changelog @@ -0,0 +1,50 @@ +empty-expect (0.6.17b-1) unstable; urgency=low + + * New upstream release. + + -- Bart Martens Sat, 02 May 2009 17:41:07 +0200 + +empty-expect (0.6.16b-1) unstable; urgency=low + + * New upstream release. + + -- Bart Martens Wed, 31 Dec 2008 20:26:47 +0100 + +empty-expect (0.6.15b-1) unstable; urgency=low + + * New upstream release. + + -- Bart Martens Sat, 02 Feb 2008 08:34:02 +0100 + +empty-expect (0.6.14b-1) unstable; urgency=low + + * New upstream release. + + -- Bart Martens Wed, 05 Dec 2007 22:35:28 +0100 + +empty-expect (0.6.12b-1) unstable; urgency=low + + * New upstream release. + + -- Bart Martens 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 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 Thu, 02 Aug 2007 19:11:25 +0200 + +empty (0.6.11b-1) unstable; urgency=low + + * Initial release. Closes: #433844. + + -- Bart Martens Thu, 19 Jul 2007 20:49:02 +0200 + --- empty-expect-0.6.17b.orig/debian/control +++ empty-expect-0.6.17b/debian/control @@ -0,0 +1,19 @@ +Source: empty-expect +Section: interpreters +Priority: optional +Maintainer: Bart Martens +Build-Depends: cdbs, debhelper (>= 5) +Standards-Version: 3.8.1 +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.17b.orig/debian/install +++ empty-expect-0.6.17b/debian/install @@ -0,0 +1 @@ +empty usr/bin/ --- empty-expect-0.6.17b.orig/debian/copyright +++ empty-expect-0.6.17b/debian/copyright @@ -0,0 +1,43 @@ +This package was debianized by Bart Martens 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-2009 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-2009, Bart Martens +and is licensed under the GPL version 2, see `/usr/share/common-licenses/GPL-2'. --- empty-expect-0.6.17b.orig/debian/watch +++ empty-expect-0.6.17b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts="uversionmangle=s/(\d)[\-_]?(rc\d+|pre-rc\d+|pre\d+a?)$/$1~$2/;s/[\-\.](source|Source|src|orig|unix)$//;s/-(bin|osx)$/~$1/;s/^v(\d)/$1/;" \ +http://sf.net/empty/empty[\-_](v?[\d\.]+(?:rc|rc\d+|pre-rc\d+|-unix|-source|-Source|-src|\.src|\.orig|[a-z]|b\d+|beta\d+-src|beta\d+)?)\.(?:tar\.gz|tgz|tar\.bz2|zip|pm\.gz|jar|shar\.gz|shar\.Z) --- empty-expect-0.6.17b.orig/debian/manpages +++ empty-expect-0.6.17b/debian/manpages @@ -0,0 +1 @@ +empty.1 --- empty-expect-0.6.17b.orig/debian/rules +++ empty-expect-0.6.17b/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.17b.orig/debian/examples +++ empty-expect-0.6.17b/debian/examples @@ -0,0 +1 @@ +examples/*