From d46918946ff5f58d165b6244e753dd9b36017432 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 14 May 2021 02:11:59 +0530 Subject: [PATCH] Avoid faccessat(..., AT_SYM_NOFOLLOW) with musl libc See https://www.openwall.com/lists/musl/2014/09/25/1 --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 6dd11066..bd4d3445 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -6932,7 +6932,7 @@ nochange: } /* Check if another file with same name exists */ - if (faccessat(fd, tmp, F_OK, AT_SYMLINK_NOFOLLOW) != -1) { + if (fstatat(fd, tmp, &sb, AT_SYMLINK_NOFOLLOW) == 0) { if (sel == SEL_RENAME) { /* Overwrite file with same name? */ if (!xconfirm(get_input(messages[MSG_OVERWRITE]))) {