]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
lualoader: Accept that people use unquoted values in loader.conf
authorKyle Evans <kevans@FreeBSD.org>
Thu, 23 Aug 2018 17:27:02 +0000 (17:27 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Thu, 23 Aug 2018 17:27:02 +0000 (17:27 +0000)
commit1ee89ab5dd81a434c01c6714908a6ad3cda0628c
tree8ee315cc97b08f1e587af3b648b7feabb5110345
parent7dbe228c6a1864f6c0b949307e2f09365dbfce9a
lualoader: Accept that people use unquoted values in loader.conf

While loader.conf(5) suggests that all values should be quoted, reality is
that this was never strictly enforced and it is used. We already make some
concession to this in number values, which aren't strictly quoted either.

The compromise here is that multi-word values must be quoted. This lets
things like `foo_load=YES` work, while denying more complex expressions on
the right hand side. This likely catches the vast majority of current usage.

A bit of a kludge is needed to accomplish this since Lua regex doesn't
support branching. I had considered splitting up expressions and generating
the right-hand side of the expressions completely in config.parse, but
deemed this too large of an overhaul to take given the current timing. This
should be re-worked shortly after the thaw.

Reported by: royger
stand/lua/config.lua