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

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