1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Warn if certain duplicate config file entries are seen.

(not thoroughly tested)
This commit is contained in:
Alasdair Kergon 2006-11-16 17:36:00 +00:00
parent 15545b91dc
commit 9f7e77099b
2 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.15 -
====================================
Warn if certain duplicate config file entries are seen.
Enhance lvm_dump.sh for sysreport integration and add man page.
Fix --autobackup argument which could never disable backups.
Fix a label_verify error path.

View File

@ -772,6 +772,7 @@ static struct config_node *_find_config_node(const struct config_node *cn,
const char *path)
{
const char *e;
const struct config_node *cn_found;
while (cn) {
/* trim any leading slashes */
@ -782,22 +783,30 @@ static struct config_node *_find_config_node(const struct config_node *cn,
for (e = path; *e && (*e != sep); e++) ;
/* hunt for the node */
cn_found = NULL;
while (cn) {
if (_tok_match(cn->key, path, e))
break;
if (_tok_match(cn->key, path, e)) {
/* Inefficient */
if (!cn_found)
cn_found = cn;
else
log_error("WARNING: Ignoring duplicate"
" config node: %s ("
"seeking %s)", cn->key, path);
}
cn = cn->sib;
}
if (cn && *e)
cn = cn->child;
if (cn_found && *e)
cn = cn_found->child;
else
break; /* don't move into the last node */
path = e;
}
return (struct config_node *) cn;
return (struct config_node *) cn_found;
}
static struct config_node *_find_first_config_node(const struct config_node *cn1,