From 8454a6b25e82bf4fa91ced5c8f103b32fb845032 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Apr 2006 00:43:58 +0200 Subject: configure.in: Check for crypt() in libc first (bug#16478) configure.in: Check for crypt() in libc first (bug#16478) --- configure.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index b230b7f042e..9123f87924d 100644 --- a/configure.in +++ b/configure.in @@ -827,9 +827,8 @@ AC_CHECK_FUNC(yp_get_default_domain, , AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open)) # This may get things to compile even if bind-8 is installed AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) -# For crypt() on Linux -AC_CHECK_LIB(crypt, crypt) -AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], [1], [crypt])) +# Check if crypt() exists in libc or libcrypt, sets LIBS if needed +AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt])) # For sem_xxx functions on Solaris 2.6 AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init)) -- cgit v1.2.1 From 12116ce9dac5cf0f4f4406c15db5192d220c7a94 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Apr 2006 16:41:12 -0700 Subject: small optimization of the previous bugfix (based on the fact that packet is ALWAYS \0 terminated, see my_net_read) --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 93f696f6d49..8f8eacbb77b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -647,7 +647,7 @@ check_connections(THD *thd) char *db=0; if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB) db=strend(passwd)+1; - if (strend(db ? db : passwd) - (char*)net->read_pos > pkt_len) + if ((db ? db : passwd) - (char*)net->read_pos > pkt_len) { inc_host_errors(&thd->remote.sin_addr); return ER_HANDSHAKE_ERROR; -- cgit v1.2.1