[Lsb-messages] /var/www/bzr/lsb/4.1/runtime-test r1279: Backport bugfix for bug 3345.

Jeff Licquia licquia at linuxfoundation.org
Tue May 28 17:00:31 UTC 2013


------------------------------------------------------------
revno: 1279
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: runtime-test
timestamp: Tue 2013-05-28 13:00:31 -0400
message:
  Backport bugfix for bug 3345.
added:
  scripts/package/tet3.7-lite-tmpresfp.patch
modified:
  scripts/package/Makefile
  scripts/package/lsb-test-core.spec.sed
-------------- next part --------------
=== modified file 'scripts/package/Makefile'
--- a/scripts/package/Makefile	2013-05-02 18:10:06 +0000
+++ b/scripts/package/Makefile	2013-05-28 17:00:31 +0000
@@ -1,6 +1,6 @@
 # values used to populate .spec from .spec.sed
 PACKAGE=lsb-test-core
-VERSION=4.1.14
+VERSION=4.1.15
 RELEASE=1
 # PAM Version
 PVERSION=0.99.8.1

=== modified file 'scripts/package/lsb-test-core.spec.sed'
--- a/scripts/package/lsb-test-core.spec.sed	2013-02-09 03:37:56 +0000
+++ b/scripts/package/lsb-test-core.spec.sed	2013-05-28 17:00:31 +0000
@@ -38,6 +38,7 @@
 Patch15: lsb-test-core-no-expect2.patch
 Patch16: lsb-test-core-bug-2688.patch
 Patch17: lsb-test-core-speedfactor.patch
+Patch18: tet3.7-lite-tmpresfp.patch
 URL: http://www.linuxbase.org/test
 BuildRoot: %{_tmppath}/%{name}-root
 AutoReqProv: no
@@ -210,6 +211,8 @@
 patch -p0 -b -z .chroot-fip < %{PATCH3}
 # (sb) bug 2138 - conflict between LSB getline and tet getline
 patch -p0 -b -z .bug2138 < %{PATCH10}
+# (jal) bug 3345 - temp result file picks up fd 0 inappropriately
+patch -p0 -b < %{PATCH18}
 
 # (sb) use the LSB linker for the early tet compile
 # bug 2709 - ccache forces itself into $CC here, use lsbcc

=== added file 'scripts/package/tet3.7-lite-tmpresfp.patch'
--- a/scripts/package/tet3.7-lite-tmpresfp.patch	1970-01-01 00:00:00 +0000
+++ b/scripts/package/tet3.7-lite-tmpresfp.patch	2013-05-28 17:00:31 +0000
@@ -0,0 +1,51 @@
+diff -ru tet-orig/src/tet3/tcm/ictp.c tet/src/tet3/tcm/ictp.c
+--- tet-orig/src/tet3/tcm/ictp.c	2002-05-15 14:05:16.000000000 -0500
++++ tet/src/tet3/tcm/ictp.c	2013-05-28 11:10:23.259984699 -0400
+@@ -298,10 +298,24 @@
+ #endif
+ {
+ 	char buf[128];
++	int low_fds[3] = { -1, -1, -1 };
++	int low_fd;
+ 
+ 	(void) sprintf(buf, "%d %s", testnum, curtime());
+ 	lite_output(TET_JNL_TP_START, buf, "TP Start");
+ 
++	/* avoid stdin/stdout/stderr if available for the temp file */
++	low_fd = open("/dev/null", O_WRONLY);
++	while ((low_fd >= 0) && (low_fd <= 2)) {
++		low_fds[low_fd] = 1;
++		low_fd = dup(low_fd);
++	}
++
++	if (low_fd < 0)
++		tet_error(errno, "cannot reserve low file descriptors");
++	else
++		close(low_fd);
++
+ 	/* create temporary result file */
+ 	(void) remove(tet_tmpresfile);
+ 	if ((tet_tmpresfp = fopen(tet_tmpresfile, "a+b")) == (FILE *) 0)
+@@ -318,6 +332,11 @@
+ 	ASSERT(tmpresenv);
+ 	if (tet_putenv(tmpresenv) != 0)
+ 		tet_error(0, "tet_putenv() failed setting TET_TMPRESFILE");
++
++	/* close low fds we held open from before */
++	for (low_fd = 0; low_fd < 3; low_fd++)
++		if (low_fds[low_fd] > 0)
++			close(low_fd);
+ }
+ 
+ 
+diff -ru tet-orig/src/tet3/tcm/tcmhdrs.h tet/src/tet3/tcm/tcmhdrs.h
+--- tet-orig/src/tet3/tcm/tcmhdrs.h	2002-05-15 14:05:17.000000000 -0500
++++ tet/src/tet3/tcm/tcmhdrs.h	2013-05-26 14:51:39.645126657 -0400
+@@ -66,6 +66,7 @@
+ #  include <errno.h>
+ #  include <sys/types.h>
+ #  include <sys/stat.h>
++#  include <fcntl.h>
+ #  include <limits.h>
+ #  include <time.h>
+ #    include <signal.h>



More information about the lsb-messages mailing list