This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/17523] open() and openat() ignore 'mode' with O_TMPFILE
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 06 Nov 2014 21:41:48 +0000
- Subject: [Bug libc/17523] open() and openat() ignore 'mode' with O_TMPFILE
- Auto-submitted: auto-generated
- References: <bug-17523-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17523
--- Comment #6 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Eric Rannaud from comment #5)
> Now, Florian is correct that the file created by O_TMPFILE is not
> immediately visible on the filesystem. BUT, O_TMPFILE is likely to be used
> in the following sequence, to implement a secure temporary file facility:
>
> fd = open("/path/to/dir", O_TMPFILE|O_WRONLY, 0600);
> snprintf(path, PATH_MAX, "/proc/self/fd/%d", fd);
> linkat(AT_FDCWD, path, AT_FDCWD, "/path/for/file", AT_SYMLINK_FOLLOW);
Why would anyone want to do this instead of opening /path/for/file directly
with O_CREATE|O_EXCL?
Anyway, I can't find any applications using this pattern.
--
You are receiving this mail because:
You are on the CC list for the bug.