Commit e36c8e95 authored by Jondy Zhao's avatar Jondy Zhao

slapos-configure: fix --password doesn't work

parent d06e619c
...@@ -233,8 +233,7 @@ slapos_check_and_create_privileged_user() ...@@ -233,8 +233,7 @@ slapos_check_and_create_privileged_user()
local username="${1-slaproot}" local username="${1-slaproot}"
local admingroup local admingroup
local dos_var_empty local dos_var_empty
local _password local _password="$2"
local password_value="$2"
local passwd_has_expiry_flags local passwd_has_expiry_flags
local ret=0 local ret=0
local username_in_admingroup local username_in_admingroup
...@@ -255,9 +254,8 @@ slapos_check_and_create_privileged_user() ...@@ -255,9 +254,8 @@ slapos_check_and_create_privileged_user()
dos_var_empty=$(/usr/bin/cygpath -w ${LOCALSTATEDIR}/empty) dos_var_empty=$(/usr/bin/cygpath -w ${LOCALSTATEDIR}/empty)
while [ "${username_in_sam}" != "yes" ] while [ "${username_in_sam}" != "yes" ]
do do
if [ -z "${password_value}" ] if [ -z "${_password}" ]
then then
_password="${password_value}"
csih_inform "Please enter a password for new user ${username}. Please be sure" csih_inform "Please enter a password for new user ${username}. Please be sure"
csih_inform "that this password matches the password rules given on your system." csih_inform "that this password matches the password rules given on your system."
csih_inform "Entering no password will exit the configuration." csih_inform "Entering no password will exit the configuration."
...@@ -304,7 +302,7 @@ slapos_check_and_create_privileged_user() ...@@ -304,7 +302,7 @@ slapos_check_and_create_privileged_user()
else else
# ${username} already exists. Use it, and make no changes. # ${username} already exists. Use it, and make no changes.
# use passed-in value as first guess # use passed-in value as first guess
csih_PRIVILEGED_PASSWORD="${password_value}" csih_PRIVILEGED_PASSWORD="${_password}"
fi fi
# username did NOT previously exist, but has been successfully created. # username did NOT previously exist, but has been successfully created.
......
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