mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Better test for regular files.
This commit is contained in:
@@ -249,8 +249,13 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
|
||||
MY_STAT stat_info;
|
||||
if (!my_stat(name,&stat_info,MYF(0)))
|
||||
return 0;
|
||||
/* ignore world-writeable _regular_ files */
|
||||
if (stat_info.st_mode & S_IWOTH && stat_info.st_mode & S_IFREG)
|
||||
/*
|
||||
Ignore world-writable regular files.
|
||||
This is mainly done to protect us to not read a file created by
|
||||
the mysqld server, but the check is still valid in most context.
|
||||
*/
|
||||
if ((stat_info.st_mode & S_IWOTH) &&
|
||||
(stat_info.st_mode & S_IFMT) == S_IFREG)
|
||||
{
|
||||
fprintf(stderr, "warning: World-writeable config file %s is ignored\n",
|
||||
name);
|
||||
|
||||
Reference in New Issue
Block a user