aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2013-08-01 21:07:52 -0700
committerMoyster <oysterized@gmail.com>2019-05-02 15:52:41 +0200
commit075c892076429d0553346ff01908e928b566f1db (patch)
treeb3a7d84a8465a5d3d609008d4e530ab2b01fb340 /fs
parent2b8eb63556e1f4f79a725bdfda14f19f5b32bddc (diff)
fs: Fix file mode for O_TMPFILE
O_TMPFILE, like O_CREAT, should respect the requested mode and should create regular files. This fixes two bugs: O_TMPFILE required privilege (because the mode ended up as 000) and it produced bogus inodes with no type. Change-Id: Ie4da9ede57e481c7edb113c5bc6329fefef41f4e Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c
index 7c364e8b3..83f6cc4e6 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -826,7 +826,7 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
int lookup_flags = 0;
int acc_mode;
- if (flags & O_CREAT)
+ if (flags & (O_CREAT | __O_TMPFILE))
op->mode = (mode & S_IALLUGO) | S_IFREG;
else
op->mode = 0;