wok view bash/receipt @ rev 17186

bash: CVE-2014-7169 fix
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 02 18:55:18 2014 +0200 (2014-10-02)
parents 63618ce04c4a
children 121d29ca7ca8
line source
1 # SliTaz package receipt.
3 PACKAGE="bash"
4 VERSION="4.2"
5 CATEGORY="system-tools"
6 SHORT_DESC="The GNU bourne SHell."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL3"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.gnu.org/software/bash/"
11 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 DEPENDS="readline"
14 BUILD_DEPENDS="readline bison"
16 # Rules to compile & install the temporary toolchain.
17 cook_tmp_toolchain()
18 {
19 cd $src
20 # CVE-2014-6271
21 patch -p0 < $stuff/funcdef-import-4.2.patch
22 # CVE-2014-7169
23 patch -p0 < $stuff/CVE-2014-7169.patch
24 ./configure --without-bash-malloc &&
25 make && make install
26 }
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 # Patch and then build.
32 cd $src
33 # CVE-2014-6271
34 patch -p0 < $stuff/funcdef-import-4.2.patch
35 # Skip tests that can not run while cross-compiling.
36 cat > config.cache << "EOF"
37 ac_cv_func_mmap_fixed_mapped=yes
38 ac_cv_func_strcoll_works=yes
39 ac_cv_func_working_mktime=yes
40 bash_cv_func_sigsetjmp=present
41 bash_cv_getcwd_malloc=yes
42 bash_cv_job_control_missing=present
43 bash_cv_printf_a_format=yes
44 bash_cv_sys_named_pipes=present
45 bash_cv_ulimit_maxfds=yes
46 bash_cv_under_sys_siglist=yes
47 bash_cv_unusable_rtsigs=no
48 gt_cv_int_divbyzero_sigfpe=yes
49 EOF
50 ./configure \
51 $CONFIGURE_ARGS \
52 --cache-file=config.cache \
53 --bindir=/bin \
54 --enable-history --enable-alias \
55 --disable-nls --without-bash-malloc \
56 --disable-help-builtin \
57 --with-installed-readline &&
58 make &&
59 # Bash doesn't care about DESTDIR in environnment variable.
60 make DESTDIR=$DESTDIR install
61 }
63 # Rules to gen a SliTaz package suitable for Tazpkg.
64 genpkg_rules()
65 {
66 cp -a $install/bin $fs
67 # Config files.
68 #
69 mkdir $fs/etc
70 cp $stuff/example.bashrc $fs/etc/bashrc
71 }
74 post_install()
75 {
76 local root
77 root=$1
78 echo "Processing post-install commands..."
79 echo -n "Do you want to set Bash to default (y/N) ? : "
80 read -t 30 anser
81 if [ "$anser" == "y" ]; then
82 echo ""
83 echo "Setting bash as default for all users"
84 sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" /etc/passwd
85 sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" /etc/passwd
86 sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" /etc/passwd
87 sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" /etc/passwd
88 echo "Creating .bashrc file for all users"
89 for i in `ls -d /home/*`
90 do
91 cp /etc/bashrc $i/.bashrc
92 done
93 cp /etc/bashrc /root/.bashrc
94 cp /etc/bashrc /etc/skel/.bashrc
95 fi
96 }
99 pre_remove()
100 {
101 local root
102 root=$1
103 echo "Setting back sh as default for all users"
104 sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" /etc/passwd
105 if [ -f /etc/skel/.bashrc ]; then
106 rm /etc/skel/.bashrc
107 fi
108 }