freebsd-ports/databases/mysql55-server/files/patch-mysys_default.c
Alex Dupre 1c5b6af38c Update to 5.5.7-rc release.
Fix crash caused by MAX_DEFAULT_DIRS too small [1]

PR:		ports/151927
Submitted by:	Bartosz Fabianowski <freebsd@chillt.de>
2010-11-10 16:55:08 +00:00

31 lines
919 B
C

--- mysys/default.c.orig 2010-11-02 23:01:13.000000000 +0100
+++ mysys/default.c 2010-11-10 16:39:51.000000000 +0100
@@ -70,7 +70,7 @@
/* Which directories are searched for options (and in which order) */
-#define MAX_DEFAULT_DIRS 6
+#define MAX_DEFAULT_DIRS 7
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */
static const char **default_directories = NULL;
@@ -711,7 +711,7 @@
{
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(0)))
- return 1;
+ return 0;
/*
Ignore world-writable regular files.
This is mainly done to protect us to not read a file created by
@@ -1153,7 +1153,10 @@
#if defined(DEFAULT_SYSCONFDIR)
if (DEFAULT_SYSCONFDIR[0])
+ {
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
+ }
#endif /* DEFAULT_SYSCONFDIR */
#endif