Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
357766ec
Commit
357766ec
authored
Mar 10, 2003
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore world-writeable my.cnf's
parent
d086e735
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
mysys/default.c
mysys/default.c
+13
-2
No files found.
mysys/default.c
View file @
357766ec
...
...
@@ -39,6 +39,7 @@
#include "mysys_priv.h"
#include "m_string.h"
#include "m_ctype.h"
#include <my_dir.h>
char
*
defaults_extra_file
=
0
;
...
...
@@ -60,13 +61,13 @@ DATADIR,
NullS
,
};
#define default_ext
".cnf"
/* extension for config file */
#define default_ext ".cnf"
/* extension for config file */
#ifdef __WIN__
#include <winbase.h>
#define windows_ext ".ini"
#endif
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
ext
,
TYPELIB
*
group
);
...
...
@@ -241,6 +242,16 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
{
strmov
(
name
,
config_file
);
}
fn_format
(
name
,
name
,
""
,
""
,
4
);
#if !defined(__WIN__) && !defined(OS2)
{
MY_STAT
stat_info
;
if
(
!
my_stat
(
name
,
&
stat_info
,
MYF
(
MY_WME
)))
return
0
;
if
(
stat_info
.
st_mode
&
S_IWOTH
)
/* ignore world-writeable files */
return
0
;
}
#endif
if
(
!
(
fp
=
my_fopen
(
fn_format
(
name
,
name
,
""
,
""
,
4
),
O_RDONLY
,
MYF
(
0
))))
return
0
;
/* Ignore wrong files */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment