Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
pkg
Commits
d10a68dc
Commit
d10a68dc
authored
Mar 28, 2021
by
Baptiste Daroussin
Browse files
lua triggers: provide the rootfd to the script
This enables the triggers to run scripts using most of the pkg.* functions
parent
aba9ce4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
libpkg/triggers.c
View file @
d10a68dc
...
...
@@ -409,6 +409,8 @@ trigger_execute_lua(const char *script, bool sandbox, kh_strings_t *args)
};
luaL_newlib
(
L
,
pkg_lib
);
lua_setglobal
(
L
,
"pkg"
);
lua_pushinteger
(
L
,
ctx
.
rootfd
);
lua_setglobal
(
L
,
"rootfd"
);
char
*
dir
;
char
**
arguments
=
NULL
;
int
i
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment