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
59e976de
Commit
59e976de
authored
Jul 31, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-311 create data and log files with the execute bit OFF
parent
f680b2cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
ft/ft-ops.cc
ft/ft-ops.cc
+6
-7
ft/loader/loader.cc
ft/loader/loader.cc
+1
-1
ft/logger/logger.cc
ft/logger/logger.cc
+1
-1
No files found.
ft/ft-ops.cc
View file @
59e976de
...
...
@@ -2774,19 +2774,20 @@ static inline int ft_open_maybe_direct(const char *filename, int oflag, int mode
}
}
static
const
mode_t
file_mode
=
S_IRUSR
+
S_IWUSR
+
S_IRGRP
+
S_IWGRP
+
S_IROTH
+
S_IWOTH
;
// open a file for use by the ft
// Requires: File does not exist.
static
int
ft_create_file
(
FT_HANDLE
UU
(
ft_handle
),
const
char
*
fname
,
int
*
fdp
)
{
mode_t
mode
=
S_IRWXU
|
S_IRWXG
|
S_IRWXO
;
int
r
;
int
fd
;
int
er
;
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_BINARY
,
mode
);
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_BINARY
,
file_
mode
);
assert
(
fd
==-
1
);
if
((
er
=
get_maybe_error_errno
())
!=
ENOENT
)
{
return
er
;
}
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
mode
);
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
file_
mode
);
if
(
fd
==-
1
)
{
r
=
get_error_errno
();
return
r
;
...
...
@@ -2804,9 +2805,8 @@ static int ft_create_file(FT_HANDLE UU(ft_handle), const char *fname, int *fdp)
// open a file for use by the ft. if the file does not exist, error
static
int
ft_open_file
(
const
char
*
fname
,
int
*
fdp
)
{
mode_t
mode
=
S_IRWXU
|
S_IRWXG
|
S_IRWXO
;
int
fd
;
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_BINARY
,
mode
);
fd
=
ft_open_maybe_direct
(
fname
,
O_RDWR
|
O_BINARY
,
file_
mode
);
if
(
fd
==-
1
)
{
return
get_error_errno
();
}
...
...
@@ -2976,13 +2976,12 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
}
if
(
r
==
ENOENT
&&
is_create
)
{
did_create
=
true
;
mode_t
mode
=
S_IRWXU
|
S_IRWXG
|
S_IRWXO
;
if
(
txn
)
{
BYTESTRING
bs
=
{
.
len
=
(
uint32_t
)
strlen
(
fname_in_env
),
.
data
=
(
char
*
)
fname_in_env
};
toku_logger_save_rollback_fcreate
(
txn
,
reserved_filenum
,
&
bs
);
// bs is a copy of the fname relative to the environment
}
txn_created
=
(
bool
)(
txn
!=
NULL
);
toku_logger_log_fcreate
(
txn
,
fname_in_env
,
reserved_filenum
,
mode
,
ft_h
->
options
.
flags
,
ft_h
->
options
.
nodesize
,
ft_h
->
options
.
basementnodesize
,
ft_h
->
options
.
compression_method
);
toku_logger_log_fcreate
(
txn
,
fname_in_env
,
reserved_filenum
,
file_
mode
,
ft_h
->
options
.
flags
,
ft_h
->
options
.
nodesize
,
ft_h
->
options
.
basementnodesize
,
ft_h
->
options
.
compression_method
);
r
=
ft_create_file
(
ft_h
,
fname_in_cwd
,
&
fd
);
if
(
r
)
{
goto
exit
;
}
}
...
...
ft/loader/loader.cc
View file @
59e976de
...
...
@@ -2731,7 +2731,7 @@ static int loader_do_i (FTLOADER bl,
if
(
r
)
goto
error
;
{
mode_t
mode
=
S_IR
WXU
|
S_IRWXG
|
S_IRWXO
;
mode_t
mode
=
S_IR
USR
+
S_IWUSR
+
S_IRGRP
+
S_IWGRP
;
int
fd
=
toku_os_open
(
new_fname
,
O_RDWR
|
O_CREAT
|
O_BINARY
,
mode
);
// #2621
if
(
fd
<
0
)
{
r
=
get_error_errno
();
goto
error
;
...
...
ft/logger/logger.cc
View file @
59e976de
...
...
@@ -723,7 +723,7 @@ static int open_logfile (TOKULOGGER logger)
snprintf
(
fname
,
fnamelen
,
"%s/log%012lld.tokulog%d"
,
logger
->
directory
,
logger
->
next_log_file_number
,
TOKU_LOG_VERSION
);
long
long
index
=
logger
->
next_log_file_number
;
if
(
logger
->
write_log_files
)
{
logger
->
fd
=
open
(
fname
,
O_CREAT
+
O_WRONLY
+
O_TRUNC
+
O_EXCL
+
O_BINARY
,
S_IR
WXU
);
logger
->
fd
=
open
(
fname
,
O_CREAT
+
O_WRONLY
+
O_TRUNC
+
O_EXCL
+
O_BINARY
,
S_IR
USR
+
S_IWUSR
);
if
(
logger
->
fd
==-
1
)
{
return
get_error_errno
();
}
...
...
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