[Rpm-maint] [rpm-software-management/rpm] Add support for passing real local arguments to Lua scriptlets (#1383)

Panu Matilainen notifications at github.com
Wed Oct 7 08:57:56 UTC 2020


@pmatilai commented on this pull request.



>  
     /* Lua scripts can change our cwd and umask, save and restore */
     cwd = open(".", O_RDONLY);
     if (cwd != -1) {
 	mode_t oldmask = umask(0);
 	umask(oldmask);
 	pid_t pid = getpid();
+	/* Arrange arguments to appear as a local arg[n] table in the script */
+	char *s = rstrscat(NULL, argvp ? "arg = {...}\n" : "", script, NULL);

Oh, right. This snippet was originally in rpmluaRunScript() where it could've been NULL so it was necessary there but not here. Thanks for spotting.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1383#discussion_r500849332
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201007/006bf49f/attachment.html>


More information about the Rpm-maint mailing list