This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/17523] open() and openat() ignore 'mode' with O_TMPFILE


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]