Ignore:
Timestamp:
Feb 21, 2017, 3:01:22 PM (4 years ago)
Author:
mabarracus
Message:

Fixed blocking bug when installing without unattended option
Increased password generation
New mirror availability checking before showing netinstall options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • llx-netinstall/trunk/fuentes/install.llx-netinstall/usr/share/n4d/python-plugins/NetinstallManager.py

    r3632 r3686  
    99import os
    1010import subprocess
     11import string
     12import random
     13import crypt
     14
    1115class NetinstallManager:
    1216
     
    214218                Writing in presseed username and password
    215219                '''                             
    216                 if not username or not password or not rootpassword:
     220                if status == True and (not username or not password or not rootpassword):
    217221                    return {"status":"false", "msg": "Usernames or Passwords can't be an empty string"}
    218222                try:
     
    226230                        preseed=open(filepath,'w')
    227231                        preseed.write("# LMD Created user account\n")
    228                         salt="sw9.tfRI"                 
    229                         userpassencrypted=crypt.crypt(str(password),"$1$"+salt+"$")
    230                         rootpassencrypted=crypt.crypt(str(rootpassword),"$1$"+salt+"$")
     232                        salt=''.join([random.choice(string.ascii_letters + string.digits) for _ in range(16)])
     233                        userpassencrypted=crypt.crypt(str(password),"$6$"+salt+"$")
     234                        salt=''.join([random.choice(string.ascii_letters + string.digits) for _ in range(16)])
     235                        rootpassencrypted=crypt.crypt(str(rootpassword),"$6$"+salt+"$")
    231236                       
    232237                        if(status==True):
Note: See TracChangeset for help on using the changeset viewer.