projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91077af
)
shared: Use O_EXCL with O_TMPFILE in open_tmpfile
author
Cristian RodrÃguez
<crrodriguez@opensuse.org>
Mon, 11 May 2015 18:01:37 +0000
(15:01 -0300)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 13 May 2015 12:07:26 +0000
(14:07 +0200)
In this usecase, the file will never be materialized
with linkat().
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index
de89144
..
466dce4
100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-4838,7
+4838,7
@@
int open_tmpfile(const char *path, int flags) {
#ifdef O_TMPFILE
/* Try O_TMPFILE first, if it is supported */
- fd = open(path, flags|O_TMPFILE, S_IRUSR|S_IWUSR);
+ fd = open(path, flags|O_TMPFILE
|O_EXCL
, S_IRUSR|S_IWUSR);
if (fd >= 0)
return fd;
#endif