summaryrefslogtreecommitdiff
path: root/lib/euidaccess.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-12-25 02:33:29 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-12-25 02:36:03 -0800
commit42d58264db165d265cba68d6dbebc53a50738355 (patch)
tree87543f2f0992a6b57a34dbd6ee04f48c3f6e7486 /lib/euidaccess.c
parent5880c7caab394eac55c44d4be42b2f45dbd9bc53 (diff)
downloademacs-42d58264db165d265cba68d6dbebc53a50738355.tar.gz
Update Gnulib.
All changes in this commit are autogenerated by running admin/merge-gnulib.
Diffstat (limited to 'lib/euidaccess.c')
-rw-r--r--lib/euidaccess.c9
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. */