From: Tobias Ulmer Date: Wed, 7 Oct 2015 18:51:12 +0000 (+0200) Subject: init: close everything but stdin, stdout and stderr X-Git-Tag: e2factory-2.3.14p1~5 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=aa3980ec83be167d3e3065ced02fef1b1db2320c;p=e2factory.git init: close everything but stdin, stdout and stderr Signed-off-by: Tobias Ulmer --- diff --git a/Changelog b/Changelog index ffd8945..a04461c 100644 --- 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 diff --git a/generic/e2lib.lua b/generic/e2lib.lua index fb340a9..78d01d9 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -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,