diff options
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1077,11 +1077,15 @@ eaccess(const char *path, int mode) struct stat st; rb_uid_t euid; + euid = geteuid(); + + /* no setuid nor setgid. run shortcut. */ + if (getuid() == euid && getgid() == getegid()) + return access(path, mode); + if (STAT(path, &st) < 0) return -1; - euid = geteuid(); - if (euid == 0) { /* Root can read or write any file. */ if (!(mode & X_OK)) |