mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05:00
Reject a content file with the same disk name in two 'M' records
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
2571cce6d5
commit
ffd9e2bbff
1 changed files with 16 additions and 0 deletions
|
|
@ -3682,6 +3682,22 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reject the same disk name twice. The maps keep the content file
|
||||||
|
* names until the end of the parsing, so this compares content names.
|
||||||
|
*/
|
||||||
|
for (tommy_node* j = tommy_list_head(&state->maplist); j != 0; j = j->next) {
|
||||||
|
struct snapraid_map* other = j->data;
|
||||||
|
|
||||||
|
if (pathcmp(other->name, buffer) == 0) {
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
decoding_error(path, f);
|
||||||
|
log_fatal(ECONTENT, "Internal inconsistency: Field 'M' duplicate disk name '%s' in the content file!\n", buffer);
|
||||||
|
os_abort();
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* find the disk */
|
/* find the disk */
|
||||||
disk = find_disk_by_name(state, buffer);
|
disk = find_disk_by_name(state, buffer);
|
||||||
if (!disk) {
|
if (!disk) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue