From d385653e04a9455a5c9e34cc9a63c7de375981d7 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 15 Apr 2021 06:41:55 +0000 Subject: library: replace all uses of unlink() with unlinkat(). --- src/logic/slbt_exec_compile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/logic/slbt_exec_compile.c') diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c index 7a934ab..2a407da 100644 --- a/src/logic/slbt_exec_compile.c +++ b/src/logic/slbt_exec_compile.c @@ -21,10 +21,15 @@ static int slbt_exec_compile_remove_file( struct slbt_exec_ctx * ectx, const char * target) { + int fdcwd; + (void)ectx; + /* fdcwd */ + fdcwd = slbt_driver_fdcwd(dctx); + /* remove target (if any) */ - if (!(unlink(target)) || (errno == ENOENT)) + if (!unlinkat(fdcwd,target,0) || (errno == ENOENT)) return 0; return SLBT_SYSTEM_ERROR(dctx,0); -- cgit v1.2.3