From a765f3443f7d646b3a84dcac491be98ae7537ee4 Mon Sep 17 00:00:00 2001 From: Cristian Rodríguez Date: Mon, 11 May 2015 15:01:37 -0300 Subject: shared: Use O_EXCL with O_TMPFILE in open_tmpfile In this usecase, the file will never be materialized with linkat(). --- src/shared/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/util.c') diff --git a/src/shared/util.c b/src/shared/util.c index de891447e7..466dce439f 100644 --- 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 -- cgit v1.2.3-54-g00ecf