1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-03-23 02:54:51 +00:00

Genrate random salts fort the root password

This commit is contained in:
Valentin Samir 2016-05-10 13:42:48 +02:00
parent 9db1b060a6
commit 748c167def

View file

@ -289,7 +289,7 @@ def instance(request, compute_id, vname):
if 'rootpasswd' in request.POST:
passwd = request.POST.get('passwd', '')
if passwd:
passwd_hash = crypt.crypt(passwd, '$6$kgPoiREy')
passwd_hash = crypt.crypt(passwd, '$6$%s' % ''.join([choice(letters + digits) for i in xrange(8)]))
# if password is empty, disable the root password
else:
passwd_hash = "*"