access(), Mac OS X, superuser, and X_OK; see PR 8700
svn: r6323
This commit is contained in:
parent
58f6de8c6b
commit
bea1ee3cec
|
@ -5257,7 +5257,7 @@ static Scheme_Object *file_or_dir_permissions(int argc, Scheme_Object *argv[])
|
||||||
ok = access(filename, R_OK);
|
ok = access(filename, R_OK);
|
||||||
} while ((ok == -1) && (errno == EINTR));
|
} while ((ok == -1) && (errno == EINTR));
|
||||||
read = !ok;
|
read = !ok;
|
||||||
|
|
||||||
if (ok && (errno != EACCES))
|
if (ok && (errno != EACCES))
|
||||||
l = NULL;
|
l = NULL;
|
||||||
else {
|
else {
|
||||||
|
@ -5274,9 +5274,14 @@ static Scheme_Object *file_or_dir_permissions(int argc, Scheme_Object *argv[])
|
||||||
} while ((ok == -1) && (errno == EINTR));
|
} while ((ok == -1) && (errno == EINTR));
|
||||||
execute = !ok;
|
execute = !ok;
|
||||||
|
|
||||||
if (ok && (errno != EACCES))
|
/* Don't fail at the exec step if the user is the
|
||||||
|
superuser and errno is EPERM; under Mac OS X,
|
||||||
|
at least, such a failure simply means tha the
|
||||||
|
file is not executable. */
|
||||||
|
if (ok && (errno != EACCES)
|
||||||
|
&& (uid || gid || (errno != EPERM))) {
|
||||||
l = NULL;
|
l = NULL;
|
||||||
else {
|
} else {
|
||||||
if (read)
|
if (read)
|
||||||
l = scheme_make_pair(read_symbol, l);
|
l = scheme_make_pair(read_symbol, l);
|
||||||
if (write)
|
if (write)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user