--- switchsh-0~20070801.orig/debian/changelog
+++ switchsh-0~20070801/debian/changelog
@@ -0,0 +1,41 @@
+switchsh (0~20070801-3.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Remount / with MS_SLAVE|MS_REC inside the CLONE_NEWNS namespace so
+    that the bind mount doesn't affect the entire system (closes: #762892)
+
+ -- Gilles Filippini <pini@debian.org>  Wed, 25 May 2016 18:20:23 +0200
+
+switchsh (0~20070801-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Define _GNU_SOURCE to be able to use CLONE_NEWNS flag (Closes: #701454)
+
+ -- Jonathan Wiltshire <jmw@tiger-computing.co.uk>  Wed, 05 Jun 2013 09:39:47 +0100
+
+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/compat
+++ switchsh-0~20070801/debian/compat
@@ -0,0 +1 @@
+5
\ No newline at end of file
--- 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/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/dirs
+++ switchsh-0~20070801/debian/dirs
@@ -0,0 +1 @@
+/usr/bin/
--- switchsh-0~20070801.orig/debian/manpages
+++ switchsh-0~20070801/debian/manpages
@@ -0,0 +1 @@
+debian/switchsh.1
--- switchsh-0~20070801.orig/debian/patches/gnu_source.patch
+++ switchsh-0~20070801/debian/patches/gnu_source.patch
@@ -0,0 +1,19 @@
+Description: define _GNU_SOURCE to use CLONE_NEWNS flag
+ The current source assumes this is available; it is really a GNU extension
+Author: Jonathan Wiltshire <jmw@tiger-computing.co.uk>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701454
+Forwarded: no
+Last-Update: 2013-06-05
+
+--- a/switchsh.c
++++ b/switchsh.c
+@@ -12,6 +12,9 @@
+  * Written by Marco d'Itri <md@linux.it>, released to the public domain.
+  */
+ 
++/* Needed for CLONE_NEWNS */
++#define _GNU_SOURCE
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
--- switchsh-0~20070801.orig/debian/patches/remount_rootfs_rslave.patch
+++ switchsh-0~20070801/debian/patches/remount_rootfs_rslave.patch
@@ -0,0 +1,21 @@
+Description: When / is mounted as shared, unshare(CLONE_NEWNS) doesn't
+ prevent the bind mount to be system wide. Worse: it isn't unmounted
+ at exit.
+ Thus this patch wich remount / with --make-rslave.
+ See #739593 for more details.
+Author: Gilles Filippini <pini@debian.org>
+Bug-Debian: https://bugs.debian.org/762892
+Index: switchsh-0~20070801/switchsh.c
+===================================================================
+--- switchsh-0~20070801.orig/switchsh.c
++++ switchsh-0~20070801/switchsh.c
+@@ -105,7 +105,8 @@ int main(int argc, char *argv[])
+     }
+ #endif
+ 
+-    if (mount("/bin/bash", "/bin/sh", NULL, MS_BIND, NULL) < 0) {
++    if ((mount("", "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) ||
++        (mount("/bin/bash", "/bin/sh", NULL, MS_BIND, NULL) < 0)) {
+ 	if (errno == EPERM)
+ 	    err_quit("This program must be setuid root!");
+ 	err_sys("mount");
--- switchsh-0~20070801.orig/debian/patches/series
+++ switchsh-0~20070801/debian/patches/series
@@ -0,0 +1,3 @@
+use_execvp.patch
+gnu_source.patch
+remount_rootfs_rslave.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]);
+ }
+ 
--- 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/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/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/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/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.
+#
