summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-01-04 00:33:41 +0000
committerkib <kib@FreeBSD.org>2015-01-04 00:33:41 +0000
commit63d6bc235ec42ac66a9a3e25c93f142112a011b4 (patch)
treea01f8b9c997276fd5693db5c0d8893b2cec1ff6c /libexec
parentb39e68e3a2b3c2e4ed65098966a5f51108e60842 (diff)
downloadFreeBSD-src-63d6bc235ec42ac66a9a3e25c93f142112a011b4.zip
FreeBSD-src-63d6bc235ec42ac66a9a3e25c93f142112a011b4.tar.gz
Do not erronously export 'openat' symbol from rtld.
The symbol leaked after r276630 since lib/libc/sys/openat.c defines versions for openat using .symver (version script cannot assign two versions to one symbol), and rtld uses openat. Instead, directly use __sys_openat(). Reported and tested by: antoine Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 1550da1..5f449c1 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -166,6 +166,8 @@ static bool matched_symbol(SymLook *, const Obj_Entry *, Sym_Match_Result *,
void r_debug_state(struct r_debug *, struct link_map *) __noinline;
void _r_debug_postinit(struct link_map *) __noinline;
+int __sys_openat(int, const char *, int, ...);
+
/*
* Data declarations.
*/
@@ -2824,7 +2826,7 @@ search_library_pathfds(const char *name, const char *path, int *fdp)
dirfd = parse_libdir(fdstr);
if (dirfd < 0)
break;
- fd = openat(dirfd, name, O_RDONLY | O_CLOEXEC);
+ fd = __sys_openat(dirfd, name, O_RDONLY | O_CLOEXEC);
if (fd >= 0) {
*fdp = fd;
len = strlen(fdstr) + strlen(name) + 3;
OpenPOWER on IntegriCloud