Changeset 2681

Show
Ignore:
Timestamp:
09/02/08 12:34:50 (3 months ago)
Author:
kris
Message:

Fixed installer to accept any type of user / root passwords the user wants to install with

Location:
pcbsd/trunk/PCInstall
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/trunk/PCInstall/pcinstall.cpp

    r2680 r2681  
    500500    } 
    501501     
    502     //Check username password contains only letters and numbers 
    503     if ((! passwordRegExp.exactMatch(linePassword->text())) && (linePassword->text() != "")) { 
    504         textAcctNotify->setText(tr("Warning: Root password may normally only use letters and numbers!")); 
    505         linePassword->setPaletteBackgroundColor(colourRed); 
    506         ok = 1; 
    507     } 
    508502    if ((linePassword->text() != linePassword2->text()) || linePassword->text().isEmpty()) 
    509503    { 
     
    15121506         
    15131507         
    1514      
    1515      
     1508   // Save the root password 
     1509   QFile filePassRoot( "/mnt/tmp/setPass-Root" ); 
     1510    if ( filePassRoot.open( IO_WriteOnly ) ) { 
     1511        QTextStream streamPassRoot( &filePassRoot ); 
     1512        streamPassRoot << linePassword->text(); 
     1513        filePassRoot.close(); 
     1514    } 
     1515     
     1516   // Set our variables for the user passwords 
     1517   QFile filePassUser;  
     1518   QString fileNameUser, tmp; 
     1519 
    15161520   QFile file( "/mnt/tmp/setPass" ); 
    15171521    if ( file.open( IO_WriteOnly ) ) { 
    15181522        QTextStream stream( &file ); 
    1519         stream << "echo '" << linePassword->text().replace("\'","\\\'") << "' | pw usermod root -h 0\n" ; 
     1523        stream << "cat /tmp/setPass-Root | pw usermod root -h 0\n" ; 
     1524        stream << "rm /tmp/setPass-Root\n" ; 
    15201525        while ( i < 100) 
    15211526        { 
     
    15251530                break;    
    15261531            } 
     1532    
     1533            // Save the password text to file 
     1534            fileNameUser = "/mnt/tmp/setPass-User" + tmp.setNum(i); 
     1535            filePassUser.setFileName( fileNameUser ); 
     1536            if ( filePassUser.open( IO_WriteOnly ) ) { 
     1537                QTextStream streamPassUser( &filePassUser ); 
     1538                streamPassUser << AddPassword[i]; 
     1539                filePassUser.close(); 
     1540            } 
     1541     
    15271542                 
    1528             stream << "echo '" << AddPassword[i].replace("\'","\\\'") << "' | pw useradd -n " << AddUserName[i] << " -G wheel,operator -h 0 -s " + AddShell[i] + " -d /home/" << AddUserName[i] << " -m -c \"" << AddRealName[i] << "\"\n"; 
     1543            stream << "cat /tmp/setPass-User" + tmp.setNum(i) + " | pw useradd -n " << AddUserName[i] << " -G wheel,operator -h 0 -s " + AddShell[i] + " -d /home/" << AddUserName[i] << " -m -c \"" << AddRealName[i] << "\"\n"; 
     1544            stream << "rm /tmp/setPass-User" + tmp.setNum(i) + "\n"; 
    15291545         
    15301546            stream << "chown -R " << AddUserName[i] << " /home/" << AddUserName[i] << "\n"; 
     
    23132329     
    23142330     
    2315         //Check username contains only letters and numbers 
     2331    //Check username contains only letters and numbers 
    23162332    if ((! passwordRegExp.exactMatch(lineUserName->text())) && (lineUserName->text() != "")) { 
    23172333        textAcctNotify->setText(tr("Username may contain only letters and numbers!")); 
     
    23192335        ok = FALSE; 
    23202336    } 
    2321      
    2322     //Check password contains only letters and numbers 
    2323     if ((! passwordRegExp.exactMatch(lineUserPassword->text())) && (lineUserPassword->text() != "")) { 
    2324         textAcctNotify->setText(tr("User password may contain only letters and numbers!")); 
    2325         lineUserPassword->setPaletteBackgroundColor(colourRed); 
    2326         ok = FALSE; 
    2327     } 
    2328      
    2329  
    23302337     
    23312338     
  • pcbsd/trunk/PCInstall/pcinstall.ui

    r2656 r2681  
    2929  </property> 
    3030  <widget class="QWidget" name="WizardPage" > 
    31    <property name="geometry" > 
    32     <rect> 
    33      <x>6</x> 
    34      <y>34</y> 
    35      <width>988</width> 
    36      <height>651</height> 
    37     </rect> 
    38    </property> 
    3931   <attribute name="title" > 
    4032    <string>Select Language and Keyboard</string> 
     
    431423     </property> 
    432424     <property name="text" > 
    433       <string>Version 7-Alpha</string> 
     425      <string>Version 7</string> 
    434426     </property> 
    435427     <property name="alignment" > 
     
    55715563  </widget> 
    55725564  <widget class="QWidget" name="WizardPage" > 
     5565   <property name="geometry" > 
     5566    <rect> 
     5567     <x>0</x> 
     5568     <y>0</y> 
     5569     <width>100</width> 
     5570     <height>30</height> 
     5571    </rect> 
     5572   </property> 
    55735573   <attribute name="title" > 
    55745574    <string>Installing PC-BSD</string>