From 54c28b9c9a7ed7b97db9161cd047735ae160d319 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Tue, 16 Dec 2008 15:52:32 +0100 Subject: init: Don't leak initramfs-tools exported variables. no need to check if the string of the corresponding variable exists, just unset all of them, but 2 that we need to pass on for calling init. --- init | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'init') diff --git a/init b/init index 5b9dfb1..102eda2 100755 --- a/init +++ b/init @@ -204,10 +204,23 @@ if [ ! -x "${rootmnt}${init}" ]; then panic "No init found. Try passing init= bootarg." fi -# Confuses /etc/init.d/rc -if [ -n ${debug} ]; then - unset debug -fi +# don't leak too much of env - some init(8) don't clear it +# (keep init, rootmnt) +unset debug +unset MODPROBE_OPTIONS +unset DPKG_ARCH +unset ROOTFLAGS +unset ROOTFSTYPE +unset ROOTDELAY +unset ROOT +unset blacklist +unset break +unset noresume +unset panic +unset quiet +unset readonly +unset resume +unset resume_offset # Chain to real filesystem maybe_break init -- cgit v1.2.3