Changeset d71f644


Ignore:
Timestamp:
02/14/14 10:56:00 (6 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
296dc5b
Parents:
953cbc3d
Message:

Fix a bug in warden GUI, validate the hostname / IPs aren't in use before letting
the user continue to make a new jail

Location:
src-qt4/warden-gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/warden-gui/dialogwarden.cpp

    r58a4795 rd71f644  
    890890      // Build list of used jail IP / Hosts 
    891891      QTreeWidgetItemIterator it( listJails ); 
     892      int i = 0; 
    892893      while (*it) { 
    893          uI << (*it)->text(0); 
    894          uH << (*it)->text(2); 
     894         uH << (*it)->text(0); 
     895         uI << jailDetails.at(i).at(3); 
    895896         ++it; 
     897         i++; 
    896898      } 
    897899      newJailWizard->setHostIPUsed(uH, uI); 
  • src-qt4/warden-gui/wizardNewJail.cpp

    rc0618f2 rd71f644  
    135135 
    136136         // Check if this IP / Host is already used 
    137          for (int i = 0; i < usedHosts.size(); ++i) 
    138             if ( usedHosts.at(i) == lineHost->text() ) { 
     137         for (int i = 0; i < usedHosts.size(); ++i) { 
     138            if ( usedHosts.at(i).toLower() == lineHost->text().toLower() ) { 
    139139               button(QWizard::NextButton)->setEnabled(false); 
    140140               lineHost->setPalette(badPal); 
     
    142142               return false; 
    143143            } 
     144         } 
    144145         for (int i = 0; i < usedIP.size(); ++i) 
    145             if ( usedIP.at(i) == lineIP->text() ) { 
     146            if ( usedIP.at(i).contains(lineIP->text() + "/24") ) { 
    146147               button(QWizard::NextButton)->setEnabled(false); 
    147148               lineIP->setPalette(badPal); 
Note: See TracChangeset for help on using the changeset viewer.