[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#72165: personality() call is damaging



Package: glibc
Version: 2.1.3-10

Setting the personality during program startup causes problems on ARM.  This 
call has already been removed from glibc 2.2 and it would be good to have it 
taken out of the Debian versions of 2.1 also.  A patch is appended.

p.

--

#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Remove harmful personality call from startup code

if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

--- sysdeps/unix/sysv/linux/init-first.c	1999/05/26 23:36:27	1.24
+++ sysdeps/unix/sysv/linux/init-first.c	1999/08/21 04:09:10	1.25
@@ -20,7 +20,6 @@
 #include <unistd.h>
 #include <sysdep.h>
 #include <fpu_control.h>
-#include <linux/personality.h>
 #include <init-first.h>
 #include <sys/types.h>
 
@@ -50,19 +49,11 @@
 static void
 init (int argc, char **argv, char **envp)
 {
-  extern int __personality (int);
   extern void __getopt_clean_environment (char **);
 
   /* We must not call `personality' twice.  */
   if (!__libc_multiple_libcs)
     {
-      /* The `personality' system call takes one argument that chooses
-	 the "personality", i.e. the set of system calls and such.  We
-	 must make this call first thing to disable emulation of some
-	 other system that might have been enabled by default based on
-	 the executable format.  */
-      __personality (PER_LINUX);
-
       /* Set the FPU control word to the proper default value if the
 	 kernel would use a different value.  (In a static program we
 	 don't have this information.)  */





Reply to: