Permalink
Browse files

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
  • Loading branch information...
vuvova committed Sep 11, 2016
1 parent 611dc0d commit 347eeefbfc658c8531878218487d729f4e020805
Showing with 8 additions and 5 deletions.
  1. +2 −2 include/my_sys.h
  2. +4 −3 mysys/my_redel.c
  3. +1 −0 mysys/my_static.c
  4. +1 −0 sql/mysqld.cc
View
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
Copyright (c) 2010, 2016, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -246,7 +246,7 @@ extern my_bool my_use_symdir;
extern ulong my_default_record_cache_size;
extern my_bool my_disable_locking, my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern my_bool my_disable_sync;
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
/* from default.c */
View
@@ -1,5 +1,5 @@
/*
Copyright (c) 2000, 2010, Oracle and/or its affiliates
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates
Copyright (c) 2009, 2016, MariaDB
This program is free software; you can redistribute it and/or modify
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,
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
org_name,tmp_name,MyFlags));
if (my_copystat(org_name,tmp_name,MyFlags) < 0)
if (!my_disable_copystat_in_redel &&
my_copystat(org_name,tmp_name,MyFlags) < 0)
goto end;
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{
View
@@ -99,6 +99,7 @@ my_bool my_disable_sync=0;
my_bool my_disable_async_io=0;
my_bool my_disable_flush_key_blocks=0;
my_bool my_disable_symlinks=0;
my_bool my_disable_copystat_in_redel=0;
/*
Note that PSI_hook and PSI_server are unconditionally
View
@@ -3455,6 +3455,7 @@ static int init_common_variables()
max_system_variables.pseudo_thread_id= (ulong)~0;
server_start_time= flush_status_time= my_time(0);
my_disable_copystat_in_redel= 1;
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;

0 comments on commit 347eeef

Please sign in to comment.