summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-02-18 15:02:54 -0800
committerunknown <jimw@mysql.com>2005-02-18 15:02:54 -0800
commitf1cea652d6bd98baffaacff275e6ff7a99ea8622 (patch)
tree6f49afe6c7bf8ebc2af9239bdb1d913b629014f7 /sql
parentac57068a7b75b4ff6117fad8cc10b11e4f3bc4cd (diff)
parent5edc77beb87e47d977a22945bfd82485d1707239 (diff)
downloadmariadb-git-f1cea652d6bd98baffaacff275e6ff7a99ea8622.tar.gz
Fix merge of fix for Bug #4872.
sql/mysqld.cc: Clean up merge
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a4a2fd5e1ef..3a0e02a3d74 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -298,12 +298,14 @@ my_bool lower_case_file_system= 0;
my_bool opt_innodb_safe_binlog= 0;
volatile bool mqh_used = 0;
+#ifdef HAVE_INITGROUPS
+static bool calling_initgroups= FALSE; /* Used in SIGSEGV handler. */
+#endif
uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
uint delay_key_write_options, protocol_version;
uint lower_case_table_names;
uint opt_crash_binlog_innodb;
uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
-
ulong back_log, connect_timeout, concurrency;
ulong server_id, thd_startup_options;
ulong table_cache_size, thread_stack, thread_stack_min, what_to_log;
@@ -1143,7 +1145,15 @@ static void set_user(const char *user, struct passwd *user_info)
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
DBUG_ASSERT(user_info);
#ifdef HAVE_INITGROUPS
- initgroups((char*) user,user_info->pw_gid);
+ /*
+ We can get a SIGSEGV when calling initgroups() on some systems when NSS
+ is configured to use LDAP and the server is statically linked. We set
+ calling_initgroups as a flag to the SIGSEGV handler that is then used to
+ output a specific message to help the user resolve this problem.
+ */
+ calling_initgroups= TRUE;
+ initgroups((char*) user, user_info->pw_gid);
+ calling_initgroups= FALSE;
#endif
if (setgid(user_info->pw_gid) == -1)
{
@@ -1897,6 +1907,17 @@ information that should help you find out what is causing the crash.\n");
fflush(stderr);
#endif /* HAVE_STACKTRACE */
+#ifdef HAVE_INITGROUPS
+ if (calling_initgroups)
+ fprintf(stderr, "\n\
+This crash occured while the server was calling initgroups(). This is\n\
+often due to the use of a mysqld that is statically linked against glibc\n\
+and configured to use LDAP in /etc/nsswitch.conf. You will need to either\n\
+upgrade to a version of glibc that does not have this problem (2.3.4 or\n\
+later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\
+mysqld that is not statically linked.\n");
+#endif
+
if (test_flags & TEST_CORE_ON_SIGNAL)
{
fprintf(stderr, "Writing a core file\n");