diff --git a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr index 400c3fc4ad9c..babcee77bf31 100644 --- a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr +++ b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr @@ -239,9 +239,13 @@ f_dialog_input_group_password() if [ ! "$_password1" ]; then f_dialog_yesno "$msg_disable_password_auth_for_group" local retval=$? - [ $retval -eq 255 ] && return $retval # ESC was pressed - [ $retval -eq $SUCCESS ] && pw_group_password_disable=1 - continue # back to password prompt + if [ $retval -eq 255 ]; then # ESC was pressed + return $retval + elif [ $retval -eq $SUCCESS ]; then + pw_group_password_disable=1 + else + continue # back to password prompt + fi else pw_group_password_disable= fi diff --git a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr index f2795f81edc4..64a020dbb16d 100644 --- a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr +++ b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr @@ -336,9 +336,13 @@ f_dialog_input_password() if [ ! "$_password1" ]; then f_dialog_yesno "$msg_disable_password_auth_for_account" local retval=$? - [ $retval -eq 255 ] && return $retval # ESC was pressed - [ $retval -eq $SUCCESS ] && pw_password_disable=1 - continue # back to password prompt + if [ $retval -eq 255 ]; then # ESC was pressed + return $retval + elif [ $retval -eq $SUCCESS ]; then + pw_password_disable=1 + else + continue # back to password prompt + fi else pw_password_disable= fi