<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/libexec/flua, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-11-22T09:20:37Z</updated>
<entry>
<title>libexec/lua: Fix two typos in the manual pages</title>
<updated>2025-11-22T09:20:37Z</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2025-11-19T14:24:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=09e1d6fc41ab1e9c820e9d62dda416785bf1bb71'/>
<id>urn:sha1:09e1d6fc41ab1e9c820e9d62dda416785bf1bb71</id>
<content type='text'>
- s/environnement/environment/
- s/interger/integer/

(cherry picked from commit 58b86e40ce76de649db19d9d1f8571d5c942d44b)
</content>
</entry>
<entry>
<title>flua: add posix.unistd.execp</title>
<updated>2025-09-13T17:42:38Z</updated>
<author>
<name>Isaac Freund</name>
<email>ifreund@freebsdfoundation.org</email>
</author>
<published>2025-05-05T09:57:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e9e9c912c5c28d15fe485e5d8850da231b1bb371'/>
<id>urn:sha1:e9e9c912c5c28d15fe485e5d8850da231b1bb371</id>
<content type='text'>
This matches the interface of lposix, although I do wonder why they went
with execp rather than execvp for the function name here.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50177

(cherry picked from commit 7080a0c170daf8e4b3f331ec33003b2f8893dc23)
</content>
</entry>
<entry>
<title>jail: Add meta and env parameters</title>
<updated>2025-09-11T15:09:59Z</updated>
<author>
<name>Igor Ostapenko</name>
<email>igoro@FreeBSD.org</email>
</author>
<published>2025-03-31T09:08:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=527027da391d9ab75530927076f336330834dc11'/>
<id>urn:sha1:527027da391d9ab75530927076f336330834dc11</id>
<content type='text'>
Each one is an arbitrary string associated with a jail. It can be set
upon jail creation or added/modified later:

    &gt; jail -cm ... meta="tag1=value1 tag2=value2" env="configuration"

The values are not inherited from the parent jail.

A parent jail can read both metadata parameters, while a child jail can
read only env via security.jail.env sysctl.

The maximum size of meta or env per jail is controlled by the
global security.jail.meta_maxbufsize sysctl. Decreasing it does not
alter the existing meta information.

Each metadata buffer can be handled as a set of key=value\n strings:

    &gt; jail -cm ... meta="$(echo k1=v1; echo k2=v2)" env.1=one
    &gt; jls meta.k2 env.1 meta.k1

While meta.k1= resets the value to an empty string, the meta.k1 without
the equal sign removes the given key.

Relnotes:	yes
Reviewed by:	jamie
Tested by:	dch
Sponsored by:   SkunkWerks GmbH
Differential Revision:	https://reviews.freebsd.org/D47668

(cherry picked from commit 30e6e008bc06385a66756bebb41676f4f9017eca)
</content>
</entry>
<entry>
<title>flua: fbsd: allow stdout to be captured for exec() processes</title>
<updated>2025-09-11T15:09:59Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-07-09T05:12:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1522c8af3676da7fcccb3f4ba2b290a9c209623b'/>
<id>urn:sha1:1522c8af3676da7fcccb3f4ba2b290a9c209623b</id>
<content type='text'>
This allows us to do things like:

```
local fp = assert(fbsd.exec({"ls", "-l"}, true))
local fpout = assert(fp:stdout())

while true do
        local line = fpout:read("l")
        if not line then break end
        print("Read: " .. line)
end

fp:close()
```

The makeman lua rewrite will use it to capture `make showconfig` output
for processing.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D50539

(cherry picked from commit 3f0e1092097ed63b83a02518395e370c3cac01be)
</content>
</entry>
<entry>
<title>flua: fbsd: return a process handle to operate on when we exec()</title>
<updated>2025-09-11T15:09:59Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-07-09T05:12:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d9412b5fff915aa4d0c21d863a1a6d2e08bafbb0'/>
<id>urn:sha1:d9412b5fff915aa4d0c21d863a1a6d2e08bafbb0</id>
<content type='text'>
This gives us some way to be able to write to stdin if we want to, or
as a future improvement, will allow us to extract stdout from the
process.  The handle is setup to close and waitpid() on close/gc so that
existing users wouldn't necessarily leak for the lifetime of the script
if they weren't adopted to the new model.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D50538

