]> git.ipfire.org Git - thirdparty/dracut.git/commit
Fix ask_for_password bug breaking bash without plymouth 60/head
authorRusty Bird <rustybird@openmailbox.org>
Thu, 30 Apr 2015 03:25:14 +0000 (03:25 +0000)
committerRusty Bird <rustybird@openmailbox.org>
Thu, 30 Apr 2015 03:25:14 +0000 (03:25 +0000)
commit04ba4610455d53e6a578b65c833c2d11320e1d80
treeb621d8c8f24d101c7b5ba7ec9fa226bf50c63bb5
parent4851deca54795eedd68d851b31bedfccd4c2993c
Fix ask_for_password bug breaking bash without plymouth

If crypt-lib.sh is sourced from any #!/bin/sh script, a POSIX shell
quirk is in effect that causes variable assignments to "special
builtins" (such as "shift") to leak to their context. So the buggy
code works even despite the missing semicolons.

But if it is sourced by "bash acting under its own name", i.e. from
any #!/bin/bash script, the quirk is disabled, tty_cmd/tty_prompt are
undefined, and ask_for_password doesn't do anything if plymouth is not
present.
modules.d/90crypt/crypt-lib.sh