[OpenWrt-Devel] UCI config bug or intent?
dominik.taborsky at nic.cz
Fri Apr 3 02:26:39 EDT 2015
Any thoughts on this?
If anything, could anyone point me the right direction so I can fix it myself?
On 03/25/2015 11:28 AM, Dominik Taborsky wrote:
> a colleague of mine discovered a problem when using UCI: when there's a clash of identifiers, they mix together regardless of their type and the last type is set as the type of the identifier. Let me show an example:
> root at turris:/etc/config# cat conflicting_config
> config typeA 'sec1'
> list device 'dev1'
> list ignore 'dev2'
> config typeA 'sec2'
> list device 'dev2'
> list ignore 'dev3'
> config typeB 'sec1'
> list activate 'dev3'
> list activate 'dev4'
> option socket 'false'
> root at turris:/etc/config# uci show conflicting_config
> conflicting_config.sec1.activate=dev3 dev4
> root at turris:/etc/config# uci show conflicting_config. at typeA
> As you can see, UCI shows only one section named 'sec1' of typeB, while there are two sections of that name of different types. It mixes the options and lists together and does not report any problem with this. I would expect either to report a problem or consider these as different objects with the same name. A workaround for this is to use anonymous sections with an option with the name as the value, but I still think there at least should be a warning. I don't know how to report such a problem from within the UCI library though.
> So what do you think?
> Best regards,
> Dominik Taborsky
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
More information about the openwrt-devel