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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
88fb8b2e
Commit
88fb8b2e
authored
Mar 02, 2018
by
Daniel Black
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8743: protect myisam/aria MYD files and aria log files
parent
c54c490c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
storage/maria/ma_control_file.c
storage/maria/ma_control_file.c
+1
-1
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+3
-3
storage/maria/ma_open.c
storage/maria/ma_open.c
+2
-2
storage/myisam/mi_open.c
storage/myisam/mi_open.c
+2
-2
No files found.
storage/maria/ma_control_file.c
View file @
88fb8b2e
...
...
@@ -273,7 +273,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing,
" file is probably in use by another process"
;
uint
new_cf_create_time_size
,
new_cf_changeable_size
,
new_block_size
;
my_off_t
file_size
;
int
open_flags
=
O_BINARY
|
/*O_DIRECT |*/
O_RDWR
;
int
open_flags
=
O_BINARY
|
/*O_DIRECT |*/
O_RDWR
|
O_CLOEXEC
;
int
error
=
CONTROL_FILE_UNKNOWN_ERROR
;
DBUG_ENTER
(
"ma_control_file_open"
);
...
...
storage/maria/ma_loghandler.c
View file @
88fb8b2e
...
...
@@ -942,7 +942,7 @@ static File create_logfile_by_number_no_cache(uint32 file_no)
/* TODO: add O_DIRECT to open flags (when buffer is aligned) */
if
((
file
=
mysql_file_create
(
key_file_translog
,
translog_filename_by_fileno
(
file_no
,
path
),
0
,
O_BINARY
|
O_RDWR
,
MYF
(
MY_WME
)))
<
0
)
0
,
O_BINARY
|
O_RDWR
|
O_CLOEXEC
,
MYF
(
MY_WME
)))
<
0
)
{
DBUG_PRINT
(
"error"
,
(
"Error %d during creating file '%s'"
,
errno
,
path
));
translog_stop_writing
();
...
...
@@ -979,7 +979,7 @@ static File open_logfile_by_number_no_cache(uint32 file_no)
/* TODO: use mysql_file_create() */
if
((
file
=
mysql_file_open
(
key_file_translog
,
translog_filename_by_fileno
(
file_no
,
path
),
log_descriptor
.
open_flags
,
log_descriptor
.
open_flags
|
O_CLOEXEC
,
MYF
(
MY_WME
)))
<
0
)
{
DBUG_PRINT
(
"error"
,
(
"Error %d during opening file '%s'"
,
errno
,
path
));
...
...
@@ -3263,7 +3263,7 @@ static my_bool translog_get_last_page_addr(TRANSLOG_ADDRESS *addr,
File
fd
;
if
((
fd
=
mysql_file_open
(
key_file_translog
,
translog_filename_by_fileno
(
file_no
,
path
),
O_RDONLY
,
(
no_errors
?
MYF
(
0
)
:
MYF
(
MY_WME
))))
<
0
)
O_RDONLY
|
O_CLOEXEC
,
(
no_errors
?
MYF
(
0
)
:
MYF
(
MY_WME
))))
<
0
)
{
my_errno
=
errno
;
DBUG_PRINT
(
"error"
,
(
"Error %d during opening file #%d"
,
...
...
storage/maria/ma_open.c
View file @
88fb8b2e
...
...
@@ -1885,7 +1885,7 @@ int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share)
DEBUG_SYNC_C
(
"mi_open_datafile"
);
info
->
dfile
.
file
=
share
->
bitmap
.
file
.
file
=
mysql_file_open
(
key_file_dfile
,
share
->
data_file_name
.
str
,
share
->
mode
|
O_SHARE
,
MYF
(
flags
));
share
->
mode
|
O_SHARE
|
O_CLOEXEC
,
MYF
(
flags
));
return
info
->
dfile
.
file
>=
0
?
0
:
1
;
}
...
...
@@ -1899,7 +1899,7 @@ int _ma_open_keyfile(MARIA_SHARE *share)
mysql_mutex_lock
(
&
share
->
intern_lock
);
share
->
kfile
.
file
=
mysql_file_open
(
key_file_kfile
,
share
->
unique_file_name
.
str
,
share
->
mode
|
O_SHARE
|
O_NOFOLLOW
,
share
->
mode
|
O_SHARE
|
O_NOFOLLOW
|
O_CLOEXEC
,
MYF
(
MY_WME
|
MY_NOSYMLINKS
));
mysql_mutex_unlock
(
&
share
->
intern_lock
);
return
(
share
->
kfile
.
file
<
0
);
...
...
storage/myisam/mi_open.c
View file @
88fb8b2e
...
...
@@ -1249,7 +1249,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share)
myf
flags
=
MY_WME
|
(
share
->
mode
&
O_NOFOLLOW
?
MY_NOSYMLINKS
:
0
);
DEBUG_SYNC_C
(
"mi_open_datafile"
);
info
->
dfile
=
mysql_file_open
(
mi_key_file_dfile
,
share
->
data_file_name
,
share
->
mode
|
O_SHARE
,
MYF
(
flags
));
share
->
mode
|
O_SHARE
|
O_CLOEXEC
,
MYF
(
flags
));
return
info
->
dfile
>=
0
?
0
:
1
;
}
...
...
@@ -1258,7 +1258,7 @@ int mi_open_keyfile(MYISAM_SHARE *share)
{
if
((
share
->
kfile
=
mysql_file_open
(
mi_key_file_kfile
,
share
->
unique_file_name
,
share
->
mode
|
O_SHARE
|
O_NOFOLLOW
,
share
->
mode
|
O_SHARE
|
O_NOFOLLOW
|
O_CLOEXEC
,
MYF
(
MY_NOSYMLINKS
|
MY_WME
)))
<
0
)
return
1
;
return
0
;
...
...
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