switchsh (0~20070801-3) debian-dir only changes

Summary

 debian/changelog                |   26 ++++++++++++++++++++++++++
 debian/compat                   |    1 +
 debian/control                  |   20 ++++++++++++++++++++
 debian/copyright                |   18 ++++++++++++++++++
 debian/dirs                     |    1 +
 debian/manpages                 |    1 +
 debian/patches/series           |    1 +
 debian/patches/use_execvp.patch |   14 ++++++++++++++
 debian/postinst                 |   11 +++++++++++
 debian/postrm                   |    9 +++++++++
 debian/rules                    |   17 +++++++++++++++++
 debian/switchsh.1               |   35 +++++++++++++++++++++++++++++++++++
 debian/watch                    |    4 ++++
 13 files changed, 158 insertions(+)

    
download this patch

Patch contents

--- switchsh-0~20070801.orig/debian/rules
+++ switchsh-0~20070801/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_HARDENING=1
+
+CFLAGS += -pedantic -Werror -Wextra -Wformat -Wformat-security
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+build/switchsh::
+	 $(CC) $(CFLAGS) -s switchsh.c -o switchsh
+
+install/switchsh::
+	cp switchsh $(DEB_DESTDIR)/usr/bin/
+
+clean::
+	$(RM) switchsh
--- switchsh-0~20070801.orig/debian/changelog
+++ switchsh-0~20070801/debian/changelog
@@ -0,0 +1,26 @@
+switchsh (0~20070801-3) unstable; urgency=low
+
+  * debian/rules:
+    + Dropped the non-linux bits as they are completely useless
+       since clone isn't available either.
+    + Include patchsys-quilt.mk
+  * debian/control: depend on quilt.
+  * use_execvp.patch: search for the executable in PATH (Closes: #503835)
+    - Thanks to Sven Joachim <svenjoac@gmx.de> for the suggestion and
+       pseudo patch.
+
+ -- Raphael Geissert <atomo64@gmail.com>  Wed, 29 Oct 2008 18:10:27 -0600
+
+switchsh (0~20070801-2) unstable; urgency=low
+
+  * debian/control:
+    + Added XS-DM-Upload-Allowed.
+    + Added VCS information.
+
+ -- Raphael Geissert <atomo64@gmail.com>  Sun, 12 Oct 2008 17:45:26 -0500
+
+switchsh (0~20070801-1) unstable; urgency=low
+
+  * Initial release. (Closes: #483490)
+
+ -- Raphael Geissert <atomo64@gmail.com>  Sun, 12 Oct 2008 17:26:04 -0500
--- switchsh-0~20070801.orig/debian/postrm
+++ switchsh-0~20070801/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "purge" ]; then
+	dpkg-statoverride --remove /usr/bin/switchsh || test $? -eq 2
+fi
+
+#DEBHELPER#
--- switchsh-0~20070801.orig/debian/manpages
+++ switchsh-0~20070801/debian/manpages
@@ -0,0 +1 @@
+debian/switchsh.1
--- switchsh-0~20070801.orig/debian/switchsh.1
+++ switchsh-0~20070801/debian/switchsh.1
@@ -0,0 +1,35 @@
+.\" Author: Raphael Geissert <atomo64@gmail.com>
+.\" Copyright (C) 2008 Raphael Geissert <atomo64@gmail.com>
+.\"
+.\" This is free software; you may redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as
+.\" published by the Free Software Foundation; either version 2,
+.\" or (at your option) any later version.
+.\"
+.\" This is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with the Debian GNU/Linux system; if not, write to the Free
+.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+.\" 02111-1307 USA
+.TH switchsh "1" "May 2008"
+.SH NAME
+switchsh \- wrapper bind-mount'ing bash as /bin/sh
+.SH SYNOPSIS
+switchsh command [args ...]
+.SH DESCRIPTION
+.B switchsh
+executes the given command bind-mounting bash as /bin/sh. This permits the usage 
+of bashisms by the command or its childs while having /bin/sh linked to whatever 
+shell interpreter is linked.
+.SH AUTHOR
+.TP
+switchsh, written by Marco d'Itri, available in the public domain.
+.PP
+This manual page was written by Raphael Geissert
+.nh
+<atomo64@gmail.com> 
+for the \fBDebian\fP system (but may be used by others).
--- switchsh-0~20070801.orig/debian/postinst
+++ switchsh-0~20070801/debian/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+bin=/usr/bin/switchsh
+
+if [ "$1" = "configure" ] && ! dpkg-statoverride --list $bin >/dev/null 2>&1; then
+	dpkg-statoverride --update --add root root 4755 $bin
+fi
+
+#DEBHELPER#
--- switchsh-0~20070801.orig/debian/copyright
+++ switchsh-0~20070801/debian/copyright
@@ -0,0 +1,18 @@
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
+Upstream-Author: Marco d'Itri <md@linux.it>
+Original-Source-Location: http://www.linux.it/~md/software/
+Packaged-By: Raphael Geissert <atomo64@gmail.com>
+Packaged-Date: Wed, 28 May 2008 19:03:57 -0500
+
+Files: switchsh.c
+License: PD
+ Written by Marco d'Itri <md@linux.it>, released to the public domain.
+
+Files: debian/*
+Copright: Copyright 2008, Raphael Geissert <atomo64@gmail.com>
+License: GPL-2+
+ The Debian packaging is available under the terms of the
+ GNU General Public License version 2 or (at your option) any later version.
+ .
+ On Debian systems, the complete text of the GNU General Public
+ License version 2 can be found in the file '/usr/share/common-licenses/GPL-2'.
--- switchsh-0~20070801.orig/debian/control
+++ switchsh-0~20070801/debian/control
@@ -0,0 +1,20 @@
+Source: switchsh
+Section: utils
+Priority: optional
+Maintainer: Raphael Geissert <atomo64@gmail.com>
+Build-Depends: debhelper (>= 5), cdbs, hardening-wrapper, quilt
+Standards-Version: 3.8.0
+Homepage: http://www.linux.it/~md/software/
+XS-DM-Upload-Allowed: yes
+Vcs-Git: git://git.debian.org/git/users/atomo64-guest/switchsh.git
+Vcs-Browser: http://git.debian.org/?p=users/atomo64-guest/switchsh.git
+
+Package: switchsh
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: bind-mount bash as /bin/sh
+ Small program to bind-mount bash as /bin/sh for its child processes.
+ .
+ It can be used when bash is not the default shell interpreter but a given
+ program makes use of bashisms (features not required by Policy for sh) and one
+ wants to run it without changing (or can not change) the default sh.
--- switchsh-0~20070801.orig/debian/watch
+++ switchsh-0~20070801/debian/watch
@@ -0,0 +1,4 @@
+#
+# Upstream does not use versions; thus it is, at the moment, impossible to
+# check for new upstream versions.
+#
--- switchsh-0~20070801.orig/debian/dirs
+++ switchsh-0~20070801/debian/dirs
@@ -0,0 +1 @@
+/usr/bin/
--- switchsh-0~20070801.orig/debian/compat
+++ switchsh-0~20070801/debian/compat
@@ -0,0 +1 @@
+5
\ No newline at end of file
--- switchsh-0~20070801.orig/debian/patches/series
+++ switchsh-0~20070801/debian/patches/series
@@ -0,0 +1 @@
+use_execvp.patch
--- switchsh-0~20070801.orig/debian/patches/use_execvp.patch
+++ switchsh-0~20070801/debian/patches/use_execvp.patch
@@ -0,0 +1,14 @@
+Use execvp so the executable is searched for in PATH
+Index: switchsh/switchsh.c
+===================================================================
+--- switchsh.orig/switchsh.c
++++ switchsh/switchsh.c
+@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
+     if (setuid(getuid()) < 0)
+ 	err_sys("cannot drop UID 0");
+ 
+-    execv(*argv, argv);
++    execvp(*argv, argv);
+     err_sys("Can't exec %s", argv[0]);
+ }
+