Page MenuHomeFreeBSD

flua: Add a libjail module
ClosedPublic

Authored by freqlabs on Aug 16 2020, 4:31 AM.
Tags
None
Referenced Files
F103126834: D26080.id.diff
Thu, Nov 21, 8:51 AM
Unknown Object (File)
Thu, Nov 14, 12:39 PM
Unknown Object (File)
Thu, Nov 7, 1:36 PM
Unknown Object (File)
Thu, Nov 7, 1:36 PM
Unknown Object (File)
Wed, Nov 6, 2:15 PM
Unknown Object (File)
Wed, Oct 30, 2:21 AM
Unknown Object (File)
Mon, Oct 28, 11:12 AM
Unknown Object (File)
Fri, Oct 25, 10:13 AM

Details

Summary

libjail is pretty small, so it makes for a good proof of concept demonstrating how a system library can be wrapped to create a loadable Lua module for flua.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I plan to add documentation and Lua code examples. And I should add $FreeBSD$ and unshebangify lib/flua/libjail/Makefile

lib/Makefile
141 ↗(On Diff #75866)

Does this really work? This should be controlled with a MK_ variables...

lib/Makefile
141 ↗(On Diff #75866)

I took it from about 13 lines down where clang does something similar. The goal is to not build a lib32 compat version of the Lua modules. It does seem to be working.

  • Add an example for the jail module
  • Add a 3lua manpage section, with intro(3lua) and jail(3lua)
  • Add __FBSDID to the jail module
  • Unshebangify lib/flua/libjail/Makefile
freqlabs added reviewers: kevans, emaste.

Add 3lua section to contrib/mandoc/msec.in

I'd eventually like to be able to iterate over running jails, but this isn't necessary for a first pass.

lib/flua/libjail/jail.3lua
1 ↗(On Diff #77701)

Needs a SPDX tag

lib/flua/libjail/lua_jail.c
209 ↗(On Diff #77701)

You'll want to deconst this, as it needs to be free()d after it's pushed to the stack.

This revision is now accepted and ready to land.Oct 16 2020, 12:38 AM
lib/flua/libjail/lua_jail.c
236 ↗(On Diff #78257)

make analyze points out that this is a dead store, due to reassignment in the impending loop.

This revision was automatically updated to reflect the committed changes.