diff options
Diffstat (limited to 'libsandbox/wrapper-funcs/fopen_pre_check.c')
-rw-r--r-- | libsandbox/wrapper-funcs/fopen_pre_check.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libsandbox/wrapper-funcs/fopen_pre_check.c b/libsandbox/wrapper-funcs/fopen_pre_check.c index 765526e..95108e0 100644 --- a/libsandbox/wrapper-funcs/fopen_pre_check.c +++ b/libsandbox/wrapper-funcs/fopen_pre_check.c @@ -11,8 +11,7 @@ bool sb_fopen_pre_check(const char *func, const char *pathname, const char *mode save_errno(); /* If we're trying to read, fail normally if file does not stat */ - struct stat st; - if (-1 == stat(pathname, &st)) { + if (faccessat(AT_FDCWD, pathname, F_OK, 0) == -1) { sb_debug_dyn("EARLY FAIL: %s(%s): %s\n", func, pathname, strerror(errno)); return false; |