rpms/gzip/F-12 gzip-1.3.12-close-stdout.patch,1.1,1.2

Karel Klíč kklic at fedoraproject.org
Tue Dec 1 14:34:56 UTC 2009


Author: kklic

Update of /cvs/extras/rpms/gzip/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32751

Modified Files:
	gzip-1.3.12-close-stdout.patch 
Log Message:
Fixed silent data loss due to unchecked close of stdout: fixed patch

gzip-1.3.12-close-stdout.patch:
 gzip.c |  157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)

View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.1 -r 1.2 gzip-1.3.12-close-stdout.patchIndex: gzip-1.3.12-close-stdout.patch
===================================================================
RCS file: /cvs/extras/rpms/gzip/F-12/gzip-1.3.12-close-stdout.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- gzip-1.3.12-close-stdout.patch	1 Dec 2009 13:53:33 -0000	1.1
+++ gzip-1.3.12-close-stdout.patch	1 Dec 2009 14:34:56 -0000	1.2
@@ -1,17863 +1,181 @@
-diff -up gzip-1.3.12/configure.close-stdout gzip-1.3.12/configure
---- gzip-1.3.12/configure.close-stdout	2007-04-13 23:39:49.000000000 +0200
-+++ gzip-1.3.12/configure	2009-12-01 10:04:19.891388375 +0100
-@@ -1,11 +1,11 @@
- #! /bin/sh
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.61 for gzip 1.3.12.
-+# Generated by GNU Autoconf 2.63 for gzip 1.3.12.
- #
- # Report bugs to <bug-gzip at gnu.org>.
- #
- # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
--# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- # This configure script is free software; the Free Software Foundation
- # gives unlimited permission to copy, distribute and modify it.
- ## --------------------- ##
-@@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
- as_cr_digits='0123456789'
- as_cr_alnum=$as_cr_Letters$as_cr_digits
- 
--# The user is always right.
--if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
--  echo  "exit 0"   >>conf$$.sh
--  chmod +x conf$$.sh
--  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--    PATH_SEPARATOR=';'
-+as_nl='
-+'
-+export as_nl
-+# Printing a long string crashes Solaris 7 /usr/bin/printf.
-+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-+  as_echo='printf %s\n'
-+  as_echo_n='printf %s'
-+else
-+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-+    as_echo_n='/usr/ucb/echo -n'
-   else
--    PATH_SEPARATOR=:
-+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-+    as_echo_n_body='eval
-+      arg=$1;
-+      case $arg in
-+      *"$as_nl"*)
-+	expr "X$arg" : "X\\(.*\\)$as_nl";
-+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-+      esac;
-+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-+    '
-+    export as_echo_n_body
-+    as_echo_n='sh -c $as_echo_n_body as_echo'
-   fi
--  rm -f conf$$.sh
-+  export as_echo_body
-+  as_echo='sh -c $as_echo_body as_echo'
-+fi
-+
-+# The user is always right.
-+if test "${PATH_SEPARATOR+set}" != set; then
-+  PATH_SEPARATOR=:
-+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-+      PATH_SEPARATOR=';'
-+  }
- fi
- 
- # Support unset when possible.
-@@ -65,8 +93,6 @@ fi
- # there to prevent editors from complaining about space-tab.
- # (If _AS_PATH_WALK were called with IFS unset, it would disable word
- # splitting by setting IFS to empty value.)
--as_nl='
--'
- IFS=" ""	$as_nl"
- 
- # Find who we are.  Look in the path if we contain no directory separator.
-@@ -89,7 +115,7 @@ if test "x$as_myself" = x; then
-   as_myself=$0
- fi
- if test ! -f "$as_myself"; then
--  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-   { (exit 1); exit 1; }
- fi
- 
-@@ -102,17 +128,10 @@ PS2='> '
- PS4='+ '
- 
- # NLS nuisances.
--for as_var in \
--  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
--  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
--  LC_TELEPHONE LC_TIME
--do
--  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
--    eval $as_var=C; export $as_var
--  else
--    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--  fi
--done
-+LC_ALL=C
-+export LC_ALL
-+LANGUAGE=C
-+export LANGUAGE
- 
- # Required to use basename.
- if expr a : '\(a\)' >/dev/null 2>&1 &&
-@@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" ||
- $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- 	 X"$0" : 'X\(//\)$' \| \
- 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
--echo X/"$0" |
-+$as_echo X/"$0" |
-     sed '/^.*\/\([^/][^/]*\)\/*$/{
- 	    s//\1/
- 	    q
-@@ -160,7 +179,7 @@ else
-   as_have_required=no
- fi
- 
--  if test $as_have_required = yes && 	 (eval ":
-+  if test $as_have_required = yes &&	 (eval ":
- (as_func_return () {
-   (exit \$1)
- }
-@@ -242,7 +261,7 @@ IFS=$as_save_IFS
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -263,7 +282,7 @@ _ASEOF
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-   emulate sh
-   NULLCMD=:
--  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-   # is contrary to our usage.  Disable this feature.
-   alias -g '${1+"$@"}'='"$@"'
-   setopt NO_GLOB_SUBST
-@@ -343,10 +362,10 @@ fi
- 
-       if test "x$CONFIG_SHELL" != x; then
-   for as_var in BASH_ENV ENV
--        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
--        done
--        export CONFIG_SHELL
--        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-+	done
-+	export CONFIG_SHELL
-+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
- fi
- 
- 
-@@ -415,9 +434,10 @@ fi
- 
- test \$exitcode = 0") || {
-   echo No shell found that supports shell functions.
--  echo Please tell autoconf at gnu.org about your system,
--  echo including any error possibly output before this
--  echo message
-+  echo Please tell bug-autoconf at gnu.org about your system,
-+  echo including any error possibly output before this message.
-+  echo This can help us improve future autoconf versions.
-+  echo Configuration will now proceed without shell functions.
- }
- 
- 
-@@ -453,7 +473,7 @@ test \$exitcode = 0") || {
-       s/-\n.*//
-     ' >$as_me.lineno &&
-   chmod +x "$as_me.lineno" ||
--    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
[...17617 lines suppressed...]
-+	        distdir="$$new_distdir" \
- 		am__remove_distdir=: \
- 		am__skip_length_check=: \
-+		am__skip_mode_fix=: \
- 	        distdir) \
- 	      || exit 1; \
- 	  fi; \
- 	done
--	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
-+	-test -n "$(am__skip_mode_fix)" \
-+	|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
--	|| chmod -R a+r $(distdir)
-+	|| chmod -R a+r "$(distdir)"
- dist-gzip: distdir
- 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- 	$(am__remove_distdir)
-@@ -692,6 +872,14 @@ dist-bzip2: distdir
- 	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- 	$(am__remove_distdir)
- 
-+dist-lzma: distdir
-+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-+	$(am__remove_distdir)
-+
-+dist-xz: distdir
-+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
-+	$(am__remove_distdir)
-+
- dist-tarZ: distdir
- 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- 	$(am__remove_distdir)
-@@ -718,6 +906,10 @@ distcheck: dist
- 	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
- 	*.tar.bz2*) \
- 	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
-+	*.tar.lzma*) \
-+	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
-+	*.tar.xz*) \
-+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- 	*.tar.Z*) \
- 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- 	*.shar.gz*) \
-@@ -729,9 +921,11 @@ distcheck: dist
- 	mkdir $(distdir)/_build
- 	mkdir $(distdir)/_inst
- 	chmod a-w $(distdir)
-+	test -d $(distdir)/_build || exit 0; \
- 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
--	  && cd $(distdir)/_build \
-+	  && am__cwd=`pwd` \
-+	  && $(am__cd) $(distdir)/_build \
- 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- 	    $(DISTCHECK_CONFIGURE_FLAGS) \
- 	  && $(MAKE) $(AM_MAKEFLAGS) \
-@@ -753,13 +947,15 @@ distcheck: dist
- 	  && rm -rf "$$dc_destdir" \
- 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
- 	  && rm -rf $(DIST_ARCHIVES) \
--	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
-+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
-+	  && cd "$$am__cwd" \
-+	  || exit 1
- 	$(am__remove_distdir)
- 	@(echo "$(distdir) archives ready for distribution: "; \
- 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
- distuninstallcheck:
--	@cd $(distuninstallcheck_dir) \
-+	@$(am__cd) '$(distuninstallcheck_dir)' \
- 	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- 	   || { echo "ERROR: files left after uninstall:" ; \
- 	        if test -n "$(DESTDIR)"; then \
-@@ -806,6 +1002,7 @@ clean-generic:
- 
- distclean-generic:
- 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- 
- maintainer-clean-generic:
- 	@echo "This command is intended for maintainers to use"
-@@ -828,6 +1025,8 @@ dvi-am:
- 
- html: html-recursive
- 
-+html-am:
-+
- info: info-recursive
- 
- info-am:
-@@ -836,20 +1035,29 @@ install-data-am: install-man
- 
- install-dvi: install-dvi-recursive
- 
-+install-dvi-am:
-+
- install-exec-am: install-binPROGRAMS install-binSCRIPTS
- 	@$(NORMAL_INSTALL)
- 	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
--
- install-html: install-html-recursive
- 
-+install-html-am:
-+
- install-info: install-info-recursive
- 
-+install-info-am:
++  /* There is no need to flush stdin if we can determine quickly that stdin's
++     input buffer is empty; in this case we know that if stdin is seekable,
++     fseeko (stdin, 0, SEEK_CUR) == lseek (0, 0, SEEK_CUR).  */
++  if (freadahead (stdin) > 0)
++    {
++      /* Only attempt flush if stdin is seekable, as fflush is entitled to
++	 fail on non-seekable streams.  */
++      if (fseeko (stdin, 0, SEEK_CUR) == 0 && fflush (stdin) != 0)
++	fail = 1;
++    }
++  if (close_stream (stdin) != 0)
++    fail = 1;
++  if (fail)
++    {
++      /* Report failure, but defer exit until after closing stdout,
++	 since the failure report should still be flushed.  */
++      fprintf(stderr, "%d: error closing file\n", errno);
++    }
 +
- install-man: install-man1
- 
- install-pdf: install-pdf-recursive
- 
-+install-pdf-am:
++  close_stdout ();
 +
- install-ps: install-ps-recursive
- 
-+install-ps-am:
++  if (fail)
++    _exit (ERROR);
++}
 +
- installcheck-am: installcheck-binPROGRAMS installcheck-binSCRIPTS
- 
- maintainer-clean: maintainer-clean-recursive
-@@ -876,22 +1084,23 @@ uninstall-am: uninstall-binPROGRAMS unin
- 
- uninstall-man: uninstall-man1
- 
--.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
--	install-exec-am install-strip
-+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
-+	ctags-recursive install-am install-exec-am install-strip \
-+	tags-recursive
- 
- .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- 	all all-am am--refresh check check-am check-local clean \
- 	clean-binPROGRAMS clean-generic ctags ctags-recursive dist \
--	dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
--	distcheck distclean distclean-compile distclean-generic \
--	distclean-tags distcleancheck distdir distuninstallcheck dvi \
--	dvi-am html html-am info info-am install install-am \
--	install-binPROGRAMS install-binSCRIPTS install-data \
--	install-data-am install-dvi install-dvi-am install-exec \
--	install-exec-am install-exec-hook install-html install-html-am \
--	install-info install-info-am install-man install-man1 \
--	install-pdf install-pdf-am install-ps install-ps-am \
--	install-strip installcheck installcheck-am \
-+	dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
-+	dist-xz dist-zip distcheck distclean distclean-compile \
-+	distclean-generic distclean-tags distcleancheck distdir \
-+	distuninstallcheck dvi dvi-am html html-am info info-am \
-+	install install-am install-binPROGRAMS install-binSCRIPTS \
-+	install-data install-data-am install-dvi install-dvi-am \
-+	install-exec install-exec-am install-exec-hook install-html \
-+	install-html-am install-info install-info-am install-man \
-+	install-man1 install-pdf install-pdf-am install-ps \
-+	install-ps-am install-strip installcheck installcheck-am \
- 	installcheck-binPROGRAMS installcheck-binSCRIPTS installdirs \
- 	installdirs-am maintainer-clean maintainer-clean-generic \
- 	mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
-@@ -951,6 +1160,7 @@ install-exec-hook remove-installed-links
- 	done
+ /* ======================================================================== */
+ int main (argc, argv)
+     int argc;
+@@ -396,6 +551,8 @@ int main (argc, argv)
+     program_name = gzip_base_name (argv[0]);
+     proglen = strlen (program_name);
  
- uninstall-local: remove-installed-links
++    atexit(close_stdin);
 +
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
+     /* Suppress .exe for MSDOS, OS/2 and VMS: */
+     if (4 < proglen && strequ (program_name + proglen - 4, ".exe"))
+       program_name[proglen - 4] = '\0';




More information about the fedora-extras-commits mailing list