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
9d48570c
Commit
9d48570c
authored
Dec 07, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
two fixes for potential security bugs
parent
59abcd44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
sql/log.cc
sql/log.cc
+10
-8
sql/sql_class.cc
sql/sql_class.cc
+2
-2
No files found.
sql/log.cc
View file @
9d48570c
...
...
@@ -1797,6 +1797,7 @@ bool flush_error_log()
char
err_renamed
[
FN_REFLEN
],
*
end
;
end
=
strmake
(
err_renamed
,
log_error_file
,
FN_REFLEN
-
4
);
strmov
(
end
,
"-old"
);
VOID
(
pthread_mutex_lock
(
&
LOCK_error_log
));
#ifdef __WIN__
char
err_temp
[
FN_REFLEN
+
4
];
/*
...
...
@@ -1804,7 +1805,7 @@ bool flush_error_log()
the current error file.
*/
strmov
(
strmov
(
err_temp
,
err_renamed
),
"-tmp"
);
(
void
)
my_delete
(
err_temp
,
MYF
(
0
));
(
void
)
my_delete
(
err_temp
,
MYF
(
0
));
if
(
freopen
(
err_temp
,
"a+"
,
stdout
))
{
freopen
(
err_temp
,
"a+"
,
stderr
);
...
...
@@ -1817,20 +1818,21 @@ bool flush_error_log()
if
((
fd
=
my_open
(
err_temp
,
O_RDONLY
,
MYF
(
0
)))
>=
0
)
{
while
((
bytes
=
(
int
)
my_read
(
fd
,
(
byte
*
)
buf
,
IO_SIZE
,
MYF
(
0
)))
>
0
)
my_fwrite
(
stderr
,
(
byte
*
)
buf
,
(
uint
)
strlen
(
buf
),
MYF
(
0
));
my_fwrite
(
stderr
,
(
byte
*
)
buf
,
bytes
,
MYF
(
0
));
my_close
(
fd
,
MYF
(
0
));
}
(
void
)
my_delete
(
err_temp
,
MYF
(
0
));
(
void
)
my_delete
(
err_temp
,
MYF
(
0
));
}
else
result
=
1
;
#else
my_rename
(
log_error_file
,
err_renamed
,
MYF
(
0
));
if
(
freopen
(
log_error_file
,
"a+"
,
stdout
))
freopen
(
log_error_file
,
"a+"
,
stderr
);
else
result
=
1
;
my_rename
(
log_error_file
,
err_renamed
,
MYF
(
0
));
if
(
freopen
(
log_error_file
,
"a+"
,
stdout
))
freopen
(
log_error_file
,
"a+"
,
stderr
);
else
result
=
1
;
#endif
VOID
(
pthread_mutex_unlock
(
&
LOCK_error_log
));
}
return
result
;
}
...
...
sql/sql_class.cc
View file @
9d48570c
...
...
@@ -564,7 +564,7 @@ select_export::prepare(List<Item> &list)
return
1
;
}
/* Create the file world readable */
if
((
file
=
my_create
(
path
,
0666
,
O_WRONLY
,
MYF
(
MY_WME
)))
<
0
)
if
((
file
=
my_create
(
path
,
0666
,
O_WRONLY
|
O_EXCL
,
MYF
(
MY_WME
)))
<
0
)
return
1
;
#ifdef HAVE_FCHMOD
(
void
)
fchmod
(
file
,
0666
);
// Because of umask()
...
...
@@ -803,7 +803,7 @@ select_dump::prepare(List<Item> &list __attribute__((unused)))
return
1
;
}
/* Create the file world readable */
if
((
file
=
my_create
(
path
,
0666
,
O_WRONLY
,
MYF
(
MY_WME
)))
<
0
)
if
((
file
=
my_create
(
path
,
0666
,
O_WRONLY
|
O_EXCL
,
MYF
(
MY_WME
)))
<
0
)
return
1
;
#ifdef HAVE_FCHMOD
(
void
)
fchmod
(
file
,
0666
);
// Because of umask()
...
...
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