rpms/gcl/FC-4 gcl-pers.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 gcl.spec, 1.12, 1.13 sources, 1.2, 1.3

Gérard Milmeister (gemi) fedora-extras-commits at redhat.com
Fri Sep 9 19:23:41 UTC 2005


Author: gemi

Update of /cvs/extras/rpms/gcl/FC-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11284

Modified Files:
	.cvsignore gcl.spec sources 
Added Files:
	gcl-pers.patch 
Log Message:
new version 2.6.7

gcl-pers.patch:

--- NEW FILE gcl-pers.patch ---
--- gcl-2.6.7/o/main.c.pers	2005-09-09 20:36:46.000000000 +0200
+++ gcl-2.6.7/o/main.c	2005-09-09 21:07:51.000000000 +0200
@@ -117,11 +117,9 @@
 #endif
 #endif
 
-#ifdef NEED_NONRANDOM_SBRK
 #include <syscall.h>
-#include <linux/personality.h>
+#include <sys/personality.h>
 #include <unistd.h>
-#endif
 
 int
 main(int argc, char **argv, char **envp) {
@@ -131,14 +129,25 @@
 #endif
 #endif
 
-#ifdef NEED_NONRANDOM_SBRK
-#if SIZEOF_LONG == 4
-	if (!syscall(SYS_personality,PER_LINUX32))
-#else
-        if (!syscall(SYS_personality,PER_LINUX))
-#endif
-	  execvp(argv[0],argv);
-#endif
+	long pers = personality(-1);
+	/* 0x40000 aka. ADDR_NO_RANDOMIZE */
+	if (!(pers & 0x40000)) {
+	  if (personality(pers | 0x40000) != -1) {
+	    /* Use /proc/self/exe instead of trying to figure out the
+	     * executable path from PATH and argv[0], since that's reliable.
+	     */
+	    char buf[PATH_MAX+1];
+	    int rc = readlink("/proc/self/exe", buf, PATH_MAX);
+	    if ( rc > 0 ) {
+	      buf[rc]=0;
+	      execve(buf, argv, envp);
+	    }
+	  }
+	  /* Either changing the personality or execve() failed. Either
+	   * way we might as well continue, and hope that the random
+	   * memory maps are ok this time around.
+	   */
+	}
 
 #if defined(DARWIN)
     extern void init_darwin_zone_compat ();
--- gcl-2.6.7/configure.pers	2005-09-09 20:51:26.000000000 +0200
+++ gcl-2.6.7/configure	2005-09-09 21:06:56.000000000 +0200
@@ -3887,17 +3887,18 @@
 #line 3888 "configure"
 #include "confdefs.h"
 #include <syscall.h>
-			    #include <linux/personality.h>
+			    #include <sys/personality.h>
 	         	    #include <stdio.h>
 			    #include <unistd.h>
 			    int main(int argc,char * argv[]) {
 				FILE *f;
-				#if SIZEOF_LONG == 4
-				if (!syscall(SYS_personality,PER_LINUX32))
-				#else
-				if (!syscall(SYS_personality,PER_LINUX))
-				#endif
-					execvp(argv[0],argv);
+                                long pers = personality(-1);
+                                if (!(pers & 0x40000)) {
+                                  if (personality(pers | 0x40000) != -1) {
+                                    execvp(argv[0],argv);
+                                   }
+                                }
+
 				if (!(f=fopen("conftest1","w")))
 					return -1;
 				fprintf(f,"%u",sbrk(0));
@@ -3927,17 +3928,17 @@
 #line 3928 "configure"
 #include "confdefs.h"
 #include <syscall.h>
-			    #include <linux/personality.h>
+			    #include <sys/personality.h>
 			    #include <stdio.h>
 			    #include <unistd.h>
 			    int main(int argc,char * argv[]) {
 				FILE *f;
-				#if SIZEOF_LONG == 4
-				if (!syscall(SYS_personality,PER_LINUX32))
-				#else
-				if (!syscall(SYS_personality,PER_LINUX))
-				#endif
-					execvp(argv[0],argv);
+                                long pers = personality(-1);
+                                if (!(pers & 0x40000)) {
+                                  if (personality(pers | 0x40000) != -1) {
+                                    execvp(argv[0],argv);
+                                   }
+                                }
 				if (!(f=fopen("conftest1","w")))
 					return -1;
 				fprintf(f,"%u",sbrk(0));
@@ -3989,25 +3990,22 @@
 #include "confdefs.h"
 #include <stdio.h>
             #include <stdlib.h>
-	    #ifdef NEED_NONRANDOM_SBRK
 		   #include <syscall.h>
-		   #include <linux/personality.h>
+		   #include <sys/personality.h>
 		   #include <unistd.h>
-	   #endif
 int
 main(int argc,char * argv[])
 {
   char *b;
   FILE *fp;
 
-#ifdef NEED_NONRANDOM_SBRK
-#if SIZEOF_LONG == 4
-if (!syscall(SYS_personality,PER_LINUX32))
-#else
-if (!syscall(SYS_personality,PER_LINUX))
-#endif
-     execvp(argv[0],argv);
-#endif  
+  long pers = personality(-1);
+  if (!(pers & 0x40000)) {
+    if (personality(pers | 0x40000) != -1) {
+      execvp(argv[0],argv);
+    }
+  }
+
   b = (void *) malloc(1000);
   fp = fopen("conftest1","w");
 


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/gcl/FC-4/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	7 Apr 2005 16:50:14 -0000	1.2
+++ .cvsignore	9 Sep 2005 19:23:39 -0000	1.3
@@ -1 +1 @@
-gcl-2.6.6.tar.gz
+gcl-2.6.7.tar.gz


Index: gcl.spec
===================================================================
RCS file: /cvs/extras/rpms/gcl/FC-4/gcl.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- gcl.spec	16 May 2005 12:12:25 -0000	1.12
+++ gcl.spec	9 Sep 2005 19:23:39 -0000	1.13
@@ -1,12 +1,13 @@
 Name:           gcl
-Version:        2.6.6
-Release:        3
+Version:        2.6.7
+Release:        1%{?dist}
 Summary:        GNU Common Lisp
 
 Group:          Development/Languages
 License:        GPL, LGPL
 URL:            http://www.gnu.org/software/gcl
-Source:         ftp://ftp.gnu.org/pub/gnu/gcl/gcl-2.6.6.tar.gz
+Source:         ftp://ftp.gnu.org/pub/gnu/gcl/gcl-2.6.7.tar.gz
+Patch0:		gcl-pers.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  readline-devel, tk-devel, tcl-devel, gmp-devel
 BuildRequires:	tetex, texinfo
@@ -23,6 +24,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
@@ -54,6 +56,7 @@
 (autoload 'run "gcl" "Run GCL." t)
 (autoload 'gcl-mode "gcl" "GCL mode." t)
 EOF
+find $RPM_BUILD_ROOT%{_libdir}/gcl* -name '*.l*sp' | xargs chmod 0644
 
 
 %clean
@@ -87,6 +90,9 @@
 
 
 %changelog
+* Fri Sep  9 2005 Gerard Milmeister <gemi at bluewin.ch> - 2.6.7-1
+- New Version 2.6.7
+
 * Sun Apr 17 2005 Gerard Milmeister <gemi at bluewin.ch> - 2.6.6-2
 - Added buildreq tetex and texinfo
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/gcl/FC-4/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	7 Apr 2005 16:50:14 -0000	1.2
+++ sources	9 Sep 2005 19:23:39 -0000	1.3
@@ -1 +1 @@
-45d67331b29cafc3e9b1eacb488044ec  gcl-2.6.6.tar.gz
+c0f42e1f391162e5ac90912a70e8ecc3  gcl-2.6.7.tar.gz




More information about the fedora-extras-commits mailing list