]> git.e2factory.org Git - e2factory.git/commitdiff
init: close everything but stdin, stdout and stderr
authorTobias Ulmer <tu@emlix.com>
Wed, 7 Oct 2015 18:51:12 +0000 (20:51 +0200)
committerTobias Ulmer <tu@emlix.com>
Fri, 9 Oct 2015 17:21:35 +0000 (19:21 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
Changelog
generic/e2lib.lua

index ffd8945cf18728a40f3f1f15be3a05544021ba95..a04461c32806e665bc2dc7210b61b0bd1ac2b9db 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
 NEXT:
+ * On startup, close all file descriptors except for stdin, stdout, and stderr
+   as a precautionary measure.
  * luafile.open() sets FD_CLOEXEC by default
  * Fix incorrect use of shquote(), preventing x86_64 chroot builds
  * Fix regression preventing use of x86_64 chroot
index fb340a97335ad01e2191b7fa4bf1f75c416682b0..78d01d9a9fb410b677efc4ee0fba3ecebb8f1d3b 100644 (file)
@@ -138,6 +138,9 @@ function e2lib.init()
         e2lib.abort(re)
     end
 
+    e2util.closefrom(3)
+    -- ignore errors, no /proc should not prevent factory from working
+
     e2lib.globals.warn_category = {
         WDEFAULT = false,
         WDEPRECATED = false,