@ -247,7 +247,7 @@ void Smb4KScanner::scanNetwork()
// Look up the workgroups/domains and their master browsers.
// At the moment we have three methods:
// (1) Smb4KSettings::EnumBrowseList::LookupDomains: This method is
// the most reliable one. It uses nmblookup and will only tq find
// the most reliable one. It uses nmblookup and will only find
// *active* workgroup master browsers and thus active domains.
// (2) Smb4KSettings::EnumBrowseList::QueryCurrentMaster: This
// method will query the current master browser of the local
@ -546,7 +546,7 @@ void Smb4KScanner::searchForHost( const TQString &host )
command . append ( nmblookup_options ) ;
}
if ( host . tq contains( ' . ' , true ) ! = 3 )
if ( host . contains( ' . ' , true ) ! = 3 )
{
if ( ! wins . isEmpty ( ) )
{
@ -691,7 +691,7 @@ void Smb4KScanner::processWorkgroups()
continue ;
}
else if ( ( * it ) . tq contains( " <00> " ) ! = 0 & & ( * it ) . tq contains( " <GROUP> " ) = = 0 )
else if ( ( * it ) . contains( " <00> " ) ! = 0 & & ( * it ) . contains( " <GROUP> " ) = = 0 )
{
if ( workgroup . isEmpty ( ) & & master . isEmpty ( ) & & ! ip . isEmpty ( ) )
{
@ -700,11 +700,11 @@ void Smb4KScanner::processWorkgroups()
continue ;
}
else if ( ( * it ) . tq contains( " <00> " ) ! = 0 & & ( * it ) . tq contains( " <GROUP> " ) ! = 0 )
else if ( ( * it ) . contains( " <00> " ) ! = 0 & & ( * it ) . contains( " <GROUP> " ) ! = 0 )
{
if ( workgroup . isEmpty ( ) & & ! master . isEmpty ( ) & & ! ip . isEmpty ( ) )
{
workgroup = ( * it ) . left ( ( * it ) . tq find( " <00> " ) ) . stripWhiteSpace ( ) ;
workgroup = ( * it ) . left ( ( * it ) . find( " <00> " ) ) . stripWhiteSpace ( ) ;
m_workgroups_list - > append ( new Smb4KWorkgroupItem ( workgroup , master , ip ) ) ;
@ -800,9 +800,9 @@ void Smb4KScanner::processIPScan()
// Loop through the data:
for ( TQStringList : : ConstIterator i = it ; i ! = list . end ( ) ; + + i )
{
if ( ( * i ) . tq contains( " <00> " ) ! = 0 )
if ( ( * i ) . contains( " <00> " ) ! = 0 )
{
if ( ( * i ) . tq contains( " <GROUP> " ) ! = 0 )
if ( ( * i ) . contains( " <GROUP> " ) ! = 0 )
{
workgroup = ( * i ) . section ( " <00> " , 0 , 0 ) . stripWhiteSpace ( ) ;
}
@ -813,13 +813,13 @@ void Smb4KScanner::processIPScan()
continue ;
}
else if ( ( * i ) . tq contains( " __MSBROWSE__ " ) ! = 0 & & ( * i ) . tq contains( " <01> " ) ! = 0 )
else if ( ( * i ) . contains( " __MSBROWSE__ " ) ! = 0 & & ( * i ) . contains( " <01> " ) ! = 0 )
{
master = true ;
continue ;
}
else if ( ( * i ) . tq contains( " MAC Address " ) ! = 0 | | ( * i ) . stripWhiteSpace ( ) . isEmpty ( ) )
else if ( ( * i ) . contains( " MAC Address " ) ! = 0 | | ( * i ) . stripWhiteSpace ( ) . isEmpty ( ) )
{
it = i ;
@ -897,9 +897,9 @@ void Smb4KScanner::processWorkgroupMembers()
case Smb4KSettings : : EnumBrowseList : : QueryCurrentMaster :
case Smb4KSettings : : EnumBrowseList : : QueryCustomMaster :
{
if ( m_buffer . tq contains( " NT_STATUS_ACCESS_DENIED " ) ! = 0 | |
m_buffer . tq contains( " NT_STATUS_LOGON_FAILURE " ) ! = 0 | |
m_buffer . tq contains( " The username or password was not correct " ) ! = 0 )
if ( m_buffer . contains( " NT_STATUS_ACCESS_DENIED " ) ! = 0 | |
m_buffer . contains( " NT_STATUS_LOGON_FAILURE " ) ! = 0 | |
m_buffer . contains( " The username or password was not correct " ) ! = 0 )
{
// Authentication failed:
emit failed ( ) ;
@ -913,11 +913,11 @@ void Smb4KScanner::processWorkgroupMembers()
return ;
}
else if ( m_buffer . tq contains( " Could not connect to server " ) ! = 0 | |
m_buffer . tq contains( " Unable to find a suitable server " ) ! = 0 | |
m_buffer . tq contains( " Invalid ip address specified " ) ! = 0 )
else if ( m_buffer . contains( " Could not connect to server " ) ! = 0 | |
m_buffer . contains( " Unable to find a suitable server " ) ! = 0 | |
m_buffer . contains( " Invalid ip address specified " ) ! = 0 )
{
// If the IP address is empty, the shell output tq contains
// If the IP address is empty, the shell output contains
// the IP address. Remove it, because it will confuse
// the user:
if ( m_priv - > ip ( ) . isEmpty ( ) )
@ -974,7 +974,7 @@ void Smb4KScanner::processWorkgroupMembers()
{
TQString host , comment ;
if ( line . tq contains( " " ) = = 0 )
if ( line . contains( " " ) = = 0 )
{
host = line ;
}
@ -1079,9 +1079,9 @@ void Smb4KScanner::processWorkgroupMembers()
}
case Smb4KSettings : : EnumBrowseList : : ScanBroadcastAreas :
{
if ( m_buffer . tq contains( " NT_STATUS_ACCESS_DENIED " ) ! = 0 | |
m_buffer . tq contains( " NT_STATUS_LOGON_FAILURE " ) ! = 0 | |
m_buffer . tq contains( " The username or password was not correct " ) ! = 0 )
if ( m_buffer . contains( " NT_STATUS_ACCESS_DENIED " ) ! = 0 | |
m_buffer . contains( " NT_STATUS_LOGON_FAILURE " ) ! = 0 | |
m_buffer . contains( " The username or password was not correct " ) ! = 0 )
{
// Authentication failed:
emit failed ( ) ;
@ -1095,9 +1095,9 @@ void Smb4KScanner::processWorkgroupMembers()
return ;
}
else if ( m_buffer . tq contains( " Could not connect to server " ) ! = 0 | |
m_buffer . tq contains( " Unable to find a suitable server " ) ! = 0 | |
m_buffer . tq contains( " Invalid ip address specified " ) ! = 0 )
else if ( m_buffer . contains( " Could not connect to server " ) ! = 0 | |
m_buffer . contains( " Unable to find a suitable server " ) ! = 0 | |
m_buffer . contains( " Invalid ip address specified " ) ! = 0 )
{
// We are in IP scan mode, so we can ignore the error and emit
// what we already have:
@ -1128,7 +1128,7 @@ void Smb4KScanner::processWorkgroupMembers()
// Extract host name and comment:
TQString host , comment ;
if ( line . tq contains( " " ) = = 0 )
if ( line . contains( " " ) = = 0 )
{
host = line ;
}
@ -1179,8 +1179,8 @@ void Smb4KScanner::processWorkgroupMembers()
void Smb4KScanner : : processShares ( )
{
// Error handling
if ( m_buffer . tq contains( " The username or password was not correct. " , true ) ! = 0 | |
m_buffer . tq contains( " NT_STATUS_ACCOUNT_DISABLED " ) ! = 0 /* Active Directory error */ )
if ( m_buffer . contains( " The username or password was not correct. " , true ) ! = 0 | |
m_buffer . contains( " NT_STATUS_ACCOUNT_DISABLED " ) ! = 0 /* Active Directory error */ )
{
// Authentication failed:
emit failed ( ) ;
@ -1192,7 +1192,7 @@ void Smb4KScanner::processShares()
return ;
}
else if ( m_buffer . tq contains( " could not obtain sid for domain " , true ) ! = 0 )
else if ( m_buffer . contains( " could not obtain sid for domain " , true ) ! = 0 )
{
// FIXME: Does this error only occur when we scan a server that is
// only capable of the RAP protocol or also under other conditions?
@ -1202,9 +1202,9 @@ void Smb4KScanner::processShares()
return ;
}
else if ( ( m_buffer . tq contains( " Could not connect to server " , true ) ! = 0 & &
m_buffer . tq contains( " The username or password was not correct. " , true ) = = 0 ) | |
m_buffer . tq contains( " Unable to find a suitable server " ) ! = 0 )
else if ( ( m_buffer . contains( " Could not connect to server " , true ) ! = 0 & &
m_buffer . contains( " The username or password was not correct. " , true ) = = 0 ) | |
m_buffer . contains( " Unable to find a suitable server " ) ! = 0 )
{
// We could not get the list of shares:
emit failed ( ) ;
@ -1232,19 +1232,19 @@ void Smb4KScanner::processShares()
{
TQString name , type , comment ;
if ( ( * it ) . tq contains( " Disk " , true ) ! = 0 )
if ( ( * it ) . contains( " Disk " , true ) ! = 0 )
{
name = ( * it ) . section ( " Disk " , 0 , 0 ) . stripWhiteSpace ( ) ;
type = " Disk " ;
comment = ( * it ) . section ( " Disk " , 1 , 1 ) . stripWhiteSpace ( ) ;
}
else if ( ( * it ) . tq contains( " Print " , true ) ! = 0 )
else if ( ( * it ) . contains( " Print " , true ) ! = 0 )
{
name = ( * it ) . section ( " Print " , 0 , 0 ) . stripWhiteSpace ( ) ;
type = " Printer " ;
comment = ( * it ) . section ( " Print " , 1 , 1 ) . stripWhiteSpace ( ) ;
}
else if ( ( * it ) . tq contains( " IPC " , true ) ! = 0 )
else if ( ( * it ) . contains( " IPC " , true ) ! = 0 )
{
name = ( * it ) . section ( " IPC " , 0 , 0 ) . stripWhiteSpace ( ) ;
type = " IPC " ;
@ -1278,8 +1278,8 @@ void Smb4KScanner::processSearch()
// Stop right here if the user searched for illegal
// strings like #, ', () etc.
if ( m_buffer . tq contains( " Usage: " , true ) ! = 0 | |
m_buffer . tq contains( " /bin/sh: " , true ) ! = 0 )
if ( m_buffer . contains( " Usage: " , true ) ! = 0 | |
m_buffer . contains( " /bin/sh: " , true ) ! = 0 )
{
emit searchResult ( new Smb4KHostItem ( ) ) ;
@ -1298,7 +1298,7 @@ void Smb4KScanner::processSearch()
TQString workgroup = data . last ( ) . stripWhiteSpace ( ) ;
TQString host , ip ;
if ( m_priv - > host ( ) . tq contains( " . " , true ) ! = 3 )
if ( m_priv - > host ( ) . contains( " . " , true ) ! = 3 )
{
// The IP address is in the first entry:
ip = data . first ( ) . stripWhiteSpace ( ) . section ( " " , 0 , 0 ) ;
@ -1324,7 +1324,7 @@ void Smb4KScanner::processSearch()
{
if ( data . count ( ) > 1 & & ! data [ 1 ] . isEmpty ( ) )
{
if ( m_buffer . tq contains( TQString ( " Connection to %1 failed " ) . tqarg ( m_priv - > host ( ) ) ) ! = 0 )
if ( m_buffer . contains( TQString ( " Connection to %1 failed " ) . tqarg ( m_priv - > host ( ) ) ) ! = 0 )
{
emit searchResult ( new Smb4KHostItem ( ) ) ;
}
@ -1377,7 +1377,7 @@ void Smb4KScanner::processInfo()
break ;
}
else if ( ( * it ) . tq contains( " Connection to " , true ) ! = 0 )
else if ( ( * it ) . contains( " Connection to " , true ) ! = 0 )
{
// The lookup of the info failed:
emit failed ( ) ;