Subject: [alpine-user] YAML in Awall

From: "Williams, Gareth" <[email-masked]>
Date: Thu, 10 May 2018 09:20:10 +0100

Hi all,

Hopefully a very quick question - is YAML usable for awall rules in Alpine
3.7?  I've tried and get an error:

------------------------------->8---------------------------------------

/usr/local/share/lua/5.2/awall/policy.lua:128: module 'lyaml' not found:
no field package.preload['lyaml']
no file '/usr/local/share/lua/5.2/lyaml.lua'
no file '/usr/local/share/lua/5.2/lyaml/init.lua'
no file '/usr/share/lua/5.2/lyaml.lua'
no file '/usr/share/lua/5.2/lyaml/init.lua'
no file '/usr/local/lib/lua/5.2/lyaml.lua'
no file '/usr/local/lib/lua/5.2/lyaml/init.lua'
no file './lyaml.lua'
no file '/usr/lib/lua/5.2/lyaml.lua'
no file '/usr/lib/lua/5.2/lyaml/init.lua'
no file './lyaml.lua'
no file '/usr/local/lib/lua/5.2/lyaml.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file '/usr/lib/lua/5.2/lyaml.so'
no file '/usr/lib/lua/5.2/loadall.so'
no file './lyaml.so'
stack traceback:
/usr/local/share/lua/5.2/awall/uerror.lua:25: in function
</usr/local/share/lua/5.2/awall/uerror.lua:21>
[C]: in function 'require'
/usr/local/share/lua/5.2/awall/policy.lua:128: in function 'init'
/usr/local/share/lua/5.2/awall/class.lua:31: in function
</usr/local/share/lua/5.2/awall/class.lua:29>
(...tail calls...)
/usr/sbin/awall:163: in function 'f'
/usr/local/share/lua/5.2/awall/uerror.lua:20: in function
</usr/local/share/lua/5.2/awall/uerror.lua:20>
[C]: in function 'xpcall'
/usr/local/share/lua/5.2/awall/uerror.lua:19: in function 'call'
/usr/sbin/awall:156: in main chunk
[C]: in ?

---------------------------------------->8---------------------------------

I've installed the lua yaml packages.Searching the Alpine packages website
for lyaml.lua or */lyaml/* yields nothing useful.

Kind regards,

Gareth

---

From: "Williams, Gareth" <[email-masked]>
Date: Fri, 11 May 2018 08:26:44 +0100

Hi,

A little bit of self-help has worked I think.

It seems that line 116 of /usr/share/lua/5.2/awall/policy.lua has:

yaml = { mod="lyaml", func="load" },

After changing it to:

yaml = { mod="yaml", func="load" },

everything works as expected.  Whether that change has any
side-effects is beyond my understanding of Awall, but it seems to do
the trick.

I've raised bug 8874 for this - https://bugs.alpinelinux.org/issues/8874

Kind regards,

Gareth