Blame SOURCES/gdb-6.7-testsuite-stable-results.patch

7a6771
gdb/testsuite/gdb.base/fileio.c:
7a6771
gdb/testsuite/gdb.base/fileio.exp:
7a6771
2007-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
7a6771
7a6771
	* gdb.base/fileio.c (ROOTSUBDIR): New macro.
7a6771
	(main): CHDIR into ROOTSUBDIR.  CHOWN ROOTSUBDIR and CHDIR into
7a6771
	ROOTSUBDIR if we are being run as root.
7a6771
	* gdb.base/fileio.exp: Change the startup and finish cleanup.
7a6771
	Change the test file reference to be into the `fileio.dir' directory.
7a6771
7a6771
7a6771
sources/gdb/testsuite/gdb.base/dump.exp:
7a6771
Found on RHEL-5.s390x.
7a6771
7a6771
7a6771
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
7a6771
random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
7a6771
7a6771
7a6771
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
7a6771
frames-invalid can happen asynchronously.
7a6771
7a6771
Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.c
7a6771
===================================================================
7a6771
--- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.c	2016-08-01 17:50:21.000000000 +0200
7a6771
+++ gdb-7.12/gdb/testsuite/gdb.base/fileio.c	2016-10-07 22:49:20.689346914 +0200
7a6771
@@ -556,6 +556,28 @@
7a6771
 int
7a6771
 main ()
7a6771
 {
7a6771
+  /* These tests
7a6771
+       Open for write but no write permission returns EACCES
7a6771
+       Unlinking a file in a directory w/o write access returns EACCES
7a6771
+     fail if we are being run as root - drop the privileges here.  */
7a6771
+
7a6771
+  if (geteuid () == 0)
7a6771
+    {
7a6771
+      uid_t uid = 99;
7a6771
+
7a6771
+      if (chown (OUTDIR, uid, uid) != 0)
7a6771
+	{
7a6771
+	  printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid,
7a6771
+		  OUTDIR, strerror (errno));
7a6771
+	  exit (1);
7a6771
+	}
7a6771
+      if (setuid (uid) || geteuid () == 0)
7a6771
+	{
7a6771
+	  printf ("setuid %d: %s\n", (int) uid, strerror (errno));
7a6771
+	  exit (1);
7a6771
+	}
7a6771
+    }
7a6771
+
7a6771
   /* Don't change the order of the calls.  They partly depend on each other */
7a6771
   test_open ();
7a6771
   test_write ();
7a6771
Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp
7a6771
===================================================================
7a6771
--- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.exp	2016-08-01 17:50:21.000000000 +0200
7a6771
+++ gdb-7.12/gdb/testsuite/gdb.base/fileio.exp	2016-10-07 22:54:44.680071906 +0200
7a6771
@@ -24,9 +24,9 @@
7a6771
 standard_testfile
7a6771
 
7a6771
 if {[is_remote host]} {
7a6771
-    set outdir .
7a6771
+    set outdir "fileio.dir"
7a6771
 } else {
7a6771
-    set outdir [standard_output_file {}]
7a6771
+    set outdir [standard_output_file "fileio.dir"]
7a6771
 }
7a6771
 
7a6771
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
7a6771
@@ -47,7 +47,8 @@
7a6771
 if {[file exists $dir2] && ![file writable $dir2]} {
7a6771
     system "chmod +w $dir2"
7a6771
 }
7a6771
-system "rm -rf [standard_output_file *.fileio.test]"
7a6771
+system "rm -rf [standard_output_file fileio.dir]"
7a6771
+system "mkdir -m777 [standard_output_file fileio.dir]"
7a6771
 
7a6771
 set oldtimeout $timeout
7a6771
 set timeout [expr "$timeout + 60"]
7a6771
@@ -89,7 +90,7 @@
7a6771
 
7a6771
 gdb_test "continue" ".*" ""
7a6771
 
7a6771
-catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\""
7a6771
+catch "system \"chmod -f -w [standard_output_file fileio.dir/nowrt.fileio.test]\""
7a6771
 
7a6771
 gdb_test continue \
7a6771
 "Continuing\\..*open 5:.*EACCES$stop_msg" \
7a6771
@@ -276,9 +277,7 @@
7a6771
 gdb_exit
7a6771
 
7a6771
 # Make dir2 writable again so rm -rf of a build tree Just Works.
7a6771
-if {[file exists $dir2] && ![file writable $dir2]} {
7a6771
-    system "chmod +w $dir2"
7a6771
-}
7a6771
+system "chmod -R +w $outdir"
7a6771
 
7a6771
 set timeout $oldtimeout
7a6771
 return 0