1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-03-23 11:04:49 +00:00

An empty root password disable the root password

This commit is contained in:
Valentin Samir 2016-05-10 13:42:11 +02:00
parent c25a35e1b1
commit 9db1b060a6
2 changed files with 6 additions and 1 deletions

View file

@ -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: