| #
436af571
|
| 08-Feb-2026 |
Jesús Daniel Colmenares Oviedo <dtxdf@FreeBSD.org> |
flua: Fix SIGSEGV in lua_chown when uid/gid doesn't exist
When lua_chown is used to call chown(2) internally, it first resolves the user and/or group by calling the getpwnam_r(3) and getgrnam_r(3) f
flua: Fix SIGSEGV in lua_chown when uid/gid doesn't exist
When lua_chown is used to call chown(2) internally, it first resolves the user and/or group by calling the getpwnam_r(3) and getgrnam_r(3) functions, respectively. However, although it checks for errors, it does not check when entries are not found (which is not an error), which means that the buffer will be set to NULL, and since lua_chown attempts to access the NULL structure, it will receive a SIGSEGV signal.
Reviewed by: imp@ Approved by: imp@ Differential Revision: https://reviews.freebsd.org/D55172
show more ...
|
| #
b41b6fdb
|
| 28-Jan-2026 |
Kyle Evans <kevans@FreeBSD.org> |
flua: lposix: fix WARNS=6 issues
lposix is the last holdout of modules built into flua until we can fix the module design to have the right parts require()able. Address a valid bug in lua_read() fo
flua: lposix: fix WARNS=6 issues
lposix is the last holdout of modules built into flua until we can fix the module design to have the right parts require()able. Address a valid bug in lua_read() found at a higher WARNS and drop the override entirely. Some of the modules could possibly be re-evaluated.
Fixes: c2caf3b3313 ("flua: lposix: add more useful functions [...]") Reported by: des Reviewed by: des Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc.
show more ...
|
| #
d505ef08
|
| 04-Oct-2025 |
Kyle Evans <kevans@FreeBSD.org> |
flua: unbreak the build
Local tree pollution let this escape. *sigh*.
Pointy hat: kevans Pointy hat: kevans Pointy hat: kevans Fixes: 9c7db0931d486ce ("flua: move lposix back into flua for now")
|
| #
b11a5709
|
| 04-Oct-2025 |
Kyle Evans <kevans@FreeBSD.org> |
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in and discovering them via linker sets. This is slightly cleaner than always build
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in and discovering them via linker sets. This is slightly cleaner than always building them in and baking them into loadedlibs for both bootstrap and system flua.
Adjust the stand build now that these three libs have their own new homes.
Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D51891
show more ...
|
| #
d4c973fa
|
| 04-Oct-2025 |
Kyle Evans <kevans@FreeBSD.org> |
Revert "flua: kick out the remaining builtin modules"
This reverts commit 80ada959004c4386880e47b11618f8abfc2d80e1, because bootstrap flua is about to get backed out.
|
| #
80ada959
|
| 03-Oct-2025 |
Kyle Evans <kevans@FreeBSD.org> |
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in and discovering them via linker sets. This is slightly cleaner than always build
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in and discovering them via linker sets. This is slightly cleaner than always building them in and baking them into loadedlibs for both bootstrap and system flua.
Adjust the stand build now that these three libs have their own new homes.
Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D51891
show more ...
|
| #
eda96744
|
| 07-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
lposix: Clean up the posix namespace definitions
The posix module is subdivided according to C headers; for instance, posix.unistd contains routines available from unistd.h, such as chown(2).
A qui
lposix: Clean up the posix namespace definitions
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
show more ...
|
| #
88d94ead
|
| 04-Jul-2025 |
Mark Johnston <markj@FreeBSD.org> |
lposix: Use reentrant passwd and group lookup functions
The implementation of chown() in the posix module handles user and group names as well as numeric IDs. When resolving names, be sure to use r
lposix: Use reentrant passwd and group lookup functions
The implementation of chown() in the posix module handles user and group names as well as numeric IDs. When resolving names, be sure to use reentrant lookup functions rather than assuming it's safe to clobber the internal buffers used by getpwnam() and getgrnam().
Fix some style nits while here.
Reviewed by: imp, bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46555
show more ...
|
| #
7080a0c1
|
| 05-May-2025 |
Isaac Freund <ifreund@freebsdfoundation.org> |
flua: add posix.unistd.execp
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
flua: add posix.unistd.execp
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
show more ...
|
| #
909aa678
|
| 05-May-2025 |
Isaac Freund <ifreund@freebsdfoundation.org> |
flua: add posix.unistd.dup2()
Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50176
|
| #
5437b0ff
|
| 09-May-2025 |
Isaac Freund <ifreund@freebsdfoundation.org> |
flua: clean up lposix argument checking
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
flua: clean up lposix argument checking
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
show more ...
|
| #
f35ccf46
|
| 28-Oct-2024 |
Stefan Eßer <se@FreeBSD.org> |
flua: lposix: add fnmatch function
The fnmatch function matches a string against a shell-style filename pattern. It is a complex function and cannot easily be implenented using regular expressions.
flua: lposix: add fnmatch function
The fnmatch function matches a string against a shell-style filename pattern. It is a complex function and cannot easily be implenented using regular expressions. Adding fnmatch to flua increases the amd64 binary by less than 1 KB.
Approved by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46849
show more ...
|
| #
aad50785
|
| 30-Sep-2024 |
Kyle Evans <kevans@FreeBSD.org> |
Fix the cross-build after recent commits
- Provide a sys/md4.h in the cross-build environment to fix bootstrap of libmd. - flua now exposes WTRAPPED which isn't incredibly common- make it co
Fix the cross-build after recent commits
- Provide a sys/md4.h in the cross-build environment to fix bootstrap of libmd. - flua now exposes WTRAPPED which isn't incredibly common- make it conditional, we probably won't be using it in any bootstrap context any time soon.
Fixes: 442e0975ee4b3 ("Consolidate md4 implementations written in C") Fixes: c2caf3b3313fe ("flua: posix: add more useful functions [...]")
show more ...
|
| #
c2caf3b3
|
| 11-Mar-2023 |
Kyle Evans <kevans@FreeBSD.org> |
flua: lposix: add more useful functions for general purpose scripts
unistd: - _exit - close - fork - getpid - pipe - read - write
libgen: - basename, dirname
stdlib: - realpath
These are sufficie
flua: lposix: add more useful functions for general purpose scripts
unistd: - _exit - close - fork - getpid - pipe - read - write
libgen: - basename, dirname
stdlib: - realpath
These are sufficient for a number of real world scenarios. In our first application of them, we use the libgen+stdlib additions to grab the script dir based on argv[0]. The unistd assortment is then used to outsource a bunch of work to forks and report back to the main process.
Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D39083
show more ...
|
| #
1726db7a
|
| 05-Sep-2024 |
Mark Johnston <markj@FreeBSD.org> |
flua: Add wrappers for sys/utsname.h
This allows one to invoke uname from lua scripts.
Reviewed by: bapt, kevans, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42017
|
| #
1d386b48
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
280f11f1
|
| 25-Nov-2022 |
Baptiste Daroussin <bapt@FreeBSD.org> |
flua: chown(2) binding, fix bad copy/paste
|
| #
a1ab15ab
|
| 24-Nov-2022 |
Baptiste Daroussin <bapt@FreeBSD.org> |
flua: add a chown(2) binding
The main difference with the chown in luaposix, is that it checks and reports if a user or a group do exist when a string is passed as arguments
Reviewed by: kevans Dif
flua: add a chown(2) binding
The main difference with the chown in luaposix, is that it checks and reports if a user or a group do exist when a string is passed as arguments
Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D37479
show more ...
|
| #
405e3338
|
| 13-Mar-2020 |
Ed Maste <emaste@FreeBSD.org> |
flua: implement chmod
Lua does not provide a native way to change the permission of a file.
Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differ
flua: implement chmod
Lua does not provide a native way to change the permission of a file.
Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24036
show more ...
|
| #
506f3640
|
| 18-Nov-2019 |
Kyle Evans <kevans@FreeBSD.org> |
Add flua to the base system, install to /usr/libexec
FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever extensions we need for base system operations. We currently support a subset
Add flua to the base system, install to /usr/libexec
FreeBSDlua ("flua") is a FreeBSD-private lua, flavored with whatever extensions we need for base system operations. We currently support a subset of lfs and lposix that are used in the rewrite of makesyscall.sh into lua, added in r354786.
flua is intentionally written such that one can install standard lua and some set of lua modules from ports and achieve the same effect.
linit_flua is a copy of linit.c from contrib/lua with lfs and lposix added in. This is similar to what we do in stand/. linit.c has been renamed to make it clear that this has flua-specific bits.
luaconf has been slightly obfuscated to make extensions more difficult. Part of the problem is that flua is already hard enough to use as a bootstrap tool because it's not in PATH- attempting to do extension loading would require a special bootstrap version of flua with paths changed to protect the innocent.
src.lua.mk has been added to make it easy for in-tree stuff to find flua, whether it's bootstrap-flua or relying on PATH frobbing by Makefile.inc1.
Reviewed by: brooks, emaste (both earlier version), imp Differential Revision: https://reviews.freebsd.org/D21893
show more ...
|