1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +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 - Version 2.02.15 -
==================================== ====================================
Warn if certain duplicate config file entries are seen.
Enhance lvm_dump.sh for sysreport integration and add man page. Enhance lvm_dump.sh for sysreport integration and add man page.
Fix --autobackup argument which could never disable backups. Fix --autobackup argument which could never disable backups.
Fix a label_verify error path. 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 *path)
{ {
const char *e; const char *e;
const struct config_node *cn_found;
while (cn) { while (cn) {
/* trim any leading slashes */ /* 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++) ; for (e = path; *e && (*e != sep); e++) ;
/* hunt for the node */ /* hunt for the node */
cn_found = NULL;
while (cn) { while (cn) {
if (_tok_match(cn->key, path, e)) if (_tok_match(cn->key, path, e)) {
break; /* Inefficient */
if (!cn_found)
cn_found = cn;
else
log_error("WARNING: Ignoring duplicate"
" config node: %s ("
"seeking %s)", cn->key, path);
}
cn = cn->sib; cn = cn->sib;
} }
if (cn && *e) if (cn_found && *e)
cn = cn->child; cn = cn_found->child;
else else
break; /* don't move into the last node */ break; /* don't move into the last node */
path = e; 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, static struct config_node *_find_first_config_node(const struct config_node *cn1,