- fixevi za datum u changelogu
[php-suhosin-cn.git] / debian / postinst
1 #!/bin/sh
2 # postinst script for proftpd-cn
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 #        * <postinst> `configure' <most-recently-configured-version>
10 #        * <old-postinst> `abort-upgrade' <new version>
11 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12 #          <new-version>
13 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
14 #          <failed-install-package> <version> `removing'
15 #          <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
18 #
19
20 case "$1" in
21     configure|reconfigure)
22       # continue below
23     ;;
24
25     *)
26         exit 0
27     ;;
28 esac
29
30 # Import CN toolsa
31 . /usr/share/carnet-tools/functions.sh
32
33 CONF=/etc/php5/conf.d/suhosin.ini
34
35 if [ -e "$CONF" ]; then
36     echo "CN: Enabling Suhosin tuneups"    
37     cp -a "$CONF" "$CONF.$$"
38     cp-update --comment ';' php-suhosin-cn "$CONF.$$" <<EOF
39 suhosin.cookie.max_name_length=1024
40 suhosin.cookie.max_vars=1024
41 suhosin.get.max_array_depth=1024
42 suhosin.get.max_name_length=1024
43 suhosin.get.max_value_length=307200
44 suhosin.get.max_vars=1024
45 suhosin.post.max_array_depth=1024
46 suhosin.post.max_name_length=1024
47 suhosin.post.max_value_length=307200
48 suhosin.post.max_vars=1024
49 suhosin.request.max_array_depth=1024
50 suhosin.request.max_value_length=307200
51 suhosin.request.max_varname_length=1024
52 suhosin.request.max_vars=1024
53 EOF
54         cp_mv "$CONF.$$" "$CONF"
55 fi
56
57 # reload Apache
58 if apache2ctl configtest 2>/dev/null; then
59     echo "CN: Reloading Apache..."
60     invoke-rc.d apache2 force-reload || true
61 else
62     echo "CN: Your Apache2 configuration is either broken or nonexistant"
63 fi
64
65 # dh_installdeb will replace this with shell code automatically
66 # generated by other debhelper scripts.
67
68 #DEBHELPER#
69
70 exit 0