Skip to content

Commit 347eeef

Browse files
committed
don't use my_copystat in the server
it was supposed to be used in command-line tools only. Different fix for 4e54738: Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
1 parent 611dc0d commit 347eeef

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

include/my_sys.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
2-
Copyright (c) 2010, 2013, Monty Program Ab.
2+
Copyright (c) 2010, 2016, Monty Program Ab.
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
@@ -246,7 +246,7 @@ extern my_bool my_use_symdir;
246246
extern ulong my_default_record_cache_size;
247247
extern my_bool my_disable_locking, my_disable_async_io,
248248
my_disable_flush_key_blocks, my_disable_symlinks;
249-
extern my_bool my_disable_sync;
249+
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
250250
extern char wild_many,wild_one,wild_prefix;
251251
extern const char *charsets_dir;
252252
/* from default.c */

mysys/my_redel.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/*
2-
Copyright (c) 2000, 2010, Oracle and/or its affiliates
1+
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates
2+
Copyright (c) 2009, 2016, MariaDB
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
@@ -49,7 +49,8 @@ int my_redel(const char *org_name, const char *tmp_name,
4949
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
5050
org_name,tmp_name,MyFlags));
5151

52-
if (my_copystat(org_name,tmp_name,MyFlags) < 0)
52+
if (!my_disable_copystat_in_redel &&
53+
my_copystat(org_name,tmp_name,MyFlags) < 0)
5354
goto end;
5455
if (MyFlags & MY_REDEL_MAKE_BACKUP)
5556
{

mysys/my_static.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ my_bool my_disable_sync=0;
9999
my_bool my_disable_async_io=0;
100100
my_bool my_disable_flush_key_blocks=0;
101101
my_bool my_disable_symlinks=0;
102+
my_bool my_disable_copystat_in_redel=0;
102103

103104
/*
104105
Note that PSI_hook and PSI_server are unconditionally

sql/mysqld.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,7 @@ static int init_common_variables()
34553455

34563456
max_system_variables.pseudo_thread_id= (ulong)~0;
34573457
server_start_time= flush_status_time= my_time(0);
3458+
my_disable_copystat_in_redel= 1;
34583459

34593460
rpl_filter= new Rpl_filter;
34603461
binlog_filter= new Rpl_filter;

0 commit comments

Comments
 (0)