summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-04-28 12:31:19 +0300
committerunknown <monty@mashka.mysql.fi>2003-04-28 12:31:19 +0300
commit8a05f5c7f497ff483f711dee55d3a1e7f5fe7e6a (patch)
tree45f058213fd744ba1701b372405b7088c7a633a4 /mysys
parent546097b95f94e88bb8f0c8fd33223c9ee75705db (diff)
downloadmariadb-git-8a05f5c7f497ff483f711dee55d3a1e7f5fe7e6a.tar.gz
Better test for regular files.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/default.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mysys/default.c b/mysys/default.c
index 26121cc0e56..c47d2719ab5 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -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);