(cherry picked from commit 6a2c624b35a0c760b00b9a34c10b7ea0c240c677)
</content>
</entry>
<entry>
<title>flua: fbsd: avoid leaking stdin pipes on error</title>
<updated>2025-09-11T15:09:59Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-07-09T05:12:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5e6d22fffb23b94273a13a8b58d822596451e8a8'/>
<id>urn:sha1:5e6d22fffb23b94273a13a8b58d822596451e8a8</id>
<content type='text'>
Additionally, there's no way to get to the end without a valid
stdin_pipe[1] at the moment, so don't check for it.  stdin_pipe[0] is
closed earlier, as the parent shouldn't need the read-side of the pipe.

While we're here, also free the file actions earlier and on error --
they're not necessary once posix_spawnp() has returned.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D50537

(cherry picked from commit 0610ba6cdbf2d8bed2619ae78ef2da5ee9c30b94)
</content>
</entry>
<entry>
<title>lposix: Clean up the posix namespace definitions</title>
<updated>2025-09-11T15:09:58Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-07-07T15:43:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f56402485dd54c7a2d88cb145864bba59b8d4532'/>
<id>urn:sha1:f56402485dd54c7a2d88cb145864bba59b8d4532</id>
<content type='text'>
The posix module is subdivided according to C headers; for instance,
posix.unistd contains routines available from unistd.h, such as
chown(2).

A quirk of our implementation is that each of the modules is a direct
entry in the global table.  That is, there is no "posix" table.
Instead, "posix.foo" and "posix.bar.baz" are both top-level tables.
This is surprising and goes against Lua's shorthand of using "." to
access keys in a table.  lua-posix also doesn't work this way.

Rework things so that "posix" and "posix.sys" are proper tables.
Existing flua code which uses require() to bind posix submodules to a
name will be unaffected.  Code which accesses them directly using
something like _G["posix.sys.utsname"].uname() will be broken, but I
don't think anything like that exists.  In particular, it is now
possible to call posix.sys.utsname.uname() without any require
statements.

Reviewed by:	imp, bapt
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51158

(cherry picked from commit eda96744b434325c475dce449744f2268f1033e8)
</content>
</entry>
<entry>
<title>flua: add posix.unistd.dup2()</title>
<updated>2025-09-11T15:09:58Z</updated>
<author>
<name>Isaac Freund</name>
<email>ifreund@freebsdfoundation.org</email>
</author>
<published>2025-05-05T09:03:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7f6da651e23f4fbafac04ad77f1bdf74deec5882'/>
<id>urn:sha1:7f6da651e23f4fbafac04ad77f1bdf74deec5882</id>
<content type='text'>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50176

(cherry picked from commit 909aa6781340f8c0b4ae01c6366bf1556ee2d1be)
</content>
</entry>
<entry>
<title>flua: add fbsd module</title>
<updated>2025-09-11T15:09:58Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2023-09-13T07:43:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c406a288e1e5083119d3b728c083b129a3ea104f'/>
<id>urn:sha1:c406a288e1e5083119d3b728c083b129a3ea104f</id>
<content type='text'>
This module is bundled into flua, it only provides for now the exec
function. The point of the function is to be able to execute a program
without actually executing a shell.

to use it:
fbsd.exec({"id", "bapt"})

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D41840

(cherry picked from commit 1f31e00e19f9e24d4c891a24973e08a027c4f71c)
</content>
</entry>
<entry>
<title>flua: clean up lposix argument checking</title>
<updated>2025-08-29T15:06:47Z</updated>
<author>
<name>Isaac Freund</name>
<email>ifreund@freebsdfoundation.org</email>
</author>
<published>2025-05-09T14:29:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b0e655bc5c646dd588aef5f92345213316259946'/>
<id>urn:sha1:b0e655bc5c646dd588aef5f92345213316259946</id>
<content type='text'>
The key insight here is that the luaL_check*() and luaL_opt*() functions
will happily take indexes that are larger than the stack top and print a
useful error message.

This means that there is no need to check if too few arguments have been
received prior to checking the types of individual arguments.

This patch also replaces a couple reimplementations of luaL_opt*()
functions with the luaL helpers.

References:	https://www.lua.org/manual/5.4/manual.html#4.1.2
Reviewed by:	emaste, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50273

(cherry picked from commit 5437b0ff6d557daf6c35e1307a5737139bc12f9a)
</content>
</entry>
</feed>
