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

Revision 8974, 16.6 KB checked in by iwamoto, 10 years ago (diff)

bash: CVE-2014-7186, 7187

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