about summary refs log tree commit diff stats
path: root/src/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liolib.c')
-rw-r--r--src/liolib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/liolib.c b/src/liolib.c
index 59ff179..6c03421 100644
--- a/src/liolib.c
+++ b/src/liolib.c
@@ -132,6 +132,10 @@ static char iolib_errbuf[1024] = {0};
 static int io_open (lua_State *L) {
   const char *filename = luaL_checkstring(L, 1);
   const char *mode = luaL_optstring(L, 2, "r");
+  static buffer[1024] = {0};
+  memset(buffer, '\0', 1024);
+  snprintf(buffer, 1020, "io.open(\"%s\", \"%s\")", filename, mode);
+  append_to_audit_log(L, buffer);
   FILE **pf = newfile(L);
   if (file_operation_permitted(filename, mode))
     *pf = fopen(filename, mode);