diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-09-11 03:11:35 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-09-11 03:11:35 -0400 |
commit | 775921d02b2d1fea48e6232520497c2ad7431975 (patch) | |
tree | a99ed9b547dcbef15fe495fb9a11cd32f0eae02c | |
parent | tests: add dynamic/static categories (diff) | |
download | sandbox-2.7.tar.gz sandbox-2.7.tar.bz2 sandbox-2.7.zip |
libsandbox: handle open's O_TMPFILE flagv2.7
This new flag needs us to unpack & pass down the mode rather than
always sending in the value of 0.
URL: http://bugs.gentoo.org/529044
Reported-by: Aidan Thornton <makosoft@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/wrapper-funcs/openat.c | 2 | ||||
-rw-r--r-- | localdecls.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libsandbox/wrapper-funcs/openat.c b/libsandbox/wrapper-funcs/openat.c index 3e46ad5..846c63f 100644 --- a/libsandbox/wrapper-funcs/openat.c +++ b/libsandbox/wrapper-funcs/openat.c @@ -24,7 +24,7 @@ #define WRAPPER_SAFE_POST_EXPAND \ int mode = 0; \ - if (flags & O_CREAT) { \ + if (flags & (O_CREAT | O_TMPFILE)) { \ va_list ap; \ va_start(ap, flags); \ mode = va_arg(ap, int); \ diff --git a/localdecls.h b/localdecls.h index be99617..0e11fea 100644 --- a/localdecls.h +++ b/localdecls.h @@ -52,6 +52,9 @@ #ifndef O_CLOEXEC # define O_CLOEXEC 0 #endif +#ifndef O_TMPFILE +# define O_TMPFILE 0 +#endif #if !HAVE_DECL_ENVIRON extern char **environ; |