Commit 2fa72595 authored by Michael Shigorin's avatar Michael Shigorin

deflogin: more explicit ROOTPW_EMPTY handling

This should avoid ruining principle of the least surprise with ROOTPW_EMPTY=0 or ROOTPW_EMPTY=n actually *enabling* empty root password; overriding an already set "1" with "0" becomes possible either.
parent 3c95cf8d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Если ROOTPW не задан, то подходящий пароль не существует. Если ROOTPW не задан, то подходящий пароль не существует.
При необходимости задать пустой пароль root (например, на LiveCD) При необходимости задать пустой пароль root (например, на LiveCD)
выставьте переменную ROOTPW_EMPTY. выставьте переменную ROOTPW_EMPTY в значение "1".
ВНИМАНИЕ: применяйте разумно, т.к. крайне легко создать и оставить ВНИМАНИЕ: применяйте разумно, т.к. крайне легко создать и оставить
дыру в безопасности! дыру в безопасности!
#!/bin/sh #!/bin/sh
# explicitly requested empty root password # explicitly requested empty root password
if [ -n "$GLOBAL_ROOTPW_EMPTY" ]; then case "$GLOBAL_ROOTPW_EMPTY" in
1|y|Y|yes)
usermod -p "" root usermod -p "" root
exit 0 exit 0
fi ;;
esac
# set root password if any; no-op if it is empty # set root password if any; no-op if it is empty
if [ -z "$GLOBAL_ROOTPW" ]; then if [ -z "$GLOBAL_ROOTPW" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment