summaryrefslogtreecommitdiff
path: root/rpmio/rpmlua.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-11Finish lua 5.2 support, trac #865Johannes Dewender1-0/+8
Lua52 support was started with ac959fed0082cb253d45c7a04866e8654e962442. Compilation tested with Lua 5.2.1 and Lua 5.1.5. The short typerror() snippet is taken from luaL_typerror in Lua 5.1.5 (MIT license) Signed-off-by: Johannes Dewender <rpm@JonnyJD.net> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2014-06-11lua: fall through failed lua scriptsMarkus Lehtonen1-1/+1
Just print a warning. In addition, set Lua output buffer to contain string "1" for failed scripts. Change-Id: Id0478b64ac942fe6839f3cd8c9bb75c9b15382b2 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-06-11lua: Enable LuaMarkus Lehtonen1-7/+7
However, disable the "io" and "os" standard libraries and only enable the access() function from the "posix" extension library. Change-Id: If3b5f0776f6684af4ebaeb7bff742ab9a2123221 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-06-11Bump the log level of "unexpanded script" msgMarkus Lehtonen1-1/+1
Change-Id: Iec8ff9da9c866fd47f3352964a5aac1bd6148310 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2014-06-11Prevent execution of arbitrary scriptsMarkus Lehtonen1-0/+6
Disables the execution of shell scripts or lua code when parsing the spec file. Replaces the script output with static text "UNEXPANDEDSHELLSCRIPT" or "UNEXPANDEDLUASCRIPT". Change-Id: I7d43785715c4b518040463ae70bddd46734e824e Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2012-10-09Add lua 5.2 support.Anders F Bjorklund1-7/+33
Add compatibility support for both lua-5.1 and lua-5.2, assuming that the LUA_COMPAT might have been disabled. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2012-03-14Unbreak lua's base64 encode/decode extensionsPanu Matilainen1-4/+4
- Commit 70f063cb773bedb7d336429d9bc8ed1d4e5d18f4 accidentally changed lua's base64 encode/decode interface too, ugh. Dangers of search-and-replace... Only the function name string exported to lua matters but renaming the internal functions back as well for naming consistency.
2011-11-09Make base64 encoding/decoding part of rpmio public APIPanu Matilainen1-7/+7
- Base64 is present in headers and all, it's only reasonable that our API users have access to this functionality without having to link to other libraries. Even if we didn't want to carry the implementation forever in our codebase, we should provide a wrapping for this (much like the other crypto stuff) for the reason stated above. - A bigger issue is that our dirty little (badly hidden) secret was using non-namespaced function names, clashing with at least beecrypt. And we couldn't have made these internal-only symbols even on platforms that support it, because they are used all over the place outside rpmio. So... rename the b64 functions to rpmLikeNamingStyle and make 'em public. No functional changes, just trivial renaming despite touching numerous places.
2011-05-24Add support for nested Lua macro expansion (RhBug:490740)Panu Matilainen1-20/+40
- Lift the printbuffer accounting out of rpmlua into a struct of its own (Funny thing, this looks a whole lot like the macro expansion buffer and Good Ole StringBuf Brothers ... Boys ... Mam. Unify them one of these days maybe) - Replace the simplistic on/off printbuffer with a stack of buffers, fixup the lone caller to use the new internal push/pop API.
2011-05-24Plug a memory leak on Lua rpm.expand()Panu Matilainen1-1/+3
2010-11-15Basic protection against Lua os.exit() and posix.exec() (ticket #167)Panu Matilainen1-0/+1
- Track posix.fork() and only allow exit() and exec() if the script has forked. There are other questionable items in posix extensions too but these are the worst offenders. - Using Lua registry for tracking forked status might be more Lua-way option but this'll do for now.
2010-09-21Return typed pointers from rpmluaFree() and rpmluavFree()Panu Matilainen1-2/+2
2009-06-26Fix rpm.unregister() Lua extensionPanu Matilainen1-1/+1
- hook data is userdata, not light userdata
2009-06-26Add base64 encode and decode extensions to the lua interfacePanu Matilainen1-0/+34
2009-01-15Make sure global state gets NULLed on freePanu Matilainen1-0/+1
- otherwise repeated read config -> free config like rpmbuild does will crash and burn - somewhat kludgy, figure a better way to do this
2009-01-14Add rpmluaGetGlobalState() to internal lua apiPanu Matilainen1-0/+6
- retrieve global state, init if needed - inspired by rpm5.org, details differ - use it for initialisation in rpmrc instead of abusing rpmluaGetPrintBuffer
2008-11-22Use rpmConfigDir() instead of hardwired value in Lua initializationPanu Matilainen1-3/+6
- userconfig is actually unused
2008-05-06Eliminate static buffer in lua findkey()Panu Matilainen1-2/+12
2008-04-17Use sizeof() instead of direct element count in rpmluaGetVar()Jindrich Novy1-1/+1
2008-04-16Convert to Lua 5.1 library loading stylePanu Matilainen1-15/+10
- luaL_openlibs() to pull in all standard libs - local extensions need to be registered by calling through Lua
2008-04-16Start phasing out internal copy of LuaPanu Matilainen1-0/+2
- don't build internal copy of Lua - move 3rd party extensions (posix and rexlib) to toplevel luaext/ directory, built by default (unless --without-lua specified) - auto*foo checks for external Lua - minimal tweaks to lposix.c and rpmlua.c to get them build with Lua 5.1
2008-03-07Stop insecurely covering up for lack of snprintf and vsnprintfPanu Matilainen1-8/+0
- we require C99 anyway - snprintf is used unconditionally all around the tree - if absolutely needed for portability, having insecure wrappers littered over the source is not the best way
2008-01-30Include spring-cleaningPanu Matilainen1-6/+6
- put some consistency into include ordering - everything (apart from bits missed ;) is now ordered like this 1. "system.h" 2. other system includes 3. rpm public headers 4. rpm private headers 5. "debug.h"
2007-12-08Switch to <rpm/foo.h> style for public headersPanu Matilainen1-4/+4
- adjust include paths accordingly
2007-11-23Expand private include file names to be relative to $(top_srcdir)Ralf Corsépius1-2/+2
2007-11-23Use #include <x.h> syntax to include public headers.Ralf Corsépius1-4/+4
2007-11-19Lose rpmerr.h for goodPanu Matilainen1-1/+1
2007-11-19Replace all RPMERR_* etc uses with corresponding RPMLOG_* levelsPanu Matilainen1-6/+6
2007-11-02- Fix segfault in %{lua:...}'s rpm_printPeter Jones1-3/+2
- Don't automatically print a newline in rpm_print
2007-10-28Include "rpmio.h" instead of <rpmio.h>.Ralf Corsépius1-1/+1
2007-10-28Include "rpmhook.h" instead of <rpmhook.h>.Ralf Corsépius1-1/+1
2007-10-28Include "rpmerr.h" instead of <rpmerr.h>.Ralf Corsépius1-1/+1
2007-10-28Include "rpmmacro.h" instead of <rpmmacro.h>.Ralf Corsépius1-1/+1
2007-10-28Include "rpmurl.h" instead of <rpmurl.h>.Ralf Corsépius1-1/+1
2007-10-09Replace all rpmError() uses with rpmlog()Panu Matilainen1-6/+6
2007-09-11Remove splint tags.Ralf Corsépius1-89/+23
2004-10-09Splint fiddles.jbj1-5/+8
CVS patchset: 7435 CVS date: 2004/10/09 17:29:22
2004-04-19Splint fiddles.jbj1-24/+33
CVS patchset: 7242 CVS date: 2004/04/19 12:12:12
2004-04-18Implemented Lua support for the hooking system.niemeyer1-0/+139
CVS patchset: 7239 CVS date: 2004/04/18 20:47:29
2004-03-26Splint fiddles.jbj1-0/+2
CVS patchset: 7195 CVS date: 2004/03/26 17:27:57
2004-03-26splint fiddles.jbj1-7/+12
CVS patchset: 7193 CVS date: 2004/03/26 15:42:45
2004-03-24- Now Lua interface is using a global state.niemeyer1-18/+66
- /usr/lib/rpm/init.lua is called during intialization. CVS patchset: 7188 CVS date: 2004/03/24 19:47:11
2004-03-23Removing unwanted "static" attribute in "luaL_reg *lib". Using itniemeyer1-1/+1
removes the prectability of initalization order in relation to lualibs. CVS patchset: 7187 CVS date: 2004/03/23 23:52:45
2004-03-23Spint fiddles.jbj1-22/+42
CVS patchset: 7184 CVS date: 2004/03/23 07:18:55
2004-03-23Splint fiddles.jbj1-54/+85
CVS patchset: 7183 CVS date: 2004/03/23 05:52:59
2004-03-19- New internal Lua support scheme, laying under rpmio.niemeyer1-0/+588
- New API abstracting access to Lua state (rpmlua is abstract to everyone but rpmlua.c). - New %{lua: ... } macro. Modified Files: lib/Makefile.am lib/psm.c lib/rpmts.c lua/local/linit.lch lua/local/linit.lua rpmio/Makefile.am rpmio/macro.c Added Files: rpmio/rpmlua.c rpmio/rpmlua.h Removed Files: lib/rpmlua.c lib/rpmlua.h CVS patchset: 7178 CVS date: 2004/03/19 20:08:20