Index: dietlibc-0.27.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.27.ebuild,v retrieving revision 1.1 diff -u -b -B -w -p -r1.1 dietlibc-0.27.ebuild --- dietlibc-0.27.ebuild 1 Oct 2004 21:23:53 -0000 1.1 +++ dietlibc-0.27.ebuild 5 Dec 2004 19:19:07 -0000 @@ -32,19 +32,25 @@ src_unpack() { # ${FILESDIR}/ssp.c is integrated with upstream as of dietlibc-0.26 # - robbat2 (Oct 01 2004) + # Ok so let's make dietlibc ssp aware (Aug 7 2004) -solar + # ${FILESDIR}/ssp.c does not appear to be integrated with + # upstream as of dietlibc-0.27 bug 73112 - solar (Dec 05 2004) + cp ${FILESDIR}/ssp.c ${S}/lib/ || die "Failed to copy ssp.c into lib for compile" + # start with sparc/sparc64/x86_64/i386 for now. # apply to all arches for crazy cross-compiling - robbat2 (Oct 01 2004) epatch ${FILESDIR}/dietlibc-0.26-ssp.patch - append-flags -D__dietlibc__ - # end ssp block code # Fix for 45716 replace-sparc64-flags # be very careful to only effect the CFLAGS used for optimization # and not any of the other CFLAGS. - robbat2 (Oct 01 2004) + + # Shifted ssp exclusion logic into sed expression. - solar (Dec 05 2004) sed -i \ - -e "s:^CFLAGS+=-O -fomit-frame-pointer:CFLAGS += ${CFLAGS}:" \ + -e "s:^CFLAGS+=-O -fomit-frame-pointer:CFLAGS += ${CFLAGS} -D__dietlibc__:" \ + -e "s:^CFLAGS=-pipe -nostdinc:CFLAGS=-pipe -nostdinc -D__dietlibc__ -fno-stack-protector-all -fno-stack-protector:" \ -e "s:^prefix.*:prefix=/usr/diet:" \ Makefile \ || die "sed Makefile failed" Index: files/ssp.c =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/files/ssp.c,v retrieving revision 1.1 diff -u -b -B -w -p -r1.1 ssp.c --- files/ssp.c 7 Aug 2004 23:30:19 -0000 1.1 +++ files/ssp.c 5 Dec 2004 19:19:07 -0000 @@ -28,13 +28,7 @@ #include #include #include -#include #include -#include - -#ifndef _PATH_LOG -#define _PATH_LOG "/dev/log" -#endif #ifdef __PROPOLICE_BLOCK_SEGV__ #define SSP_SIGTYPE SIGSEGV @@ -50,25 +44,10 @@ void __guard_setup (void) { size_t size; -#ifdef HAVE_DEV_ERANDOM - int mib[3]; -#endif - if (__guard != 0UL) return; #ifndef __SSP_QUICK_CANARY__ -#ifdef HAVE_DEV_ERANDOM - /* Random is another depth in Linux, hence an array of 3. */ - mib[0] = CTL_KERN; - mib[1] = KERN_RANDOM; - mib[2] = RANDOM_ERANDOM; - - size = sizeof (unsigned long); - if (__sysctl (mib, 3, &__guard, &size, NULL, 0) != (-1)) - if (__guard != 0UL) - return; -#endif /* * Attempt to open kernel pseudo random device if one exists before * opening urandom to avoid system entropy depletion. @@ -109,13 +88,7 @@ __stack_smash_handler (char func[], int const char message[] = ": stack smashing attack in function "; int bufsz, len; char buf[512]; -#ifndef __dietlibc__ - struct sockaddr_un sock; /* AF_UNIX address of local logger */ - int log; - extern char *__progname; -#else static char *__progname = "dietapp"; -#endif sigset_t mask; sigfillset (&mask); @@ -144,18 +117,8 @@ __stack_smash_handler (char func[], int /* print error message */ write (STDERR_FILENO, buf + 3, len - 3); write (STDERR_FILENO, "()\n", 3); -#ifndef __dietlibc__ - if ((log = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1) - { - /* Send "found" message to the "/dev/log" path */ - sock.sun_family = AF_UNIX; - (void) strncpy (sock.sun_path, _PATH_LOG, sizeof (sock.sun_path) - 1); - sock.sun_path[sizeof (sock.sun_path) - 1] = '\0'; - sendto (log, buf, len, 0, (struct sockaddr *) &sock, sizeof (sock)); - } -#endif - /* Make sure the default handler is associated with the our signal handler */ + /* Make sure the default handler is associated with the our signal handler */ memset (&sa, 0, sizeof (struct sigaction)); sigfillset (&sa.sa_mask); /* Block all signals */ sa.sa_flags = 0;