-rw-r--r-- | core/launcher/transferserver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index dea140d..aaa4425 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -201,65 +201,65 @@ bool SyncAuthentication::checkPassword( const QString& password ) | |||
201 | "<p>If you are using a version of Qtopia Desktop older than 1.5.1, " | 201 | "<p>If you are using a version of Qtopia Desktop older than 1.5.1, " |
202 | "please upgrade."), | 202 | "please upgrade."), |
203 | tr("Deny") ); | 203 | tr("Deny") ); |
204 | denials++; | 204 | denials++; |
205 | lastdenial=now; | 205 | lastdenial=now; |
206 | } | 206 | } |
207 | return FALSE; | 207 | return FALSE; |
208 | } | 208 | } |
209 | 209 | ||
210 | // Second, check sync password... | 210 | // Second, check sync password... |
211 | QString pass = password.left(6); | 211 | QString pass = password.left(6); |
212 | /* old QtopiaDesktops are sending | 212 | /* old QtopiaDesktops are sending |
213 | * rootme newer versions got a Qtopia | 213 | * rootme newer versions got a Qtopia |
214 | * prefixed. Qtopia prefix will suceed | 214 | * prefixed. Qtopia prefix will suceed |
215 | * until the sync software syncs up | 215 | * until the sync software syncs up |
216 | * FIXME | 216 | * FIXME |
217 | */ | 217 | */ |
218 | if ( pass == "rootme" || pass == "Qtopia") { | 218 | if ( pass == "rootme" || pass == "Qtopia") { |
219 | 219 | ||
220 | QString cpassword = QString::fromLocal8Bit( crypt( password.mid(8).local8Bit(), "qp" ) ); | 220 | QString cpassword = QString::fromLocal8Bit( crypt( password.mid(8).local8Bit(), "qp" ) ); |
221 | Config cfg("Security"); | 221 | Config cfg("Security"); |
222 | cfg.setGroup("Sync"); | 222 | cfg.setGroup("Sync"); |
223 | QString pwds = cfg.readEntry("Passwords"); | 223 | QString pwds = cfg.readEntry("Passwords"); |
224 | if ( QStringList::split(QChar(' '),pwds).contains(cpassword) ) | 224 | if ( QStringList::split(QChar(' '),pwds).contains(cpassword) ) |
225 | return TRUE; | 225 | return TRUE; |
226 | 226 | ||
227 | // Unrecognized system. Be careful... | 227 | // Unrecognized system. Be careful... |
228 | 228 | ||
229 | if ( (denials > 2 && now < lastdenial+600) | 229 | if ( (denials > 2 && now < lastdenial+600) |
230 | || QMessageBox::warning(0,tr("Sync Connection"), | 230 | || QMessageBox::warning(0,tr("Sync Connection"), |
231 | tr("<p>An unrecognized system is requesting access to this device." | 231 | tr("<p>An unrecognized system is requesting access to this device." |
232 | "<p>If you have just initiated a Sync for the first time, this is normal."), | 232 | "<p>If you have just initiated a Sync for the first time, this is normal."), |
233 | tr("Allow"),tr("Deny"))==1 ) | 233 | tr("Allow"),tr("Deny"), 0, 1, 1 ) ==1 ) |
234 | { | 234 | { |
235 | denials++; | 235 | denials++; |
236 | lastdenial=now; | 236 | lastdenial=now; |
237 | return FALSE; | 237 | return FALSE; |
238 | } else { | 238 | } else { |
239 | denials=0; | 239 | denials=0; |
240 | cfg.writeEntry("Passwords",pwds+" "+cpassword); | 240 | cfg.writeEntry("Passwords",pwds+" "+cpassword); |
241 | return TRUE; | 241 | return TRUE; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | return FALSE; | 245 | return FALSE; |
246 | } | 246 | } |
247 | 247 | ||
248 | ServerPI::ServerPI( int socket, QObject *parent , const char* name ) | 248 | ServerPI::ServerPI( int socket, QObject *parent , const char* name ) |
249 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) | 249 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) |
250 | { | 250 | { |
251 | state = Connected; | 251 | state = Connected; |
252 | 252 | ||
253 | setSocket( socket ); | 253 | setSocket( socket ); |
254 | 254 | ||
255 | peerport = peerPort(); | 255 | peerport = peerPort(); |
256 | peeraddress = peerAddress(); | 256 | peeraddress = peerAddress(); |
257 | 257 | ||
258 | #ifndef INSECURE | 258 | #ifndef INSECURE |
259 | if ( !SyncAuthentication::isAuthorized(peeraddress) ) { | 259 | if ( !SyncAuthentication::isAuthorized(peeraddress) ) { |
260 | state = Forbidden; | 260 | state = Forbidden; |
261 | startTimer( 0 ); | 261 | startTimer( 0 ); |
262 | } else | 262 | } else |
263 | #endif | 263 | #endif |
264 | { | 264 | { |
265 | connect( this, SIGNAL( readyRead() ), SLOT( read() ) ); | 265 | connect( this, SIGNAL( readyRead() ), SLOT( read() ) ); |