fix: use lstat instead of stat in receive_thread (symlink security)
CI / lint (pull_request) Successful in 1m4s
CI / sanitizers (address) (pull_request) Successful in 36s
CI / sanitizers (undefined) (pull_request) Successful in 36s
CI / fuzz-build (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s

This commit is contained in:
2026-07-30 18:10:29 +02:00
parent 8cc587b79e
commit 05dab758cf
+1 -1
View File
@@ -148,7 +148,7 @@ int receive_thread(void* pipeline_context) {
}
char* full_path = path_cat(config->receive_root_directory, check_path);
struct stat st;
bool has_old = full_path && stat(full_path, &st) == 0;
bool has_old = full_path && lstat(full_path, &st) == 0;
bool match = has_old && (unsigned long long)st.st_size == check_size &&
(long long)st.st_mtime == check_mtime;
if (match)