Skip to content

Commit 69271ff

Browse files
committed
Merge tag 'clone-5.5.60-build' into mysql-5.5-cluster-7.2
Change-Id: I5d7ca4f5a0abc18f9003bee83bb28c856fabcae0
2 parents 31a2a71 + c0b4d74 commit 69271ff

34 files changed

+404
-87
lines changed

Docs/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
You can find a detailed list of changes at
2+
to https://github.com/mysql/mysql-server/commits/5.5

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=5
3-
MYSQL_VERSION_PATCH=59
3+
MYSQL_VERSION_PATCH=60
44
MYSQL_VERSION_EXTRA=-ndb-7.2.33

include/mysql_com.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -561,6 +561,7 @@ void my_thread_end(void);
561561

562562
#ifdef _global_h
563563
ulong STDCALL net_field_length(uchar **packet);
564+
ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length);
564565
my_ulonglong net_field_length_ll(uchar **packet);
565566
uchar *net_store_length(uchar *pkg, ulonglong length);
566567
#endif

include/sql_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ void mysql_client_plugin_deinit();
107107
struct st_mysql_client_plugin;
108108
extern struct st_mysql_client_plugin *mysql_client_builtins[];
109109
extern my_bool libmysql_cleartext_plugin_enabled;
110+
int is_file_or_dir_world_writable(const char *filepath);
110111

111112
#ifdef __cplusplus
112113
}

mysql-test/include/mtr_warnings.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
1+
-- Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
22
--
33
-- This program is free software; you can redistribute it and/or modify
44
-- it under the terms of the GNU General Public License as published by
@@ -209,6 +209,12 @@ INSERT INTO global_suppressions VALUES
209209
*/
210210
("Insecure configuration for --secure-file-priv:*"),
211211

212+
/*
213+
Bug#26585560, warning related to --pid-file
214+
*/
215+
("Insecure configuration for --pid-file:*"),
216+
("Few location(s) are inaccessible while checking PID filepath"),
217+
212218
("THE_LAST_SUPPRESSION")||
213219

214220

