mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Prevent the use of /dev/null for saving the content file. It's dangerous because it renames it!
This commit is contained in:
parent
14f34af1c7
commit
49cd2f3a7b
1 changed files with 4 additions and 0 deletions
4
state.c
4
state.c
|
|
@ -622,6 +622,10 @@ static void state_write_one(struct snapraid_state* state, const char* path, unsi
|
|||
|
||||
printf("Saving state to %s...\n", path);
|
||||
|
||||
/* ignore some special files */
|
||||
if (strcmp(path, "/dev/null") == 0 || strcmp(path, "NUL") == 0)
|
||||
return;
|
||||
|
||||
pathprint(tmp, sizeof(tmp), "%s.tmp", path);
|
||||
f = fopen(tmp, "wt");
|
||||
if (!f) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue