*** gcc/libgcc2.c Thu Jan 13 19:19:51 2005 --- gcc/libgcc2.c.solaris Thu Jan 13 19:19:22 2005 *************** *** 1679,1694 **** #include #endif - #if defined(HAVE_SYSLOG) #include #include #include ! #include ! #ifndef _PATH_LOG ! #define _PATH_LOG "/dev/log" ! #endif ! #endif long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; static void __guard_setup (void) __attribute__ ((constructor)); --- 1679,1689 ---- #include #endif #include #include #include ! #include long __guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; static void __guard_setup (void) __attribute__ ((constructor)); *************** *** 1721,1733 **** #if defined (__GNU_LIBRARY__) extern char * __progname; #endif ! const char message[] = ": stack smashing attack in function "; ! int bufsz = 256, len; char buf[bufsz]; ! #if defined(HAVE_SYSLOG) ! int log_file; ! struct sockaddr_un sys_log_addr; /* AF_UNIX address of local logger. */ ! #endif #ifdef _POSIX_SOURCE { sigset_t mask; --- 1716,1726 ---- #if defined (__GNU_LIBRARY__) extern char * __progname; #endif ! const char message[] = "stack smashing attack in function "; ! int bufsz = 256, len = 0; char buf[bufsz]; ! buf[0] = 0; ! #ifdef _POSIX_SOURCE { sigset_t mask; *************** *** 1738,1745 **** } #endif - /* send LOG_CRIT. */ - strcpy (buf, "<2>"); len=3; #if defined (__GNU_LIBRARY__) strncat (buf, __progname, bufsz - len - 1); len = strlen (buf); --- 1731,1736 ---- *************** *** 1756,1775 **** } /* Print error message. */ ! write (STDERR_FILENO, buf + 3, len - 3); ! #if defined(HAVE_SYSLOG) ! if ((log_file = socket (AF_UNIX, SOCK_DGRAM, 0)) != -1) ! { ! /* Send "found" message to the "/dev/log" path. */ ! sys_log_addr.sun_family = AF_UNIX; ! (void)strncpy (sys_log_addr.sun_path, _PATH_LOG, ! sizeof (sys_log_addr.sun_path) - 1); ! sys_log_addr.sun_path[sizeof (sys_log_addr.sun_path) - 1] = '\0'; ! sendto(log_file, buf, len, 0, (struct sockaddr *)&sys_log_addr, ! sizeof (sys_log_addr)); ! } ! #endif #ifdef _POSIX_SOURCE { --- 1747,1756 ---- } /* Print error message. */ ! write (STDERR_FILENO, buf, len); ! /* write to syslogd */ ! syslog(LOG_AUTH | LOG_CRIT, "%s", buf); #ifdef _POSIX_SOURCE {