Fix for sunbird install/crash on newest glibc versions with FORTIFY_SOURCE (#42507). Based on a similar fix already being made on mozilla-thuderbird package and a similar fedora patch. diff -p -up mozilla/calendar/libical/src/libicalss/icalcalendar.c.orig mozilla/calendar/libical/src/libicalss/icalcalendar.c --- mozilla/calendar/libical/src/libicalss/icalcalendar.c.orig 2008-08-06 13:19:45.000000000 -0300 +++ mozilla/calendar/libical/src/libicalss/icalcalendar.c 2008-08-06 13:21:31.000000000 -0300 @@ -40,7 +40,7 @@ #endif #ifndef PATH_MAX -#define PATH_MAX 512 +#error "PATH_MAX is not defined!" #endif diff -p -up mozilla/calendar/libical/src/libicalss/icalset.h.orig mozilla/calendar/libical/src/libicalss/icalset.h --- mozilla/calendar/libical/src/libicalss/icalset.h.orig 2008-08-06 13:18:38.000000000 -0300 +++ mozilla/calendar/libical/src/libicalss/icalset.h 2008-08-06 13:19:24.000000000 -0300 @@ -46,7 +46,7 @@ #ifdef PATH_MAX #define ICAL_PATH_MAX PATH_MAX #else -#define ICAL_PATH_MAX 1024 +#error "PATH_MAX is not defined!" #endif diff -p -up mozilla/calendar/libical/src/test/stow.c.orig mozilla/calendar/libical/src/test/stow.c --- mozilla/calendar/libical/src/test/stow.c.orig 2008-08-06 13:21:42.000000000 -0300 +++ mozilla/calendar/libical/src/test/stow.c 2008-08-06 13:22:16.000000000 -0300 @@ -48,7 +48,7 @@ char* program_name; void usage(char *message); #ifndef PATH_MAX -#define PATH_MAX 256 /* HACK */ +#error "PATH_MAX is not defined!" #endif diff -p -up mozilla/config/pathsub.h.orig mozilla/config/pathsub.h --- mozilla/config/pathsub.h.orig 2008-08-06 13:22:28.000000000 -0300 +++ mozilla/config/pathsub.h 2008-08-06 13:22:48.000000000 -0300 @@ -46,7 +46,7 @@ #include <sys/types.h> #ifndef PATH_MAX -#define PATH_MAX 1024 +#error "PATH_MAX is not defined!" #endif /* diff -p -up mozilla/directory/c-sdk/config/pathsub.h.orig mozilla/directory/c-sdk/config/pathsub.h --- mozilla/directory/c-sdk/config/pathsub.h.orig 2008-08-06 13:23:01.000000000 -0300 +++ mozilla/directory/c-sdk/config/pathsub.h 2008-08-06 13:23:33.000000000 -0300 @@ -50,7 +50,7 @@ #endif #ifndef PATH_MAX -#define PATH_MAX 1024 +#error "PATH_MAX is not defined!" #endif /* diff -p -up mozilla/extensions/java/xpcom/tools/xpidl/xpidl_java.c.orig mozilla/extensions/java/xpcom/tools/xpidl/xpidl_java.c --- mozilla/extensions/java/xpcom/tools/xpidl/xpidl_java.c.orig 2008-08-06 13:30:02.000000000 -0300 +++ mozilla/extensions/java/xpcom/tools/xpidl/xpidl_java.c 2008-08-06 13:30:56.000000000 -0300 @@ -48,6 +48,11 @@ #ifdef XP_WIN #include "windef.h" #define PATH_MAX MAX_PATH +#else +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" +#endif #endif static char* subscriptIdentifier(TreeState *state, char *str); diff -p -up mozilla/extensions/java/xpcom/tools/xpidl/xpidl_javastub.c.orig mozilla/extensions/java/xpcom/tools/xpidl/xpidl_javastub.c --- mozilla/extensions/java/xpcom/tools/xpidl/xpidl_javastub.c.orig 2008-08-06 13:23:54.000000000 -0300 +++ mozilla/extensions/java/xpcom/tools/xpidl/xpidl_javastub.c 2008-08-06 13:29:45.000000000 -0300 @@ -50,6 +50,11 @@ #ifdef XP_WIN #include "windef.h" #define PATH_MAX MAX_PATH +#else +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" +#endif #endif static char* subscriptIdentifier(TreeState *state, char *str); diff -p -up mozilla/intl/ctl/src/pangoLite/querymodules.c.orig mozilla/intl/ctl/src/pangoLite/querymodules.c --- mozilla/intl/ctl/src/pangoLite/querymodules.c.orig 2008-08-06 13:34:50.000000000 -0300 +++ mozilla/intl/ctl/src/pangoLite/querymodules.c 2008-08-06 13:38:00.000000000 -0300 @@ -68,6 +68,10 @@ #define getcwd _getcwd #else #define SOEXT ".so" +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" +#endif #endif void diff -p -up mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp.orig mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp --- mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp.orig 2008-08-06 16:51:57.000000000 -0300 +++ mozilla/mailnews/import/comm4x/src/nsComm4xProfile.cpp 2008-08-06 17:05:26.000000000 -0300 @@ -64,6 +64,8 @@ #define PREF_FILE_NAME_IN_4x "" #endif +#include <sys/param.h> + #ifndef MAXPATHLEN #ifdef _MAX_PATH #define MAXPATHLEN _MAX_PATH diff -p -up mozilla/modules/libreg/src/reg.c.orig mozilla/modules/libreg/src/reg.c --- mozilla/modules/libreg/src/reg.c.orig 2008-08-06 13:36:10.000000000 -0300 +++ mozilla/modules/libreg/src/reg.c 2008-08-06 13:45:25.000000000 -0300 @@ -95,9 +95,11 @@ #elif defined(XP_MACOSX) #define MAX_PATH PATH_MAX #elif defined(XP_UNIX) -#ifndef MAX_PATH -#define MAX_PATH 1024 +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" #endif +#define MAX_PATH PATH_MAX #elif defined(XP_OS2) #ifndef MAX_PATH #define MAX_PATH 260 diff -p -up mozilla/nsprpub/config/pathsub.h.orig mozilla/nsprpub/config/pathsub.h --- mozilla/nsprpub/config/pathsub.h.orig 2008-08-06 13:46:16.000000000 -0300 +++ mozilla/nsprpub/config/pathsub.h 2008-08-06 13:46:41.000000000 -0300 @@ -50,7 +50,7 @@ #endif #ifndef PATH_MAX -#define PATH_MAX 1024 +#error "PATH_MAX is not defined!" #endif /* diff -p -up mozilla/security/coreconf/nsinstall/pathsub.h.orig mozilla/security/coreconf/nsinstall/pathsub.h --- mozilla/security/coreconf/nsinstall/pathsub.h.orig 2008-08-06 13:47:17.000000000 -0300 +++ mozilla/security/coreconf/nsinstall/pathsub.h 2008-08-06 13:47:45.000000000 -0300 @@ -49,7 +49,7 @@ #endif #ifndef PATH_MAX -#define PATH_MAX 1024 +#error "PATH_MAX is not defined!" #endif /* diff -p -up mozilla/toolkit/mozapps/update/src/updater/updater.cpp.orig mozilla/toolkit/mozapps/update/src/updater/updater.cpp --- mozilla/toolkit/mozapps/update/src/updater/updater.cpp.orig 2008-08-06 16:57:33.000000000 -0300 +++ mozilla/toolkit/mozapps/update/src/updater/updater.cpp 2008-08-06 17:01:29.000000000 -0300 @@ -62,6 +62,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <limits.h> +#include <sys/param.h> #include <errno.h> #if defined(XP_WIN) diff -p -up mozilla/toolkit/xre/nsAppRunner.h.orig mozilla/toolkit/xre/nsAppRunner.h --- mozilla/toolkit/xre/nsAppRunner.h.orig 2008-08-06 16:55:26.000000000 -0300 +++ mozilla/toolkit/xre/nsAppRunner.h 2008-08-06 17:06:04.000000000 -0300 @@ -42,6 +42,8 @@ #include <windows.h> #endif +#include <sys/param.h> + #ifndef MAXPATHLEN #ifdef _MAX_PATH #define MAXPATHLEN _MAX_PATH diff -p -up mozilla/xpcom/build/nsXPCOMPrivate.h.orig mozilla/xpcom/build/nsXPCOMPrivate.h --- mozilla/xpcom/build/nsXPCOMPrivate.h.orig 2008-08-06 13:55:58.000000000 -0300 +++ mozilla/xpcom/build/nsXPCOMPrivate.h 2008-08-06 13:53:46.000000000 -0300 @@ -245,6 +245,12 @@ NS_GetFrozenFunctions(XPCOMFunctions *en #endif #ifndef MAXPATHLEN +#if defined(XP_UNIX) +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" +#endif +#endif #ifdef PATH_MAX #define MAXPATHLEN PATH_MAX #elif defined(_MAX_PATH) diff -p -up mozilla/xpcom/typelib/xpidl/xpidl_java.c.orig mozilla/xpcom/typelib/xpidl/xpidl_java.c --- mozilla/xpcom/typelib/xpidl/xpidl_java.c.orig 2008-08-06 13:56:13.000000000 -0300 +++ mozilla/xpcom/typelib/xpidl/xpidl_java.c 2008-08-06 14:03:29.000000000 -0300 @@ -51,6 +51,11 @@ #elif defined(XP_OS2) && !defined(PATH_MAX) #include <os2.h> #define PATH_MAX CCHMAXPATH +#elif defined(XP_UNIX) +#include <limits.h> +#ifndef PATH_MAX +#error "PATH_MAX is not defined!" +#endif #endif /* XXX Bug 331178 - nsIScriptSecurityManager inherits from non-scriptable