commit d46918946ff5f58d165b6244e753dd9b36017432
parent d0b4508798839a20e45abe8e17ba70e3450d520e
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Fri, 14 May 2021 02:11:59 +0530
Avoid faccessat(..., AT_SYM_NOFOLLOW) with musl libc
See https://www.openwall.com/lists/musl/2014/09/25/1
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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]))) {