Changeset 4302cc4


Ignore:
Timestamp:
02/24/14 12:44:27 (10 months ago)
Author:
JoshDW19 <joshms@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
dcaaab6
Parents:
5db142b
Message:

Updated Warden to not accept invalid special characters (i.e !@#$) in hostnames.

File:
1 edited

Legend:

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

    rd71f644 r4302cc4  
    2626    connect(checkIPv4, SIGNAL(clicked()), this, SLOT(slotCheckChecks())); 
    2727    connect(checkIPv6, SIGNAL(clicked()), this, SLOT(slotCheckChecks())); 
    28     connect(lineHost, SIGNAL(textChanged ( const QString & )), this, SLOT(slotCheckComplete() ) ); 
     28    connect(lineHost, SIGNAL(editingFinished( const QString & )), this, SLOT(slotCheckComplete() ) ); 
    2929    connect(lineLinuxScript, SIGNAL(textChanged ( const QString & )), this, SLOT(slotCheckComplete() ) ); 
    3030    connect(pushLinuxScript, SIGNAL(clicked()), this, SLOT(slotSelectLinuxScript()) ); 
     
    115115  switch (currentId()) { 
    116116     case Page_IP: 
    117          // Make sure items are not empty 
     117         // Make sure items are not empty.  Also check for invalid characters 
    118118         if ( checkIPv4->isChecked() && lineIP->text().isEmpty() ) { 
    119119            button(QWizard::NextButton)->setEnabled(false); 
     
    133133            return false; 
    134134         } 
    135  
     135         if ( lineHost->text().contains("~") || lineHost->text().contains("`") || lineHost->text().contains("!") || lineHost->text().contains("@") || lineHost->text().contains("#") || lineHost->text().contains("$") || lineHost->text().contains("%") || lineHost->text().contains("^") || lineHost->text().contains("&") || lineHost->text().contains("*") || lineHost->text().contains("(") || lineHost->text().contains(")") || lineHost->text().contains("_") || lineHost->text().contains("+") || lineHost->text().contains("=") || lineHost->text().contains(";") || lineHost->text().contains(":") || lineHost->text().contains("'") || lineHost->text().contains("|") || lineHost->text().contains("?") || lineHost->text().contains("<") || lineHost->text().contains(">") || lineHost->text().contains(".") || lineHost->text().contains("?") || lineHost->text().contains(",") ) { 
     136            button(QWizard::NextButton)->setEnabled(false); 
     137            labelMessage->setText(tr("Hostname cannot contain special characters!")); 
     138            return false; 
     139         } 
    136140         // Check if this IP / Host is already used 
    137141         for (int i = 0; i < usedHosts.size(); ++i) { 
Note: See TracChangeset for help on using the changeset viewer.