From 418537326e0e0df5ab5b2eec42ae5e340ada00b5 Mon Sep 17 00:00:00 2001 From: Heiko Baums Date: Mon, 6 Dec 2010 16:16:12 +0100 Subject: cryptsetup: abort if LUKS is found on swap partition Variable was not set before use, so the check for LUKS always failed. As noted, this could be dangerous. Signed-off-by: Tom Gundersen --- rc.sysinit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc.sysinit b/rc.sysinit index 53ce678..d9eddce 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -133,7 +133,10 @@ if [[ -f /etc/crypttab && $CS ]]; then local open=create a="$1" b="$2" failed=0 # Ordering of options is different if you are using LUKS vs. not. # Use ugly swizzling to deal with it. - if $CS isLuks "$2"; then + # isLuks only gives an exit code but no output to stdout or stderr. + $CS isLuks "$2" + _isluks=$? + if [[ $_isluks ]]; then open=luksOpen a="$2" b="$1" -- cgit v1.2.3