aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/euidaccess.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-31 13:33:18 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-31 13:33:18 +0000
commit32c075e1f01849e161724bbd400ba77244e482cc (patch)
tree5f083a3f352104f32bb6c902d57fa3f294bd8d4d /sysdeps/posix/euidaccess.c
parentd6220e9ee38c1c9285221b023346201ec5f511b3 (diff)
downloadglibc-32c075e1f01849e161724bbd400ba77244e482cc.zip
glibc-32c075e1f01849e161724bbd400ba77244e482cc.tar.gz
glibc-32c075e1f01849e161724bbd400ba77244e482cc.tar.bz2
.
Diffstat (limited to 'sysdeps/posix/euidaccess.c')
-rw-r--r--sysdeps/posix/euidaccess.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c
index 76a09d4..333870c 100644
--- a/sysdeps/posix/euidaccess.c
+++ b/sysdeps/posix/euidaccess.c
@@ -1,5 +1,5 @@
/* Check if effective user id can access file
- Copyright (C) 1990,1991,1995-2001,2005 Free Software Foundation, Inc.
+ Copyright (C) 1990,1991,1995-2001,2005,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -128,10 +128,6 @@ euidaccess (path, mode)
#ifdef _LIBC
uid_t euid;
gid_t egid;
-
- if (! __libc_enable_secure)
- /* If we are not set-uid or set-gid, access does the same. */
- return __access (path, mode);
#else
if (have_ids == 0)
{
@@ -162,6 +158,10 @@ euidaccess (path, mode)
/* Now we need the IDs. */
euid = __geteuid ();
egid = __getegid ();
+
+ if (__getuid () == euid && __getgid () == egid)
+ /* If we are not set-uid or set-gid, access does the same. */
+ return __access (path, mode);
#endif
/* The super-user can read and write any file, and execute any file