mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-23 02:54:51 +00:00
An empty root password disable the root password
This commit is contained in:
parent
c25a35e1b1
commit
9db1b060a6
2 changed files with 6 additions and 1 deletions
|
|
@ -257,6 +257,7 @@
|
|||
<button class="btn btn-lg btn-success pull-right disabled">{% trans "Reset Root Password" %}</button>
|
||||
{% endifequal %}
|
||||
</form>
|
||||
<p>{% trans "An empty password disable the root password." %}</p>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="sshkeys">
|
||||
|
|
|
|||
|
|
@ -288,7 +288,11 @@ def instance(request, compute_id, vname):
|
|||
|
||||
if 'rootpasswd' in request.POST:
|
||||
passwd = request.POST.get('passwd', '')
|
||||
passwd_hash = crypt.crypt(passwd, '$6$kgPoiREy')
|
||||
if passwd:
|
||||
passwd_hash = crypt.crypt(passwd, '$6$kgPoiREy')
|
||||
# if password is empty, disable the root password
|
||||
else:
|
||||
passwd_hash = "*"
|
||||
data = {'action': 'password', 'passwd': passwd_hash, 'vname': vname}
|
||||
|
||||
if conn.get_status() == 5:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue