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
8fc7c288
Commit
8fc7c288
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
989b04f6
Changes
3
Hide 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/ftloader.cc
ft/ftloader.cc
+1
-1
ft/logger.cc
ft/logger.cc
+1
-1
No files found.
ft/ft-ops.cc
View file @
8fc7c288
...
...
@@ -3593,19 +3593,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 brt
// Requires: File does not exist.
static
int
ft_create_file
(
FT_HANDLE
UU
(
brt
),
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
;
...
...
@@ -3623,9 +3624,8 @@ static int ft_create_file(FT_HANDLE UU(brt), const char *fname, int *fdp) {
// open a file for use by the brt. 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
();
}
...
...
@@ -3783,13 +3783,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/ftloader.cc
View file @
8fc7c288
...
...
@@ -2727,7 +2727,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.cc
View file @
8fc7c288
...
...
@@ -730,7 +730,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