source: projects/specs/branches/6/b/bash/bash-vl.spec @ 8971

Revision 8971, 16.3 KB checked in by iwamoto, 10 years ago (diff)

bash: fix CVE-2014-7169

Line 
1%define bashversion 4.2
2%define patchlevel 8
3
4Summary:      The GNU Bourne Again shell (bash).
5Summary(ja):  GNU Bourne Again シェル (bash).
6
7Name:         bash
8Version:      %{bashversion}.%{patchlevel}
9Release:      5%{?_dist_release}
10
11Group:        System Environment/Shells
12License:      GPLv2+
13
14Vendor:       Project Vine
15Distribution: Vine Linux
16
17Source0:      ftp://ftp.gnu.org/pub/gnu/bash/bash-%{bashversion}.tar.gz
18Source10:     bashrc-vine
19
20# Official upstream patches
21Patch1: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-001
22Patch2: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-002
23Patch3: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-003
24Patch4: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-004
25Patch5: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-005
26Patch6: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-006
27Patch7: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-007
28Patch8: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-008
29
30# Other patches
31Patch101: bash-2.02-security.patch
32Patch102: bash-2.03-paths.patch
33Patch103: bash-2.03-profile.patch
34Patch104: bash-2.05a-interpreter.patch
35Patch105: bash-2.05b-debuginfo.patch
36Patch106: bash-2.05b-manso.patch
37Patch107: bash-2.05b-pgrp_sync.patch
38Patch108: bash-2.05b-readline-oom.patch
39Patch109: bash-2.05b-xcc.patch
40Patch110: bash-3.2-audit.patch
41Patch111: bash-3.2-ssh_source_bash.patch
42Patch112: bash-bashbug.patch
43Patch113: bash-infotags.patch
44Patch114: bash-requires.patch
45Patch115: bash-setlocale.patch
46Patch116: bash-tty-tests.patch
47
48# 484809, check if interp section is NOBITS
49Patch117: bash-4.0-nobits.patch
50
51# Do the same CFLAGS in generated Makefile in examples
52Patch118: bash-4.1-examples.patch
53
54# Builtins like echo and printf won't report errors
55# when output does not succeed due to EPIPE
56Patch119: bash-4.1-broken_pipe.patch
57
58# Enable system-wide .bash_logout for login shells
59Patch120: bash-4.2-rc2-logout.patch
60
61# Static analyzis shows some issues in bash-2.05a-interpreter.patch
62Patch121: bash-4.2-coverity.patch
63
64# security
65Patch1000: bash-4.2_CVE-2012-3410.patch
66Patch1010: bash-4.2_CVE-2014-6271.patch
67Patch1020: bash-4.2_CVE-2014-7169.patch
68
69Buildroot:    %{_tmppath}/%{name}-%{version}-root
70BuildRequires: texinfo, bison, ncurses-devel, autoconf, gettext
71Obsoletes:    bash <= 1.14.7
72Obsoletes:    bash2
73
74
75%description
76Bash is a GNU project sh-compatible shell or command language
77interpreter. Bash (Bourne Again shell) incorporates useful features
78from the Korn shell (ksh) and the C shell (csh). Most sh scripts
79can be run by bash without modification.
80
81Bash offers several improvements over sh, including command line
82editing, unlimited size command history, job control, shell
83functions and aliases, indexed arrays of unlimited size and
84integer arithmetic in any base from two to 64. Bash is ultimately
85intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and
86Tools standard.
87
88
89%package doc
90Summary:  Documentation for the GNU Bourne Again shell (bash).
91Summary:  GNU Bourne Again シェル向けドキュメント
92Group:    Applications/Documentation
93Requires: %{name} = %{version}-%{release}
94
95Obsoletes: bash2-doc
96
97%description doc
98This is a separate documentation package for the GNU Bourne
99Again shell.
100
101
102%prep
103%setup -q -n %{name}-%{bashversion}
104
105# Official upstream patches
106%patch1 -p0 -b .001
107%patch2 -p0 -b .002
108%patch3 -p0 -b .003
109%patch4 -p0 -b .004
110%patch5 -p0 -b .005
111%patch6 -p0 -b .006
112%patch7 -p0 -b .007
113%patch8 -p0 -b .008
114
115# Other patches
116%patch101 -p1 -b .security
117%patch102 -p1 -b .paths
118%patch103 -p1 -b .profile
119%patch104 -p1 -b .interpreter
120%patch105 -p1 -b .debuginfo
121%patch106 -p1 -b .manso
122%patch107 -p1 -b .pgrp_sync
123%patch108 -p1 -b .readline_oom
124%patch109 -p1 -b .xcc
125%patch110 -p1 -b .audit
126%patch111 -p1 -b .ssh_source_bash
127%patch112 -p1 -b .bashbug
128%patch113 -p1 -b .infotags
129%patch114 -p1 -b .requires
130%patch115 -p1 -b .setlocale
131%patch116 -p1 -b .tty_tests
132%patch117 -p1 -b .nobits
133%patch118 -p1 -b .examples
134%patch119 -p1 -b .broken_pipe
135%patch120 -p1 -b .logout
136%patch121 -p1 -b .coverity
137
138%patch1000 -p1 -b .CVE-2012-3410
139%patch1010 -p2 -b .CVE-2014-6271
140%patch1020 -p1 -b .CVE-2014-7169
141
142echo %{version} > _distribution
143echo %{release} |sed 's/vl.*//' > _patchlevel
144
145
146%build
147%configure --with-bash-malloc=no
148make CPPFLAGS="-D_GNU_SOURCE -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
149
150%install
151rm -rf %{buildroot}
152
153# Fix bug #83776
154perl -pi -e 's,bashref\.info,bash.info,' doc/bashref.info
155
156make DESTDIR=$RPM_BUILD_ROOT install
157
158pushd $RPM_BUILD_ROOT
159 mkdir ./bin
160 mv ./usr/bin/bash ./bin/bash
161 ln -s bash ./bin/sh
162 rm -f .%{_infodir}/dir
163popd
164
165ln -s bash.1 %{buildroot}%{_mandir}/man1/sh.1
166
167# make manpages for bash builtins as per suggestion in DOC/README
168pushd doc
169sed -e '
170/^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{
171/^\.SH NAME/d
172s/^bash, //
173s/\\- bash built-in commands, see \\fBbash\\fR(1)$//
174s/,//g
175b
176}
177d
178' builtins.1 > man.pages
179for i in echo pwd test kill; do
180  perl -pi -e "s,$i,,g" man.pages
181  perl -pi -e "s,  , ,g" man.pages
182done
183
184install -c -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1
185
186for i in `cat man.pages` ; do
187  echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1
188  chmod 0644 ${RPM_BUILD_ROOT}%{_mandir}/man1/$i.1
189done
190
191mkdir -p $RPM_BUILD_ROOT/etc/profile.d/
192install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/etc/bashrc
193
194# Not for printf, false and true (conflict with coreutils)
195rm -f $RPM_BUILD_ROOT%{_mandir}/man1/printf.1
196rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/true.1
197rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/false.1
198
199popd
200
201%find_lang %{name}
202
203
204%clean
205rm -rf %{buildroot}
206
207# ***** bash doesn't use install-info. It's always listed in %{_infodir}/dir
208# to prevent prereq loops
209
210# post is in lua so that we can run it without any external deps.  Helps
211# for bootstrapping a new install.
212# Jesse Keating 2009-01-29 (code from Ignacio Vazquez-Abrams)
213%post -p <lua>
214bashfound = false;
215shfound = false;
216f = io.open("/etc/shells", "r");
217if f == nil
218then
219  f = io.open("/etc/shells", "w");
220else
221  repeat
222    t = f:read();
223    if t == "/bin/bash"
224    then
225      bashfound = true;
226    end
227    if t == "/bin/sh"
228    then
229      shfound = true;
230    end
231  until t == nil;
232end
233f:close()
234 
235f = io.open("/etc/shells", "a");
236if not bashfound
237then
238  f:write("/bin/bash\n")
239end
240if not shfound
241then
242  f:write("/bin/sh\n")
243end
244f:close()
245
246%pretrans -p <lua>
247-- workaroud     --
248-- print("pretrans")
249os.execute("cp /etc/shells /tmp/etc_shells_XX")
250-- workaroud end --
251
252%posttrans -p <lua>
253-- workaroud     --
254-- print("posttrans")
255bashfound = false;
256shfound = false;
257f = io.open("/tmp/etc_shells_XX", "r");
258if f == nil
259then
260  f = io.open("/tmp/etc_shells_XX", "w");
261else
262  repeat
263    t = f:read();
264    if t == "/bin/bash"
265    then
266      bashfound = true;
267    end
268    if t == "/bin/sh"
269    then
270      shfound = true;
271    end
272  until t == nil;
273end
274f:close()
275 
276f = io.open("/tmp/etc_shells_XX", "a");
277if not bashfound
278then
279  f:write("/bin/bash\n")
280end
281if not shfound
282then
283  f:write("/bin/sh\n")
284end
285f:close()
286os.rename("/tmp/etc_shells_XX", "/etc/shells")
287-- workaroud end --
288
289%files -f %{name}.lang
290%defattr(-,root,root)
291%doc CHANGES COPYING
292%doc examples
293%config(noreplace) /etc/bashrc
294/bin/bash
295/bin/sh
296%{_infodir}/bash.info*
297%{_mandir}/*/*
298%{_mandir}/*/..1*
299%{_bindir}/bashbug
300
301
302%files doc
303%defattr(-,root,root)
304%doc COMPAT NEWS NOTES POSIX RBASH
305%doc examples/obashdb/ examples/functions/ examples/misc/
306%doc examples/scripts.noah/ examples/scripts.v2/ examples/scripts/
307%doc examples/startup-files/ examples/complete/ examples/loadables/
308%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
309%doc doc/FAQ doc/INTRO doc/article.ms doc/README
310
311
312%changelog
313* Thu Sep 25 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.2.8-5
314- add patch1020 for fix CVE-2014-7169 (imcomplite fix of CVE-2014-6271)
315
316* Thu Sep 25 2014 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.2.8-4
317- add patch1010 for fix CVE-2014-6271
318
319* Tue Oct  2 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.2.8-3
320- fix changelog ver number typo
321- remove postun script because bash is never uninstalled..
322- add workaround /etc/shells entry handling bug..
323- change doc dir name
324
325* Mon Sep 17 2012 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.2.8-2
326- add patch1000 for fix CVE-2012-3410 (/dev/fd)
327
328* Tue Apr 12 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.2.8-1
329- update to 4.2 patch level 8
330- use lua script in post/postun
331- update patches from fedora
332
333* Fri Sep 03 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 4.1-1
334- update to 4.1 patch level 7
335
336* Fri Mar  5 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-9
337- check if /bin/grep exists on %%post script
338
339* Fri Feb 12 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-8
340- rebuilt with gcc-4.4.3-3 on ppc
341
342* Tue Feb  2 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-7
343- rebuilt with new toolchain
344
345* Fri Dec  4 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-6
346- revert changes on 3.2-5 (avoid a nasty dependency loop on bootstrapping)
347
348* Fri Dec  4 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-5
349- add Requires(post): grep
350
351* Sat Oct 24 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 3.2-4
352- remove obsolete /bin/bash2 entry from /etc/shells
353
354* Mon Apr 27 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-3
355- add Requires(post): ncurses (should be added by find-requires..)
356
357* Mon Mar 29 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-2
358- add upstream patch (from 040 to 048)
359- build against ncurses-devel (libtinfo)
360- spec in utf-8
361
362* Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.2-1vl5
363- added upstream patch (from 026 to 039)
364- added Japanese summary
365- applied new versioning policy
366
367* Fri Jan 18 2008 Shu KONNO <owa@bg.wakwak.com> 3.2-0vl2
368- rebuilt with libtermcap-devel
369
370* Fri Oct 26 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 3.2-0vl1
371- new upstream release
372- add upstream patch (from 001 to 025)
373- remove Provides: bash2
374
375* Wed May 09 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.05b-0vl4
376- rebuilt with new toolchain
377
378* Mon Sep 11 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.05b-0vl3
379- change doc Group to Applications/Documentation. <BTS:VineLinux:163>
380- quote CPPFLAGS to avoid configure error. <BTS:VineLinux:173>
381
382* Mon Jun 28 2004 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.05b-0vl2
383- Don't read /etc/profile.d/*.sh in /etc/bashrc; done in /etc/profile
384
385* Wed Mar 10 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.05b-0vl1
386- update to 2.05b
387- rebuild with new toolchains
388- add make check
389- add %postun script based on Fedora development
390- README file moved doc package
391- update Patch5 and Patch8 from Fedora development
392- change Patch6
393- remove Patch2 and Patch100 (bash-2.05b supports multibyte string)
394- add Patch11--39 from Fedora development 2.05b-36
395  * Tim Waugh <twaugh@redhat.com>
396  - Fix parameter expansion in multibyte locales (bug #112657).
397  - Speed up UTF-8 command-line redrawing in the common case (bug #102353,
398    bug #110777).
399  - Apply upstream patches (bug #109269 among others).
400  - Fix bash.info (bug #83776).
401  - Add bash205b-007 patch to fix bug #106876.
402  - Avoid crashing on multibyte input when locale is set incorrectly
403    (bug #74266).
404  - LFS support (bug #103627).
405  - Fix completion display when multibyte or control characters are to be
406    shown (bug #90201).
407  - Fix a warning message (bug #79629).
408  - Don't build with AFS support (bug #86514).
409  - Don't explicitly strip binaries (bug #85995).
410  - Really fix bug #83331 for good.
411  - Fix builtins.1.
412  - Actually apply the patch (bug #83331).
413  - Fix history/UTF-8 bug (bug #83331).
414  - More tab-completion fixing (bug #72512).
415  - Force pgrp synchronization (bug #81653).
416  - Prevent prompt overwriting output (bug #74383).
417  - Fix '-rbash' (bug #78455).
418  - Add readline-init patch (bug #74925).
419  - Add the (4) patches from ftp.gnu.org (bug #75888, bug #72512).
420  - Ship '.' man page, which doesn't get picked up by glob.
421  - Locale shell variables fix (bug #74701).
422  * Elliot Lee <sopwith@redhat.com>
423  - (patch26) Don't call 'size' in makefile. Pointless, and interferes with
424    cross compiles.
425
426* Wed Oct  9 2002 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.05-0vl1
427- update to 2.05
428- add README.jpatch to %doc
429- remove patch4 (bash2): revert command name in man pages to "bash"
430  - fix perl command to remove man pages conflict with sh-utils
431- remove section of config.h.in from patch0 to prevent remake of configure
432- change patch9: define in config-top.h to avoid conflict with patch100
433- remove patches 7, 10 & 101
434
435* Mon Apr  8 2002 NISHIMURA Daisuke <nishi@graco.c.u-tokyo.ac.jp> 2.04-1vl14
436- made a link for man sh
437
438* Thu Nov 15 2001 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.04-1vl13
439- added missing %%post and %%triggerpostun section
440
441* Sun Jul 15 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
442- 2.04-1vl12
443- now bash2 is finally bash
444
445* Sun Jul 15 2001 Daisuke SUZUKI <daisuke@linux.or.jp> 2.04-1vl11
446- build for Playstation2
447
448* Mon Jun 11 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
449- 2.04-1vl10
450- Provides: bash = %%{version}
451
452* Thu Jun 07 2001 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl9
453- added Provides: bash
454
455* Thu Jun 07 2001 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl8
456- Obsoletes: bash
457- changed Copyright to License
458
459* Fri Dec 29 2000 Lisa Sagami <czs14350@mb.infoweb.ne.jp>
460- 2.04-1vl7
461- deleted: /etc/profile.d/alias.sh (which we have in /etc/skel/.bashrc)
462- corrected: bashrc-vine -> bashrc
463
464* Sat Dec 16 2000 Satoshi MACHINO  <machino@vinelinux.org> 2.04-1vl6
465- combined bash-1.x and bash-2.x packages
466- added some patches from bash-2.04-13mdk
467
468* Sun Dec 10 2000 Jun Nishii <jun@vinelinux.org> 2.04-1vl5
469- fix spec macros
470- added tests
471
472* Sun Nov 19 2000 Satoshi MACHINO <machino@vinelinux.org> 2.04-1vl5
473- build with gcc-2.95.3
474- partially used rpmmacros
475
476* Fri Sep  8 2000 Jun Nishii <jun@vinelinux.org>
477- minor bug fix in spec file
478
479* Sun Aug 27 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
480- 2.04-1vl3
481- modified %install and %files section to handle compressed man page(s)
482
483* Thu Mar 23 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
484- added pcomplete patch to fix complete if the candidate list is NULL.
485
486* Wed Mar 22 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
487- updated to 2.04
488
489* Fri Sep 14 1999 Dale Lovelace <dale@redhat.com>
490- Remove annoying ^H's from documentation
491
492* Fri Jul 16 1999 Ken Estes <kestes@staff.mail.com>
493- patch to detect what executables are required by a script.
494
495* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
496- auto rebuild in the new build environment (release 4)
497
498* Fri Mar 19 1999 Jeff Johnson <jbj@redhat.com>
499- strip binaries.
500- include bash-doc correctly.
501
502* Thu Mar 18 1999 Preston Brown <pbrown@redhat.com>
503- fixed post/postun /etc/shells work.
504
505* Thu Mar 18 1999 Cristian Gafton <gafton@redhat.com>
506- updated again text in the spec file
507
508* Mon Feb 22 1999 Jeff Johnson <jbj@redhat.com>
509- updated text in spec file.
510- update to 2.03.
511
512* Fri Feb 12 1999 Cristian Gafton <gafton@redhat.com>
513- build it as bash2 instead of bash
514
515* Tue Feb  9 1999 Bill Nottingham <notting@redhat.com>
516- set 'NON_INTERACTIVE_LOGIN_SHELLS' so profile gets read
517
518* Thu Jan 14 1999 Jeff Johnson <jbj@redhat.com>
519- rename man pages in bash-doc to avoid packaging conflicts (#606).
520
521* Wed Dec 02 1998 Cristian Gafton <gafton@redhat.com>
522- patch for the arm
523- use $RPM_ARCH-redhat-linux as the build target
524
525* Tue Oct  6 1998 Bill Nottingham <notting@redhat.com>
526- rewrite %pre, axe %postun (to avoid prereq loops)
527
528* Wed Aug 19 1998 Jeff Johnson <jbj@redhat.com>
529- resurrect for RH 6.0.
530
531* Sun Jul 26 1998 Jeff Johnson <jbj@redhat.com>
532- update to 2.02.1
533
534* Thu Jun 11 1998 Jeff Johnson <jbj@redhat.com>
535- Package for 5.2.
536
537* Mon Apr 20 1998 Ian Macdonald <ianmacd@xs4all.nl>
538- added POSIX.NOTES doc file
539- some extraneous doc files removed
540- minor .spec file changes
541
542* Sun Apr 19 1998 Ian Macdonald <ianmacd@xs4all.nl>
543- upgraded to version 2.02
544- Alpha, MIPS & Sparc patches removed due to lack of test platforms
545- glibc & signal patches no longer required
546- added documentation subpackage (doc)
547
548* Fri Nov 07 1997 Donnie Barnes <djb@redhat.com>
549- added signal handling patch from Dean Gaudet <dgaudet@arctic.org> that
550  is based on a change made in bash 2.0.  Should fix some early exit
551  problems with suspends and fg.
552
553* Mon Oct 20 1997 Donnie Barnes <djb@redhat.com>
554- added %clean
555
556* Mon Oct 20 1997 Erik Troan <ewt@redhat.com>
557- added comment explaining why install-info isn't used
558- added mips patch
559
560* Fri Oct 17 1997 Donnie Barnes <djb@redhat.com>
561- added BuildRoot
562
563* Tue Jun 03 1997 Erik Troan <ewt@redhat.com>
564- built against glibc
Note: See TracBrowser for help on using the repository browser.