mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-08 12:50:49 +02:00
Bash-4.1 distribution source
This commit is contained in:
@@ -93,7 +93,18 @@ file_status (name)
|
||||
|
||||
r = FS_EXISTS;
|
||||
|
||||
#if defined (AFS)
|
||||
#if defined (HAVE_EACCESS)
|
||||
/* Use eaccess(2) if we have it to take things like ACLs and other
|
||||
file access mechanisms into account. eaccess uses the effective
|
||||
user and group IDs, not the real ones. We could use sh_eaccess,
|
||||
but we don't want any special treatment for /dev/fd. */
|
||||
if (eaccess (name, X_OK) == 0)
|
||||
r |= FS_EXECABLE;
|
||||
if (eaccess (name, R_OK) == 0)
|
||||
r |= FS_READABLE;
|
||||
|
||||
return r;
|
||||
#elif defined (AFS)
|
||||
/* We have to use access(2) to determine access because AFS does not
|
||||
support Unix file system semantics. This may produce wrong
|
||||
answers for non-AFS files when ruid != euid. I hate AFS. */
|
||||
@@ -103,7 +114,7 @@ file_status (name)
|
||||
r |= FS_READABLE;
|
||||
|
||||
return r;
|
||||
#else /* !AFS */
|
||||
#else /* !HAVE_EACCESS && !AFS */
|
||||
|
||||
/* Find out if the file is actually executable. By definition, the
|
||||
only other criteria is that the file has an execute bit set that
|
||||
|
||||
Reference in New Issue
Block a user