summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaext/lposix.c4
-rw-r--r--rpmio/rpmlua.c14
2 files changed, 9 insertions, 9 deletions
diff --git a/luaext/lposix.c b/luaext/lposix.c
index f3c787eab..4d5269a4f 100644
--- a/luaext/lposix.c
+++ b/luaext/lposix.c
@@ -813,7 +813,7 @@ static int Pmkstemp(lua_State *L)
static const luaL_Reg R[] =
{
{"access", Paccess},
- {"chdir", Pchdir},
+/* {"chdir", Pchdir},
{"chmod", Pchmod},
{"chown", Pchown},
{"ctermid", Pctermid},
@@ -851,7 +851,7 @@ static const luaL_Reg R[] =
{"utime", Putime},
{"wait", Pwait},
{"setenv", Psetenv},
- {"unsetenv", Punsetenv},
+ {"unsetenv", Punsetenv},*/
{NULL, NULL}
};
diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c
index 49ae7a0aa..8e6841d4e 100644
--- a/rpmio/rpmlua.c
+++ b/rpmio/rpmlua.c
@@ -72,7 +72,7 @@ rpmlua rpmluaNew()
{"posix", luaopen_posix},
{"rex", luaopen_rex},
{"rpm", luaopen_rpm},
- {"os", luaopen_rpm_os},
+ /*{"os", luaopen_rpm_os},*/
{NULL, NULL},
};
@@ -86,6 +86,12 @@ rpmlua rpmluaNew()
lua_call(L, 1, 0);
lua_settop(L, 0);
}
+ /* Disable os and io standard libraries */
+ lua_pushnil (L);
+ lua_setglobal(L, "os");
+ lua_pushnil (L);
+ lua_setglobal(L, "io");
+
#ifndef LUA_GLOBALSINDEX
lua_pushglobaltable(L);
#endif
@@ -516,11 +522,6 @@ int rpmluaRunScript(rpmlua _lua, const char *script, const char *name)
INITSTATE(_lua, lua);
lua_State *L = lua->L;
int ret = 0;
-#define LUA_OUTPUT "UNEXPANDEDLUASCRIPT"
- rpmlog(RPMLOG_WARNING, _("Refusing to run lua code: %s\n"), script);
- lua->printbuf->buf = xcalloc(1, sizeof(LUA_OUTPUT));
- strcpy(lua->printbuf->buf, LUA_OUTPUT);
-#if 0
if (name == NULL)
name = "<lua>";
if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
@@ -534,7 +535,6 @@ int rpmluaRunScript(rpmlua _lua, const char *script, const char *name)
lua_pop(L, 1);
ret = -1;
}
-#endif
return ret;
}