fix: complete issues #201-#206 remediation #208

Merged
TapTap merged 17 commits from feat/triage-complete into dev 2026-08-11 21:06:49 +02:00
3 changed files with 3 additions and 4 deletions
Showing only changes of commit 44c2a8bb79 - Show all commits
+1 -2
View File
@@ -170,7 +170,7 @@ bool file_save_to_disk(const char* root_directory, File* file, const Config* con
(backup_enabled &&
(!backup_suffix || backup_suffix[0] == '\0' || strchr(backup_suffix, '/') != NULL ||
strcmp(backup_suffix, ".") == 0 || strcmp(backup_suffix, "..") == 0))) {
log_message(LOG_LEVEL_ERROR, "Path traversal detected in file path: %s", file->path);
log_message(LOG_LEVEL_ERROR, "Invalid file or path received");
return false;
}
@@ -545,7 +545,6 @@ File* receive_incremental_check(int fd, const Config* config, bool* skipped) {
}
if (old_fd >= 0) {
close(old_fd);
old_fd = -1;
}
bool match = has_old_file && (unsigned long long)st.st_size == check_size;
+1 -1
View File
@@ -188,7 +188,7 @@ void file_restore_metadata(const char* path, FileMetadata* metadata) {
log_message(LOG_LEVEL_WARNING, "Failed to set timestamps on %s: %s", path, strerror(errno));
}
bool file_restore_metadata_fd(int fd, FileMetadata* metadata) {
bool file_restore_metadata_fd(int fd, const FileMetadata* metadata) {
if (fd < 0 || metadata == NULL)
return metadata == NULL;
bool ok = true;
+1 -1
View File
@@ -30,6 +30,6 @@ FileMetadata* metadata_from_buf(char** buf);
bool metadata_send(int file_descriptor, FileMetadata* m);
FileMetadata* metadata_receive(int file_descriptor, int* ok);
void file_restore_metadata(const char* path, FileMetadata* metadata);
bool file_restore_metadata_fd(int fd, FileMetadata* metadata);
bool file_restore_metadata_fd(int fd, const FileMetadata* metadata);
#endif