Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
a9108bf1
Commit
a9108bf1
authored
Apr 12, 2014
by
Paul Eggert
Browse files
* keyboard.c (Fopen_dribble_file): Avoid some races.
Fixes: debbugs:17187
parent
175a3a51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
src/ChangeLog
src/ChangeLog
+4
-0
src/keyboard.c
src/keyboard.c
+3
-9
No files found.
src/ChangeLog
View file @
a9108bf1
2014-04-12 Paul Eggert <eggert@cs.ucla.edu>
* keyboard.c (Fopen_dribble_file): Avoid some races. (Bug#17187)
2014-04-12 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (move_it_by_lines): If a large portion of buffer text is
...
...
src/keyboard.c
View file @
a9108bf1
...
...
@@ -10088,15 +10088,9 @@ This may include sensitive information such as passwords. */)
{
int fd;
file = Fexpand_file_name (file, Qnil);
/* This isn't robust, since eg file could be created after we
check whether it exists but before emacs_open.
Feel free to improve it, but this is not critical. (Bug#17187) */
if (! NILP (Ffile_exists_p (file)))
{
if (chmod (SSDATA (file), 0600) < 0)
report_file_error ("Doing chmod", file);
}
fd = emacs_open (SSDATA (file), O_WRONLY | O_CREAT | O_TRUNC, 0600);
fd = emacs_open (SSDATA (file), O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd < 0 && errno == EEXIST && unlink (SSDATA (file)) == 0)
fd = emacs_open (SSDATA (file), O_WRONLY | O_CREAT | O_EXCL, 0600);
dribble = fd < 0 ? 0 : fdopen (fd, "w");
if (dribble == 0)
report_file_error ("Opening dribble", file);
...
...
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