From e8da73cbb3075eefffb99d2e10002fd1931e8ebd Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 4 Aug 2018 05:10:01 -0400 Subject: sfrt_map_input(): use openat and the context's fdcwd. --- src/logic/sfrt_map_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/logic/sfrt_map_input.c b/src/logic/sfrt_map_input.c index d73ace6..aba0427 100644 --- a/src/logic/sfrt_map_input.c +++ b/src/logic/sfrt_map_input.c @@ -7,6 +7,7 @@ #include #include +#include "sofort_driver_impl.h" #include "sofort_errinfo_impl.h" int sfrt_map_input( @@ -16,12 +17,15 @@ int sfrt_map_input( int prot, struct sfrt_input * map) { + int ret; struct stat st; bool fnew; - int ret; + int fdcwd; + + fdcwd = sfrt_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 SFRT_SYSTEM_ERROR(dctx); -- cgit v1.2.3