From 4f02be2a288345cf26aab420d456fadd247c7dae Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 31 Jul 2018 09:47:42 +0000 Subject: mdso_map_input(): use openat and the context's fdcwd. --- src/helper/mdso_map_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c index 090de12..ab4607f 100644 --- a/src/helper/mdso_map_input.c +++ b/src/helper/mdso_map_input.c @@ -13,6 +13,7 @@ #include #include +#include "mdso_driver_impl.h" #include "mdso_errinfo_impl.h" int mdso_map_input( @@ -22,12 +23,15 @@ int mdso_map_input( int prot, struct mdso_input * map) { + int ret; struct stat st; bool fnew; - int ret; + int fdcwd; + + fdcwd = mdso_driver_fdcwd(dctx); if ((fnew = (fd < 0))) - fd = open(path,O_RDONLY | O_CLOEXEC); + fd = openat(fdcwd,path,O_RDONLY | O_CLOEXEC); if (fd < 0) return MDSO_SYSTEM_ERROR(dctx); -- cgit v1.2.3