Add build option to allow hardlink tools

This commit is contained in:
Andrea Mazzoleni 2026-05-30 17:30:21 +02:00
parent fdadb443ad
commit 68525d6fa5
3 changed files with 14 additions and 2 deletions

View file

@ -262,12 +262,14 @@ static int verify_executable(const char* exec_path, char* resolved_path)
return -1;
}
#if !HAVE_HARDLINK_TOOLS
/* verify the file has not been hardlinked multiple times */
if (st.st_nlink > 1) {
log_error(EINVAL, "File %s has multiple hard links", resolved_path);
close(fd);
return -1;
}
#endif
return fd;
}