--- sash-3.7.orig/Makefile +++ sash-3.7/Makefile @@ -13,13 +13,12 @@ HAVE_BSD_MOUNT = 0 MOUNT_TYPE = '"ext3"' - -CFLAGS = -O3 -Wall -Wmissing-prototypes \ - -DHAVE_GZIP=$(HAVE_GZIP) \ +DEFS = -DHAVE_GZIP=$(HAVE_GZIP) \ -DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \ -DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \ -DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \ -DMOUNT_TYPE=$(MOUNT_TYPE) +CFLAGS = -O3 -Wall -Wmissing-prototypes -g $(DEFS) LDFLAGS = -static -s LIBS = -lz @@ -43,4 +42,7 @@ cp sash $(BINDIR)/sash cp sash.1 $(MANDIR)/sash.1 +%.o: %.c + $(CC) $(CFLAGS) $(DEFS) -c $< + $(OBJS): sash.h --- sash-3.7.orig/sash.c +++ sash-3.7/sash.c @@ -132,9 +132,9 @@ }, { - "exit", do_exit, 1, 1, + "exit", do_exit, 1, 2, "Exit from sash", - "" + "[exit value]" }, { @@ -399,12 +399,14 @@ const char * commandFile; BOOL quietFlag; BOOL aliasFlag; + BOOL interactiveFlag; char buf[PATH_LEN]; singleCommand = NULL; commandFile = NULL; quietFlag = FALSE; aliasFlag = FALSE; + interactiveFlag = FALSE; /* * Look for options. @@ -419,11 +421,17 @@ while (*cp) switch (*cp++) { + case '-': + /* + * Ignore. This is so that we can be + * run from login. + */ + break; case 'c': /* * Execute specified command. */ - if ((argc != 1) || singleCommand) + if ((argc != 1) || singleCommand || interactiveFlag) usage(); singleCommand = *argv++; @@ -446,6 +454,18 @@ break; + case 'i': + /* + * Be an interactive shell + * ..is a no-op, but some contexts require this + * ..interactiveFlag is to avoid -ic as a legacy + */ + if (singleCommand) + usage(); + + interactiveFlag = TRUE; + break; + case 'p': /* * Set the prompt string. @@ -1152,13 +1172,6 @@ name = argv[1]; - if (access(name, 4)) - { - perror(name); - - return; - } - while (--sourceCount >= 0) { if (sourcefiles[sourceCount] != stdin) @@ -1168,7 +1181,7 @@ argv[argc] = NULL; execvp(name, (char **) argv + 1); - exit(1); + perror(name); } @@ -1270,7 +1283,7 @@ { fprintf(stderr, "Stand-alone shell (version %s)\n", version); fprintf(stderr, "\n"); - fprintf(stderr, "Usage: sash [-a] [-q] [-f fileName] [-c command] [-p prompt]\n"); + fprintf(stderr, "Usage: sash [-a] [-q] [-f fileName] [-c command] [-p prompt] [-i]\n"); exit(1); } --- sash-3.7.orig/cmds.c +++ sash-3.7/cmds.c @@ -337,12 +337,9 @@ if (fd >= 0) { close(fd); - - continue; - } - - if (utime(name, &now) < 0) + } else { perror(name); + } } } @@ -993,14 +990,18 @@ void do_exit(int argc, const char ** argv) { + int r = 0; if (getpid() == 1) { fprintf(stderr, "You are the INIT process!\n"); return; } - - exit(0); + if (argc == 2) + { + r = atoi(argv[1]); + } + exit(r); } --- sash-3.7.orig/cmd_chattr.c +++ sash-3.7/cmd_chattr.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include "sash.h" --- sash-3.7.orig/debian/compat +++ sash-3.7/debian/compat @@ -0,0 +1 @@ +7 --- sash-3.7.orig/debian/lintian-overrides +++ sash-3.7/debian/lintian-overrides @@ -0,0 +1,2 @@ +sash: statically-linked-binary ./bin/sash +sash: embedded-zlib ./bin/sash --- sash-3.7.orig/debian/changelog +++ sash-3.7/debian/changelog @@ -0,0 +1,373 @@ +sash (3.7-9) unstable; urgency=low + + * Drop dependency on lockfile-progs, no longer needed. + * Drop versioned dependency on passwd, that version is pre-oldstable + * Drop versioned conflicts on fileutils, that version is pre-oldstable. + * Move to debhelper 7 instead of cdbs. + * Add missing set -e to postrm. + * Drop full paths to add-shell and remove-shell. + * Add lintian override for embedded zlib. + + -- Tollef Fog Heen Fri, 09 Oct 2009 09:15:48 +0200 + +sash (3.7-8) unstable; urgency=medium + + * Get rid of the sashroot account and all debconfiscation (but don't + change already-set up systems). + Closes: #410758, #400892, #482900, #489380 + * Unconditionally remove sashroot when removing the package. + Closes: #464610 + * Call add-shell when upgrading from etch or older. Closes: #416059. + * Remove -s from LDFLAGS. Closes: #437952 + * Stop setting PATH in postinst. + * Update to newest policy version + - Add Homepage field. + + -- Tollef Fog Heen Mon, 21 Jul 2008 13:45:15 +0200 + +sash (3.7-7.3) unstable; urgency=low + + * Non-maintainer upload to fix pending l10n issues + * Debconf translations: + - Dutch. Closes: #414751 + - Spanish. Closes: #415201 + - French converted to UTF-8 + - Finnish. Closes: #472616 + - Basque. Closes: #475359 + - Galician. Closes: #475462 + * [Lintian] Change menu entry to Applications/Shells + * Upgrade Standards from 3.6.1 to 3.7.3 (checked) + + -- Christian Perrier Tue, 25 Mar 2008 18:23:28 +0100 + +sash (3.7-7.2) unstable; urgency=low + + * NMU + * Apparently CDBS decided to start overwriting the LDFLAGS setting, which + made sash no longer statically linked. Work around this brain-damage. + Closes: #403659 + + -- Joey Hess Tue, 19 Dec 2006 18:16:21 -0500 + +sash (3.7-7.1) unstable; urgency=low + + * Non-maintainer upload to fix longstanding l10n issues + * Rewrite templates to better fit the Developer's Reference recommendations + This also Closes: #368750 + * Debconf translation updates: + - Swedish added. Closes: #338776 + - French updated. Sent during the call for updates of the NMU campaign. + - Vietnamese updated. Sent during the call for updates of the NMU campaign. + - Dzongkha added. Sent during the call for updates of the NMU campaign. + - German added. Sent during the call for updates of the NMU campaign. + - Russian added. Sent during the call for updates of the NMU campaign. + + -- Christian Perrier Wed, 29 Nov 2006 07:40:31 +0100 + +sash (3.7-7) unstable; urgency=low + + * Remove /usr/doc/sash symlink if it exists. (closes: #322797) + * Fix up debconf dependency, we want debconf | debconf-2.0 + + -- Tollef Fog Heen Thu, 1 Sep 2005 07:52:20 +0200 + +sash (3.7-6) unstable; urgency=high + + * Tighten zlib build-deps to fix security issue (closes: #318069) + * Add Czech debconf translation (closes: #294777) + * Add Vietnamese debconf translation (closes: #317886) + + -- Tollef Fog Heen Thu, 14 Jul 2005 12:33:51 +0200 + +sash (3.7-5) unstable; urgency=low + + * Add Japanese debconf translation (closes: #290129) + * Add German debconf translation (closes: #266357) + + -- Tollef Fog Heen Sat, 5 Feb 2005 12:57:59 +0100 + +sash (3.7-4) unstable; urgency=low + + * Add French debconf translation (closes: #232979) + * Add lintian override (closes: #235306) + + -- Tollef Fog Heen Thu, 1 Apr 2004 03:42:48 +0200 + +sash (3.7-3) unstable; urgency=low + + * Use po-debconf. + + -- Tollef Fog Heen Tue, 10 Feb 2004 03:12:41 +0100 + +sash (3.7-2) unstable; urgency=low + + * Fix versioned depends on passwd. (closes: #229192) + + -- Tollef Fog Heen Fri, 23 Jan 2004 17:57:59 +0100 + +sash (3.7-1) unstable; urgency=low + + * New upstream release + - Fixes (closes: #227164) + * Only ask about deleting sashroot account if it's actually + created. (closes: #225341) + * Ask about removing sashroot user in prerm instead of when + installing. (closes: #227637) + + -- Tollef Fog Heen Tue, 13 Jan 2004 00:41:55 +0100 + +sash (3.6-5) unstable; urgency=low + + * Remove -m call to useradd. (closes: #225093) + * Up standards-version. + + -- Tollef Fog Heen Fri, 26 Dec 2003 22:57:29 +0100 + +sash (3.6-4) unstable; urgency=medium + + * Use chown root:shadow instead of root.shadow in sashconfig + (closes: #217395) + * Depend on passwd (>= 20000902-12) (closes: #219961) + * Use debconf. (closes: #86208, #96566) + - Thereby getting rid of sashconfig. Yay. + * Build-dep on e2fslibs-dev, since it seems like libc6 broke us. + (closes: #223203) + + -- Tollef Fog Heen Wed, 17 Dec 2003 23:00:13 +0100 + +sash (3.6-3) unstable; urgency=low + + * .. and add build-deps for debhelper (closes: #216746) + + -- Tollef Fog Heen Tue, 21 Oct 2003 21:19:54 +0200 + +sash (3.6-2) unstable; urgency=low + + * Add build-deps for cdbs (closes: #216499) + + -- Tollef Fog Heen Sun, 19 Oct 2003 12:16:43 +0200 + +sash (3.6-1) unstable; urgency=low + + * Adopt package (closes: #215544) + * New upstream release + * Ack NMUs, (closes: #137947, #117065, #91634, #109027, #170081, #125332) + * Redo packaging using CDBS. + * Remove obsolete emacs vars in changelog. + * Ignore -- in option list (closes: #95374) + + -- Tollef Fog Heen Fri, 17 Oct 2003 13:17:02 +0200 + +sash (3.4-8.3) unstable; urgency=low + + * NMU + * Trivial bugfix for #125332 (Closes: #125332) + * debian/rules: must call dpkg-genchanges with -isp, otherwise it + won't get into the binary package control files. (Closes: #170081) + + -- Hwei Sheng Teoh Thu, 21 Nov 2002 13:38:31 -0500 + +sash (3.4-8.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/control: Build-depend on a version of zlib without the + double-free bug (closes: #137947). + + -- Colin Watson Sun, 17 Mar 2002 13:58:46 +0000 + +sash (3.4-8.1) unstable; urgency=low + + * NMU + * Make unstable have at least the same rev as stable. Changelog change only. + + -- LaMont Jones Thu, 25 Oct 2001 09:42:55 -0600 + +sash (3.4-8) stable; urgency=low + + * control file cleanup + + -- Raul Miller Mon, 21 May 2001 10:42:50 -0400 + +sash (3.4-7) stable; urgency=low + + * incorporated workaround for dpkg breakage on /usr/doc -> /usr/share/doc + (fixes #91634) + * adopted adrian bunk's suggestions for build-depends (fixes #94329) + * this version being new, will be newer than that in potato (fixes #97561) + * no Section: problem was apparently caused by build tools -- a test build + shows that 3.4-7 has Section: shells (fixes #84494) + * not fixed: no debconf support yet. I'm still considering legacy issues. + * not fixed: support for -- as end of options indicator. Meaningless, + as sash takes no non-options arguments (it's not designed for scripts). + + -- Raul Miller Sat, 19 May 2001 19:36:52 -0400 + +sash (3.4-6) stable; urgency=medium + + * incorporated suggestion from Matt Zimmerman + such that clone_root_as_sashroot is properly atomic, even + for ownership and permissions. + + -- Raul Miller Wed, 17 Jan 2001 12:47:42 -0500 + +sash (3.4-5) stable; urgency=medium + + * fix up /etc/shadow to give group shadow read access + + -- Raul Miller Tue, 16 Jan 2001 11:47:27 -0500 + +sash (3.4-4) stable; urgency=high + + * umask 077 before cloning /etc/shadow (fixes #81793) + [ouch] + + -- Raul Miller Wed, 10 Jan 2001 20:42:15 -0500 + +sash (3.4-3) unstable; urgency=low + + * put back /usr/doc/sash if helper programs fail to provide it + + -- Raul Miller Fri, 15 Oct 1999 18:55:13 -0400 + +sash (3.4-2) unstable; urgency=low + + * set permissions on sashconfig from debian/rules (Fixes #47307) + + -- Raul Miller Wed, 13 Oct 1999 13:16:49 -0400 + +sash (3.4-1) unstable; urgency=low + + * new upstream version, adds -ar command for debian + * cleaned up handling of Q option in prompts, fixes (#46054, #46820) + * rewrote README.debian with some minor hints about usage (fixes #45617) + + -- Raul Miller Thu, 7 Oct 1999 23:10:19 -0400 + +sash (3.3-7) unstable; urgency=high + + * Re-invented sash config system again. This time with a rich set of + prompts, and the option to record them so they need be answered + only once. (fixes #45617) This reinstates /var/lib/sash/. + * Mentioned init=/bin/sash at boot prompt (fixes #45547) + * rm -rf /var/lib/sash/ at package purge time (fixes #27770) + * make #include conditional in cmds.c + + -- Raul Miller Thu, 23 Sep 1999 22:13:43 -0400 + +sash (3.3-6) unstable; urgency=low + + * rewrote postinst to support NIS (fixes #45467) + * removed empty /var/lib/sash/ + * use -Os (instead of -O3) for smaller footprint + [At the moment, this results in no measurable change -- + and most of the footprint is from libc. I'm leaving it + in for documentation purposes.] + + -- Raul Miller Sun, 19 Sep 1999 08:32:29 -0400 + +sash (3.3-5) unstable; urgency=low + + * added Depends: lockfile-progs (needed for new postinst/prerm) + + -- Raul Miller Sun, 19 Sep 1999 01:04:38 -0400 + +sash (3.3-4) unstable; urgency=low + + * rebuilt using altgcc (cuts executable size ~44%) + + -- Raul Miller Fri, 3 Sep 1999 18:51:39 -0400 + +sash (3.3-3) unstable; urgency=low + + * removed yet more junk files from diff + + -- Raul Miller Fri, 3 Sep 1999 18:51:34 -0400 + +sash (3.3-2) unstable; urgency=low + + * removed junk file from diff + + -- Raul Miller Fri, 3 Sep 1999 18:37:33 -0400 + +sash (3.3-1) unstable; urgency=low + + * new upstream version + * use $(CC) in makefile in place of cc (#31220) + * completely rewrote postinst and replaced postrm with new prerm (#27632, #41968) + * simplified error handling for failed -touch (#43428) + * upgraded to upstream version 3.3 (#39145) + + -- Raul Miller Fri, 3 Sep 1999 18:03:00 -0400 + +sash (2.1-5) unstable; urgency=low + + * New maintainer done properly + + -- Raul Miller Fri, 3 Sep 1999 18:01:14 -0400 + +sash (2.1-4) unstable; urgency=low + + * Use $PATH in exec [#25034] + * New maintainer + + -- Raul Miller Thu, 27 Aug 1998 12:19:33 -0400 + +sash (2.1-3) frozen unstable; urgency=low + + * correct root shell if package is removed + + -- Michael Meskes Fri, 20 Mar 1998 14:11:28 +0100 + +sash (2.1-2) unstable; urgency=low + + * Fixed postinst (#19584) + * Added -i option (#19656) + + -- Michael Meskes Mon, 16 Mar 1998 15:23:44 +0100 + +sash (2.1-1) unstable; urgency=low + + * New upstream version: David incorporated most of my changes except that + he wants sash to print a message everytime it starts. But he has added + an option -q to get it quiet. I hope that solves the problem as well. + + -- Michael Meskes Mon, 9 Mar 1998 13:42:33 +0100 + +sash (2.0-3) unstable; urgency=low + + * corrected argv handling for exec call (#18695) + * reworked postinst/prerm to make installation ask less questions + + -- Michael Meskes Fri, 27 Feb 1998 08:57:00 +0100 + +sash (2.0-2) unstable; urgency=low + + * sash no longer prints a message every time you invoke it (#18580) + + -- Michael Meskes Fri, 27 Feb 1998 08:57:00 +0100 + +sash (2.0-1) unstable; urgency=low + + * New upstream version + + -- Michael Meskes Fri, 30 Jan 1998 10:25:59 +0100 + +sash (1.0-3) unstable; urgency=low + + * Added -c option which fixes the problem with su as well as bug (#17573). + + -- Michael Meskes Thu, 29 Jan 1998 09:38:41 +0100 + +sash (1.0-2) unstable; urgency=low + + * Added section entry. + + -- Michael Meskes Tue, 16 Dec 1997 11:05:51 +0100 + +sash (1.0-1) unstable; urgency=low + + * Initial Release. + + -- Michael Meskes Tue, 16 Dec 1997 11:05:51 +0100 + + --- sash-3.7.orig/debian/README.debian +++ sash-3.7/debian/README.debian @@ -0,0 +1,49 @@ +sash for DEBIAN +-------------------------- +[random tips and comments] +-------------------------- + +In an emergency, you can run linux (just barely) with just the linux +kernel, a boot loader (such as lilo), and /bin/sash. Use the boot loader +to start linux with the option: init=/bin/sash + +For a list of built-in sash commands, type help + +You may or may not be able to log in using sash on a damaged system. +People with real experience on damaged systems who have simple +suggestions on how sash could be made more robust in this circumstance +are invited to file wishlist bugs against the sash package. + +If you wish to avoid the overhead of rebooting in an emergency the best +option is probably to keep a sash root account always logged in. This +can be a security problem unless you lock the session with a program +such as vlock. At the moment, vlock is only useful at the linux console. + + +-------------------------- + +To take apart a debian .deb file with sash, use +-ar x filename.deb + +This will create three files: +control.tar.gz data.tar.gz debian-binary + +See section 7 of the debian FAQ (and the documentation it references) +for more details on the contents of the two tar.gz files (a copy of the +debian FAQ is supplied in the doc-debian package). + + +-------------------------- + +If you plan on being able to use sash for emergency repair work, make +sure that you understand what each of the built in commands does. This +is best accomplished by reading the manual page for the full featured +counterpart, and performing some controlled tests under non-emergency +conditions. + +It's probably a also good idea to have a small partition with a copy +of the debian base system on it. There are some good low-level tools +for creating/repairing file systems, sash doesn't substitute for these. +Also, sash doesn't provide any networking tools. It's a good idea to +have a stock of rescue floppies, and distribution cdroms. And none of +these precautions substitute for decent backups. --- sash-3.7.orig/debian/postinst +++ sash-3.7/debian/postinst @@ -0,0 +1,19 @@ +#! /bin/sh +# postinst for sash +# + +set -e + +if [ "$1" = "configure" ] && [ "$2" = "" ] || dpkg --compare-versions "$2" lt "3.7-7.3"; then + # initial install or upgrade from old version which didn't call + # add-shell properly. + add-shell /bin/sash +fi + +# Make sure we get rid of any stuff in /usr/doc +if [ -L "/usr/doc/sash" ]; then + rm -f "/usr/doc/sash" +fi + + +#DEBHELPER# --- sash-3.7.orig/debian/dirs +++ sash-3.7/debian/dirs @@ -0,0 +1,3 @@ +bin +usr/share/man/man1 +usr/share/lintian/overrides/ --- sash-3.7.orig/debian/prerm +++ sash-3.7/debian/prerm @@ -0,0 +1,20 @@ +#!/bin/sh +# prerm for sash +# make sure that accounts using sash will +# at least continue to work after sash is removed... + +set -e + +if [ "$1" = remove ]; then + if [ "$(getent passwd | grep ^sashroot:)" != "" ]; then + userdel sashroot + fi + for sashacct in $(getent passwd | \ + awk -F: '{if ($7 == "/bin/sash") {print $1}}'); do + chsh -s /bin/bash $sashacct || true + done +fi + +#DEBHELPER# + +exit 0 --- sash-3.7.orig/debian/control +++ sash-3.7/debian/control @@ -0,0 +1,36 @@ +Source: sash +Section: shells +Priority: optional +Maintainer: Tollef Fog Heen +Standards-Version: 3.8.0 +Build-Depends: zlib1g-dev (>= 1:1.2.2-7), debhelper (>= 7), e2fslibs-dev + +Package: sash +Architecture: any +Section: shells +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: doc-debian +Description: Stand-alone shell + sash serves as an interactive substitute for /bin/sh, for use when + /bin/sh is unusable. It's statically linked, and includes many standard + utilities as builtins (type "help" at the prompt for a reference list). + If you've installed sash before rendering your system unbootable, and + you have some knowledge of how your system is supposed to work, you might + be able to repair your system using init=/bin/sash at the boot prompt. + . + Some people also prefer to have sash available as the shell for a + root account (perhaps an under an alternate name such as sashroot) + Configuration support is included for people who want this. + . + Note: sash is not intended to serve as /bin/sh, and has few of the + interactive features present in bash or ksh. It's designed to be simple + and robust, for people who need to do emergency repair work on a system. + . + Also note: sash doesn't include a built-in fsck -- fsck is too big + and complicated. If you need fsck, you'll have to get at least one + partition or disk working well enough to run fsck. More generally, + sash is but one tool of many (backups, backup recovery tools, emergency + boot disks or partitions, spare parts, testing of disaster plans, + etc.) to help you recover a damaged system. +Homepage: http://members.tip.net.au/~dbell/ --- sash-3.7.orig/debian/copyright +++ sash-3.7/debian/copyright @@ -0,0 +1,29 @@ +This package was debianized by Michael Meskes on +Tue, 16 Dec 1997 11:05:51 +0100, and is currently being maintained by +Tollef Fog Heen . Please see the Debian changelog +for the history of who maintained the package when. + +It was downloaded from +http://www.tip.net.au/~dbell/programs/sash-3.4.tar.gz + +New versions will probably be announced at +http://www.tip.net.au/~dbell/. + +Copyright: + + * Copyright (c) 1998 by David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + +The code for the internal ar command has the copyright: + + * Original: + * Copyright (c) 1999 by Aaron R. Crane. + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Modified: + * Copyright (c) 1999 by David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + --- sash-3.7.orig/debian/rules +++ sash-3.7/debian/rules @@ -0,0 +1,13 @@ +#! /usr/bin/make -f + +pkgdir := `pwd`/debian/sash + +%: + dh $@ + +override_dh_auto_install: + make install BINDIR=$(pkgdir)/bin MANDIR=$(pkgdir)/usr/share/man/man1 + +override_dh_install: + dh_install + install -m 0644 debian/lintian-overrides $(pkgdir)/usr/share/lintian/overrides/sash --- sash-3.7.orig/debian/menu +++ sash-3.7/debian/menu @@ -0,0 +1 @@ +?package(sash):needs="text" section="Applications/Shells" title="Sash" command="/bin/sash" --- sash-3.7.orig/debian/postrm +++ sash-3.7/debian/postrm @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +case "$1" in + purge) + rm -rf /var/lib/sash/ + ;; + remove) + remove-shell /bin/sash + ;; +esac + +#DEBHELPER#