chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d81349
)
sd-id128: id128_write overwrites target file
author
Evgeny Vereshchagin
<evvers@ya.ru>
Tue, 13 Dec 2016 11:45:01 +0000
(11:45 +0000)
committer
Sven Eden
<yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:35 +0000
(17:58 +0200)
src/libelogind/sd-id128/id128-util.c
patch
|
blob
|
history
diff --git
a/src/libelogind/sd-id128/id128-util.c
b/src/libelogind/sd-id128/id128-util.c
index a6687b0c9327b36c04bc358826f5989c6449a865..6c1c7f02d7ed8dcc02ade2e1d74e8d4b89836c5f 100644
(file)
--- a/
src/libelogind/sd-id128/id128-util.c
+++ b/
src/libelogind/sd-id128/id128-util.c
@@
-187,7
+187,7
@@
int id128_write_fd(int fd, Id128Format f, sd_id128_t id, bool do_sync) {
int id128_write(const char *p, Id128Format f, sd_id128_t id, bool do_sync) {
_cleanup_close_ int fd = -1;
- fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444);
+ fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY
|O_TRUNC
, 0444);
if (fd < 0)
return -errno;