mysql-test/mysql-test-run.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,6 +2367,7 @@ sub environment_setup {
23672367
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
23682368
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
23692369
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
2370+
$ENV{'MYSQL_TEST_DIR_ABS'}= getcwd();
23702371
$ENV{'MYSQL_BINDIR'}= "$bindir";
23712372
$ENV{'MYSQL_SHAREDIR'}= $path_language;
23722373
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;

mysql-test/t/mysqld--defaults-file.test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1;
1313
--error 1
1414
exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
1515

16-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
16+
# Using $MYSQL_TEST_DIR_ABS which contains canonical path to the
17+
# test directory since --print-default prints the absolute path.
18+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
1719
--error 1
1820
exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
1921

20-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
22+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2123
--error 1
2224
exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
2325

24-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
26+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2527
--error 1
2628
exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
2729

28-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
30+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2931
--error 1
3032
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
3133

mysys/lf_hash.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -83,7 +83,8 @@ static int my_lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
8383
do { /* PTR() isn't necessary below, head is a dummy node */
8484
cursor->curr= (LF_SLIST *)(*cursor->prev);
8585
_lf_pin(pins, 1, cursor->curr);
86-
} while (*cursor->prev != (intptr)cursor->curr && LF_BACKOFF);
86+
} while (my_atomic_loadptr((void**)cursor->prev) != cursor->curr &&
87+
LF_BACKOFF);
8788
for (;;)
8889
{
8990
if (unlikely(!cursor->curr))
@@ -97,7 +98,7 @@ static int my_lfind(LF_SLIST * volatile *head, CHARSET_INFO *cs, uint32 hashnr,
9798
cur_hashnr= cursor->curr->hashnr;
9899
cur_key= cursor->curr->key;
99100
cur_keylen= cursor->curr->keylen;
100-
if (*cursor->prev != (intptr)cursor->curr)
101+
if (my_atomic_loadptr((void**)cursor->prev) != cursor->curr)
101102
{
102103
(void)LF_BACKOFF;
103104
goto retry;

packaging/rpm-oel/mysql.spec.in

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -609,14 +609,6 @@ rm -rf %{buildroot}%{_bindir}/mysql_embedded
609609
rm -rf %{buildroot}%{_bindir}/mysql_setpermission
610610
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
611611

612-
# Remove obsoleted man pages
613-
rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1
614-
rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1
615-
rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1
616-
rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
617-
rm -f %{buildroot}%{_mandir}/man1/mysqltest.1
618-
rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
619-
620612
%check
621613
%if 0%{?runselftest}
622614
pushd release
@@ -920,6 +912,9 @@ fi
920912
%endif
921913

922914
%changelog
915+
* Wed Jan 10 2018 Bjorn Munch <[email protected]> - 5.5.60-1
916+
- No longer need to remove obsoleted mysqltest man pages
917+
923918
* Tue Oct 31 2017 Bjorn Munch <[email protected]> - 5.5.59-1
924919
- Remove obsoleted mysqltest man pages
925920

packaging/rpm-sles/mysql.spec.in

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -446,14 +446,6 @@ rm -rf %{buildroot}%{_bindir}/mysql_embedded
446446
rm -rf %{buildroot}%{_bindir}/mysql_setpermission
447447
rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1*
448448

449-
# Remove obsoleted man pages
450-
rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1
451-
rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1
452-
rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1
453-
rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1
454-
rm -f %{buildroot}%{_mandir}/man1/mysqltest.1
455-
rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1
456-
457449
# rcmysql symlink
458450
install -d %{buildroot}%{_sbindir}
459451
ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql
@@ -742,6 +734,9 @@ fi
742734
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
743735

744736
%changelog
737+
* Wed Jan 10 2018 Bjorn Munch <[email protected]> - 5.5.60-1
738+
- No longer need to remove obsoleted mysqltest man pages
739+
745740
* Tue Oct 31 2017 Bjorn Munch <[email protected]> - 5.5.59-1
746741
- Remove obsoleted mysqltest man pages
747742

sql-common/client.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -1735,18 +1735,20 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
17351735
end_pos=pos+pkt_len;
17361736
for (field=0 ; field < fields ; field++)
17371737
{
1738-
if ((len=(ulong) net_field_length(&pos)) == NULL_LENGTH)
1738+
len=(ulong) net_field_length_checked(&pos, (ulong)(end_pos - pos));
1739+
if (pos > end_pos)
1740+
{
1741+
set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
1742+
return -1;
1743+
}
1744+
1745+
if (len == NULL_LENGTH)
17391746
{ /* null field */
17401747
row[field] = 0;
17411748
*lengths++=0;
17421749
}
17431750
else
17441751
{
1745-
if (len > (ulong) (end_pos - pos))
1746-
{
1747-
set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
1748-
return -1;
1749-
}
17501752
row[field] = (char*) pos;
17511753
pos+=len;
17521754
*lengths++=len;

sql-common/my_path_permissions.cc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
3+
This program is free software; you can redistribute it and/or modify it
4+
under the terms of the GNU General Public License as published by the
5+
Free Software Foundation; version 2 of the License.
6+
7+
This program is distributed in the hope that it will be useful, but
8+
WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
General Public License for more details.
11+
12+
You should have received a copy of the GNU General Public License
13+
along with this program; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15+
02110-1301, USA */
16+
17+
#include "my_dir.h"
18+
19+
#ifdef __cplusplus
20+
extern "C" {
21+
#endif
22+
23+
/**
24+
Check if a file/dir is world-writable (only on non-Windows platforms)
25+
26+
@param [in] Path of the file/dir to be checked
27+
28+
@returns Status of the file/dir check
29+
@retval -2 Permission denied to check attributes of file/dir
30+
@retval -1 Error in reading file/dir
31+
@retval 0 File/dir is not world-writable
32+
@retval 1 File/dir is world-writable
33+
*/
34+
35+
int is_file_or_dir_world_writable(const char *path)
36+
{
37+
MY_STAT stat_info;
38+
(void)path; // avoid unused param warning when built on Windows
39+
#ifndef _WIN32
40+
if (!my_stat(path, &stat_info, MYF(0)))
41+
{
42+
return (errno == EACCES) ? -2 : -1;
43+
}
44+
if ((stat_info.st_mode & S_IWOTH) &&
45+
((stat_info.st_mode & S_IFMT) == S_IFREG || /* file */
46+
(stat_info.st_mode & S_IFMT) == S_IFDIR)) /* or dir */
47+
return 1;
48+
#endif
49+
return 0;
50+
}
51+
52+
#ifdef __cplusplus
53+
}
54+
#endif

sql-common/pack.c

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* Copyright (c) 2000-2003, 2007 MySQL AB
2-
Use is subject to license terms
1+
/* Copyright (c) 2000, 2018 Oracle and/or its affiliates. All rights reserved.
32
43
This program is free software; you can redistribute it and/or modify
54
it under the terms of the GNU General Public License as published by
@@ -46,6 +45,40 @@ ulong STDCALL net_field_length(uchar **packet)
4645
return (ulong) uint4korr(pos+1);
4746
}
4847

48+
/* The same as above but with max length check */
49+
ulong STDCALL net_field_length_checked(uchar **packet, ulong max_length)
50+
{
51+
ulong len;
52+
uchar *pos= (uchar *)*packet;
53+
54+
if (*pos < 251)
55+
{
56+
(*packet)++;
57+
len= (ulong) *pos;
58+
return (len > max_length) ? max_length : len;
59+
}
60+
if (*pos == 251)
61+
{
62+
(*packet)++;
63+
return NULL_LENGTH;
64+
}
65+
if (*pos == 252)
66+
{
67+
(*packet)+=3;
68+
len= (ulong) uint2korr(pos+1);
69+
return (len > max_length) ? max_length : len;
70+
}
71+
if (*pos == 253)
72+
{
73+
(*packet)+=4;
74+
len= (ulong) uint3korr(pos+1);
75+
return (len > max_length) ? max_length : len;
76+
}
77+
(*packet)+=9; /* Must be 254 when here */
78+
len= (ulong) uint4korr(pos+1);
79+
return (len > max_length) ? max_length : len;
80+
}
81+
4982
/* The same as above but returns longlong */
5083
my_ulonglong net_field_length_ll(uchar **packet)
5184
{

sql/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ SET (SQL_SOURCE
7979
sql_profile.cc event_parse_data.cc sql_alter.cc
8080
sql_signal.cc rpl_handler.cc mdl.cc sql_admin.cc
8181
transaction.cc sys_vars.cc sql_truncate.cc datadict.cc
82-
sql_reload.cc
82+
sql_reload.cc ../sql-common/my_path_permissions.cc
8383
${GEN_SOURCES}
8484
${CONF_SOURCES}
8585
${MYSYS_LIBWRAP_SOURCE})

sql/event_db_repository.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -178,6 +178,8 @@ class Event_db_intact : public Table_check_intact
178178
error_log_print(ERROR_LEVEL, fmt, args);
179179
va_end(args);
180180
}
181+
public:
182+
Event_db_intact() { has_keys= TRUE; }
181183
};
182184

183185
/** In case of an error, a message is printed to the error log. */

0 commit comments

Comments
 (0)