Lines 676-682
save_file(char *path, int mode, char *buffer, int buff
Link Here
|
676 |
memcpy(temp_buffer, buffer, buffer_size); |
676 |
memcpy(temp_buffer, buffer, buffer_size); |
677 |
temp_buffer[buffer_size] = '\0'; |
677 |
temp_buffer[buffer_size] = '\0'; |
678 |
|
678 |
|
679 |
if (symlink(temp_buffer, path) == -1) |
679 |
if (symlink(temp_buffer, path) == -1 && |
|
|
680 |
(unlink(path), symlink(temp_buffer, path) == -1)) |
680 |
err(EXIT_FAILURE, |
681 |
err(EXIT_FAILURE, |
681 |
"save_file: symlink failure %s -> %s", |
682 |
"save_file: symlink failure %s -> %s", |
682 |
path, |
683 |
path, |
Lines 2800-2806
save_repairs(connector *session)
Link Here
|
2800 |
"save_repairs: cannot create %s", |
2801 |
"save_repairs: cannot create %s", |
2801 |
found_file->path); |
2802 |
found_file->path); |
2802 |
} else { |
2803 |
} else { |
2803 |
missing = !path_exists(found_file->path); |
2804 |
struct stat st; |
|
|
2805 |
|
2806 |
missing = stat(found_file->path, &st) != 0; |
2804 |
update = true; |
2807 |
update = true; |
2805 |
|
2808 |
|
2806 |
/* |
2809 |
/* |
Lines 2813-2819
save_repairs(connector *session)
Link Here
|
2813 |
|
2816 |
|
2814 |
check_hash = calculate_file_hash( |
2817 |
check_hash = calculate_file_hash( |
2815 |
found_file->path, |
2818 |
found_file->path, |
2816 |
found_file->mode); |
2819 |
st.st_mode); |
2817 |
|
2820 |
|
2818 |
buffer_hash = calculate_object_hash( |
2821 |
buffer_hash = calculate_object_hash( |
2819 |
found_object->buffer, |
2822 |
found_object->buffer, |