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

Michael Schroeder notifications at github.com
Wed Oct 7 08:55:11 UTC 2020


@mlschroe 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);

argvp can not be NULL so you might want to drop the test. (The rest of the code already assumes that it is not NULL.)

-- 
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#pullrequestreview-503662862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201007/c6991bc2/attachment.html>


More information about the Rpm-maint mailing list