Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 303411
Collapse All | Expand All

(-)lib/sh/eaccess.c.orig (-1 / +9 lines)
Lines 198-208 Link Here
198
     char *path;
198
     char *path;
199
     int mode;
199
     int mode;
200
{
200
{
201
  struct stat s;
202
  int ret;
203
201
  if (path_is_devfd (path))
204
  if (path_is_devfd (path))
202
    return (sh_stataccess (path, mode));
205
    return (sh_stataccess (path, mode));
203
206
204
#if defined (HAVE_EACCESS)		/* FreeBSD */
207
#if defined (HAVE_EACCESS)		/* FreeBSD */
205
  return (eaccess (path, mode));
208
  if (stat (path, &s) != 0)
209
    return (-1);
210
  ret = eaccess (path, mode);
211
  if (mode == X_OK && ret == 0 && !S_ISDIR(s.st_mode) && geteuid() == 0)
212
    return ((s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0 ? -1 : 0);
213
  return (ret);
206
#elif defined (EFF_ONLY_OK)		/* SVR4(?), SVR4.2 */
214
#elif defined (EFF_ONLY_OK)		/* SVR4(?), SVR4.2 */
207
  return access (path, mode|EFF_ONLY_OK);
215
  return access (path, mode|EFF_ONLY_OK);
208
#else
216
#else

Return to bug 303411