summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2008-12-16 15:52:32 +0100
committermaximilian attems <maks@debian.org>2008-12-16 15:52:32 +0100
commit54c28b9c9a7ed7b97db9161cd047735ae160d319 (patch)
tree8ebe37c2e632fc2c4d12c02f6c1fd383cffb555f /init
parentbda6f1ad11516683dc6cac2bc1196c590bd38806 (diff)
downloadinitramfs-tools-54c28b9c9a7ed7b97db9161cd047735ae160d319.tar.gz
initramfs-tools-54c28b9c9a7ed7b97db9161cd047735ae160d319.zip
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.
Diffstat (limited to 'init')
-rwxr-xr-xinit21
1 files changed, 17 insertions, 4 deletions
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