summaryrefslogtreecommitdiff
path: root/libc/sysdeps/posix
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-03-18 18:01:40 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-03-18 18:01:40 +0000
commit57fa34b52e7c26f780c6bcae7a8ea863dfe710e1 (patch)
tree1fe2959ca795d67fb10559d0f300b06c2fd0b68c /libc/sysdeps/posix
parente97d73d87846a62aff09c388bd938c0b1d410931 (diff)
downloadeglibc2-57fa34b52e7c26f780c6bcae7a8ea863dfe710e1.tar.gz
Merge changes between r1382 and r1748 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@1749 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/posix')
-rw-r--r--libc/sysdeps/posix/euidaccess.c10
-rw-r--r--libc/sysdeps/posix/getaddrinfo.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/libc/sysdeps/posix/euidaccess.c b/libc/sysdeps/posix/euidaccess.c
index 76a09d455..333870cdd 100644
--- a/libc/sysdeps/posix/euidaccess.c
+++ b/libc/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
diff --git a/libc/sysdeps/posix/getaddrinfo.c b/libc/sysdeps/posix/getaddrinfo.c
index b4966852a..da48d46af 100644
--- a/libc/sysdeps/posix/getaddrinfo.c
+++ b/libc/sysdeps/posix/getaddrinfo.c
@@ -1157,7 +1157,7 @@ get_scope (const struct sockaddr_storage *ss)
169.254/16 and 127/8 are link-local. */
if ((addr[0] == 169 && addr[1] == 254) || addr[0] == 127)
scope = 2;
- else if (addr[0] == 10 || (addr[0] == 172 && addr[1] == 16)
+ else if (addr[0] == 10 || (addr[0] == 172 && (addr[1] & 0xf0) == 16)
|| (addr[0] == 192 && addr[1] == 168))
scope = 5;
else