Replies: 2 comments 1 reply
-
Does firejail have any use for a script language? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Rust: System language So Lua will have a different target and use case. Which use case to you think about? Sandbox setup has a heavy use of OS APIs so you need a system language. And turing complete profiles are a bad idea. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Note: This is kind of a continuation from
#4386 (comment))
For making (at least new) parts of firejail safer (and to make prototyping
easier), if using another language is really the way to go, then using a helper
language that was designed to be one would probably be helpful.
The most obvious candidate to me would be Lua, which was essentially
designed not only to be an extension language to C (and the reverse as
well), but also to be small and easy to embed in the main application.
These would be the main advantages:
Language:
from C
during development (though not sure about when using the FFI)
also Nelua for optional static typing)
Also, a Lua script can be executed from C code like any other program.
The one thing that I'm not really sure of is the default performance in
general. But I don't think that the performance would be affected by a lot for
doing things like a small Unix socket client/server or parsing profiles. If it
actually is a problem, it looks like it would be viable to compile Lua code
with luac, or to use LuaJIT.
Ecosystem:
is not particularly powerful or anything) to build Lua 5.4.4 with
make -j 4
(and less than 20 seconds with
make -j 1
)package as ~1250 KiB (and of the "luajit" package as ~820 KiB)
quite a few language-specific packages available:
Examples of programs using either Lua or LuaJIT:
Note: Most of the tools listed are based on the packages that have a hard
dependency on either the "lua" or "luajit" package on Arch Linux. This was
sourced from the output of
pacman -Sii extra/lua community/luajit
.Note2: I'm just listing the more known games and gaming-related programs off
the top of my head; there's too many to list.
Relates to #4386.
Beta Was this translation helpful? Give feedback.
All reactions