mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-04 08:21:03 +00:00
Fix bug in default capability flag in rule parser.
This commit is contained in:
parent
fb00f0f94c
commit
2ee53b0e75
@ -838,7 +838,8 @@ function compile(src,rules,caps,tags)
|
|||||||
let id = -1;
|
let id = -1;
|
||||||
let dfl = false;
|
let dfl = false;
|
||||||
for(let k=1;k<cap.length;++k) {
|
for(let k=1;k<cap.length;++k) {
|
||||||
if (cap[k][0].toLowerCase() === 'id') {
|
let dn = (typeof cap[k][0] === 'string') ? cap[k][0].toLowerCase() : null;
|
||||||
|
if (dn === 'id') {
|
||||||
if (id >= 0)
|
if (id >= 0)
|
||||||
return [ cap[k][1],cap[k][2],'Duplicate id directive in capability definition.' ];
|
return [ cap[k][1],cap[k][2],'Duplicate id directive in capability definition.' ];
|
||||||
if ((k + 1) >= cap.length)
|
if ((k + 1) >= cap.length)
|
||||||
@ -850,7 +851,7 @@ function compile(src,rules,caps,tags)
|
|||||||
if (caps[cn].id === id)
|
if (caps[cn].id === id)
|
||||||
return [ cap[k - 1][1],cap[k - 1][2],'Duplicate capability ID.' ];
|
return [ cap[k - 1][1],cap[k - 1][2],'Duplicate capability ID.' ];
|
||||||
}
|
}
|
||||||
} else if (cap[k][0].toLowerCase() === 'default') {
|
} else if (dn === 'default') {
|
||||||
dfl = true;
|
dfl = true;
|
||||||
} else {
|
} else {
|
||||||
capRules.push(cap[k]);
|
capRules.push(cap[k]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user