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

01917d
gdb/testsuite/gdb.base/fileio.c:
01917d
gdb/testsuite/gdb.base/fileio.exp:
01917d
2007-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
01917d
01917d
	* gdb.base/fileio.c (ROOTSUBDIR): New macro.
01917d
	(main): CHDIR into ROOTSUBDIR.  CHOWN ROOTSUBDIR and CHDIR into
01917d
	ROOTSUBDIR if we are being run as root.
01917d
	* gdb.base/fileio.exp: Change the startup and finish cleanup.
01917d
	Change the test file reference to be into the `fileio.dir' directory.
01917d
01917d
01917d
sources/gdb/testsuite/gdb.base/dump.exp:
01917d
Found on RHEL-5.s390x.
01917d
01917d
01917d
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
01917d
random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
01917d
01917d
01917d
gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
01917d
frames-invalid can happen asynchronously.
01917d
01917d
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c
01917d
===================================================================
01917d
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.c	2009-10-01 17:39:13.000000000 +0200
01917d
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.c	2012-01-03 15:21:28.122729249 +0100
01917d
@@ -58,6 +58,8 @@ system (const char * string);
01917d
 1) Invalid string/command. -  returns 127.  */
01917d
 static const char *strerrno (int err);
01917d
 
01917d
+#define ROOTSUBDIR "fileio.dir"
01917d
+
01917d
 #define FILENAME    "foo.fileio.test"
01917d
 #define RENAMED     "bar.fileio.test"
01917d
 #define NONEXISTANT "nofoo.fileio.test"
01917d
@@ -542,6 +544,37 @@ strerrno (int err)
01917d
 int
01917d
 main ()
01917d
 {
01917d
+  /* ROOTSUBDIR is already prepared by fileio.exp.  We use it for easy cleanup
01917d
+     (by fileio.exp) if we are run by multiple users in the same directory.  */
01917d
+
01917d
+  if (chdir (ROOTSUBDIR) != 0)
01917d
+    {
01917d
+      printf ("chdir " ROOTSUBDIR ": %s\n", strerror (errno));
01917d
+      exit (1);
01917d
+    }
01917d
+
01917d
+  /* These tests
01917d
+       Open for write but no write permission returns EACCES
01917d
+       Unlinking a file in a directory w/o write access returns EACCES
01917d
+     fail if we are being run as root - drop the privileges here.  */
01917d
+
01917d
+  if (geteuid () == 0)
01917d
+    {
01917d
+      uid_t uid = 99;
01917d
+
01917d
+      if (chown (".", uid, uid) != 0)
01917d
+	{
01917d
+	  printf ("chown %d.%d " ROOTSUBDIR ": %s\n", (int) uid, (int) uid,
01917d
+		  strerror (errno));
01917d
+	  exit (1);
01917d
+	}
01917d
+      if (setuid (uid) || geteuid () == 0)
01917d
+	{
01917d
+	  printf ("setuid %d: %s\n", (int) uid, strerror (errno));
01917d
+	  exit (1);
01917d
+	}
01917d
+    }
01917d
+
01917d
   /* Don't change the order of the calls.  They partly depend on each other */
01917d
   test_open ();
01917d
   test_write ();
01917d
Index: gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp
01917d
===================================================================
01917d
--- gdb-7.4.50.20120103.orig/gdb/testsuite/gdb.base/fileio.exp	2011-12-26 12:24:55.000000000 +0100
01917d
+++ gdb-7.4.50.20120103/gdb/testsuite/gdb.base/fileio.exp	2012-01-03 15:22:02.716601956 +0100
01917d
@@ -42,8 +42,8 @@ if [get_compiler_info ${binfile}] {
01917d
     return -1;
01917d
 }
01917d
 
01917d
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
01917d
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
01917d
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
01917d
+remote_exec build {sh -xc mkdir\ -m777\ fileio.dir}
01917d
 
01917d
 set oldtimeout $timeout
01917d
 set timeout [expr "$timeout + 60"]
01917d
@@ -85,7 +85,7 @@ gdb_test continue \
01917d
 
01917d
 gdb_test "continue" ".*" ""
01917d
 
01917d
-catch "system \"chmod -f -w nowrt.fileio.test\""
01917d
+catch "system \"chmod -f -w fileio.dir/nowrt.fileio.test\""
01917d
 
01917d
 gdb_test continue \
01917d
 "Continuing\\..*open 5:.*EACCES$stop_msg" \
01917d
@@ -251,8 +251,8 @@ gdb_exit
01917d
 # Wait till GDB really exits.
01917d
 sleep 1
01917d
 
01917d
-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
01917d
-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
01917d
+remote_exec build {sh -xc test\ -r\ fileio.dir/dir2.fileio.test\ &&\ chmod\ -f\ +w\ fileio.dir/dir2.fileio.test}
01917d
+remote_exec build {sh -xc rm\ -rf\ fileio.dir}
01917d
 
01917d
 set timeout $oldtimeout
01917d
 return 0