~ubuntu-branches/ubuntu/natty/rssh/natty-updates

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Bazaar Package Importer
  • Author(s): Russ Allbery
  • Date: 2008-07-13 13:09:38 UTC
  • mfrom: (4.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080713130938-1n0f27usm9rm61w0
Tags: 2.3.2-8
* The upstream mkchroot script uses echo -e, so make it a /bin/bash
  script, which is less invasive than rewriting all of the echo
  statements to printf.  Thanks, Raphael Geissert.  (Closes: #489653)
* Update standards version to 3.8.0.
  - Add a README.source file pointing to the quilt documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
 
1
#! /bin/sh
2
2
# postinst script for rssh
3
 
#
4
 
# see: dh_installdeb(1)
5
 
 
6
 
action=$1
7
 
oldversion=$2
8
 
 
9
 
# Use debconf.
10
 
. /usr/share/debconf/confmodule
11
 
 
12
 
 
13
 
rm -rf "$tempdir"
14
 
 
15
 
case "$1" in
16
 
    configure)
17
 
    # see below
18
 
    ;;
19
 
 
20
 
    abort-upgrade|abort-remove|abort-deconfigure)
21
 
        exit 0
22
 
    ;;
23
 
 
24
 
    *)
25
 
        echo "postinst called with unknown argument \`$1'" >&2
26
 
        exit 1
27
 
    ;;
28
 
esac
29
 
 
30
 
[ -e /usr/share/debconf/confmodule ] && {
31
 
        db_get rssh/chroot_helper_setuid
32
 
        setuid="$RET"
33
 
}
34
 
 
35
 
if [ ! -x /usr/sbin/dpkg-statoverride ] || \
36
 
     ! dpkg-statoverride --list /usr/lib/rssh/rssh_chroot_helper >/dev/null ; then
37
 
        if [ "$setuid" = "true" ] ; then
38
 
                chmod 4755 /usr/lib/rssh/rssh_chroot_helper
39
 
        elif [ "$setuid" = "false" ] ; then
40
 
                chmod 0755 /usr/lib/rssh/rssh_chroot_helper
41
 
        fi
42
 
fi
43
 
 
44
 
#db_get rssh/update-config-pre-2.2
45
 
#upgrade="$RET"
46
 
#if [ x"$upgrade" = "xtrue" ]; then
47
 
#       upgrade_config
48
 
#fi
49
 
 
50
 
db_go || true
51
 
db_stop
52
 
 
53
 
if [ -x /usr/sbin/add-shell ]; then
54
 
        /usr/sbin/add-shell /usr/bin/rssh
 
3
 
 
4
set -e
 
5
 
 
6
# Path to the helper program, which we may make setuid.
 
7
helper=/usr/lib/rssh/rssh_chroot_helper
 
8
 
 
9
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
 
10
    . /usr/share/debconf/confmodule
 
11
    db_get rssh/chroot_helper_setuid
 
12
    setuid="$RET"
 
13
    db_stop
 
14
 
 
15
    # We don't want to change the setuid status if the sysadmin has overridden
 
16
    # it with dpkg-statoverride.
 
17
    if dpkg-statoverride --list "$helper" > /dev/null ; then
 
18
        status=0
 
19
    else
 
20
        status=1
 
21
    fi
 
22
    if [ "$status" != 0 ] ; then
 
23
        if [ "$setuid" = "true" ] ; then
 
24
            chmod 4755 "$helper"
 
25
        else
 
26
            chmod 0755 "$helper"
 
27
        fi
 
28
    fi
 
29
 
 
30
    # Older versions of rssh incorrectly added rssh to /etc/shells.  We don't
 
31
    # want that.  Remove it from /etc/shells to clean up after older
 
32
    # packages.  See Bug#424672.
 
33
    if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.3.2-5 ; then
 
34
        remove-shell /usr/bin/rssh
 
35
    fi
55
36
fi
56
37
 
57
38
#DEBHELPER#
58
39
 
59
40
exit 0
60