From 7ae5c14d2b4cc2dce023dac9bdf6020962c7bcec Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 13 Apr 2021 16:46:12 +0000 Subject: library: replace all uses of stat() and lstat() with fstatat() counterparts. --- src/logic/slbt_exec_uninstall.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/logic/slbt_exec_uninstall.c') diff --git a/src/logic/slbt_exec_uninstall.c b/src/logic/slbt_exec_uninstall.c index 28a73b2..9f2521c 100644 --- a/src/logic/slbt_exec_uninstall.c +++ b/src/logic/slbt_exec_uninstall.c @@ -68,13 +68,18 @@ static int slbt_exec_uninstall_fs_entry( uint32_t flags) { struct stat st; + int fdcwd; char * slash; char dpath[PATH_MAX]; + /* fdcwd */ + fdcwd = slbt_driver_fdcwd(dctx); + /* needed? */ - if (stat(path,&st) && (errno == ENOENT)) - if (lstat(path,&st) && (errno == ENOENT)) - return 0; + if (fstatat(fdcwd,path,&st,0) && (errno == ENOENT)) + if (fstatat(fdcwd,path,&st,AT_SYMLINK_NOFOLLOW)) + if (errno == ENOENT) + return 0; /* output */ *parg = path; -- cgit v1.2.3