diff options
Diffstat (limited to 'lib/euidaccess.c')
-rw-r--r-- | lib/euidaccess.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/euidaccess.c b/lib/euidaccess.c index b352123ae18..a32e3366eb8 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -107,7 +107,10 @@ euidaccess (const char *file, int mode) safe. */ if (mode == F_OK) - return stat (file, &stats); + { + int result = stat (file, &stats); + return result != 0 && errno == EOVERFLOW ? 0 : result; + } else { int result; @@ -142,8 +145,8 @@ euidaccess (const char *file, int mode) /* If we are not set-uid or set-gid, access does the same. */ return access (file, mode); - if (stat (file, &stats) != 0) - return -1; + if (stat (file, &stats) == -1) + return mode == F_OK && errno == EOVERFLOW ? 0 : -1; /* The super-user can read and write any file, and execute any file that anyone can execute. */ |