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: "e at nanocritical dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 30 Oct 2014 04:56:05 +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
Eric Rannaud <e at nanocritical dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |e at nanocritical dot com
--- Comment #1 from Eric Rannaud <e at nanocritical dot com> ---
Created attachment 7864
--> https://sourceware.org/bugzilla/attachment.cgi?id=7864&action=edit
Proposed fix
Patch written against 'master', successfully tested on top of Arch's glibc
2.20-2
Note that O_TMPFILE is a multi-bit mask, so the test becomes:
- if (oflag & O_CREAT)
+ if ((oflag & O_CREAT) != 0 || (oflag & O_TMPFILE) == O_TMPFILE)
Using (oflag & O_TMPFILE) != 0 would trigger when just O_DIRECTORY is in oflag,
as the definition of O_TMPFILE is (see https://lwn.net/Articles/558951/)
#define O_TMPFILE (O_DIRECTORY | O_RDWR | __O_TMPFILE)
I've modified all instances of the test (oflag & O_CREAT) in the source as I
believe the change is required everywhere, but this should be reviewed.
--
You are receiving this mail because:
You are on the CC list for the bug.