diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2013-07-13 13:26:37 +0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2019-05-02 15:51:22 +0200 |
| commit | 4580b5fb67ef2544f0bc391418f762dc62086306 (patch) | |
| tree | 5abd5b1bfb38f089631aaf16d0b696a16f793fa5 /include/uapi/asm-generic | |
| parent | 31ac5eeaf0a60910c149731deb4b568b384d7e63 (diff) | |
Safer ABI for O_TMPFILE
[suggested by Rasmus Villemoes] make O_DIRECTORY | O_RDWR part of O_TMPFILE;
that will fail on old kernels in a lot more cases than what I came up with.
And make sure O_CREAT doesn't get there...
Change-Id: Iaa3c8b487d44515b539150bdb5d0b749b87d3ea2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/uapi/asm-generic')
| -rw-r--r-- | include/uapi/asm-generic/fcntl.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index 06632beaa..05ac354e1 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h @@ -84,10 +84,14 @@ #define O_PATH 010000000 #endif -#ifndef O_TMPFILE -#define O_TMPFILE 020000000 +#ifndef __O_TMPFILE +#define __O_TMPFILE 020000000 #endif +/* a horrid kludge trying to make sure that this will fail on old kernels */ +#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR) +#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE) + #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #endif |
