summaryrefslogtreecommitdiff
authorzecke <zecke>2004-12-20 21:58:55 (UTC)
committer zecke <zecke>2004-12-20 21:58:55 (UTC)
commit5f35158ba0e7c2813768aaab6d6ad478dc0271a1 (patch) (unidiff)
treea4d6e8000e14ecd4e48ffee18fba733f78fbd0a7
parent7479e7ac142eb830329fb08f16179bb3aca642e5 (diff)
downloadopie-5f35158ba0e7c2813768aaab6d6ad478dc0271a1.zip
opie-5f35158ba0e7c2813768aaab6d6ad478dc0271a1.tar.gz
opie-5f35158ba0e7c2813768aaab6d6ad478dc0271a1.tar.bz2
Restore lost change
-Kill Config instance in different scope for the same file -Work when a ftp client sends -la in a listdir request
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/transferserver.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 1d4ca40..2b2e435 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -227,17 +227,16 @@ bool SyncAuthentication::checkPassword( const QString& password )
227 if ( lock ) return FALSE; 227 if ( lock ) return FALSE;
228 228
229 ++lock; 229 ++lock;
230 230
231 /* 231 /*
232 * we need to support old Sync software and QtopiaDesktop 232 * we need to support old Sync software and QtopiaDesktop
233 */ 233 */
234 if ( password.left(6) == "Qtopia" || password.left(6) == "rootme" ) { 234 if ( password.left(6) == "Qtopia" || password.left(6) == "rootme" ) {
235 Config cfg( "Security" );
236 cfg.setGroup("Sync"); 235 cfg.setGroup("Sync");
237 QStringList pwds = cfg.readListEntry("Passwords",' '); 236 QStringList pwds = cfg.readListEntry("Passwords",' ');
238 for (QStringList::ConstIterator it=pwds.begin(); it!=pwds.end(); ++it) { 237 for (QStringList::ConstIterator it=pwds.begin(); it!=pwds.end(); ++it) {
239#ifndef Q_OS_WIN32 238#ifndef Q_OS_WIN32
240 QString cpassword = QString::fromLocal8Bit( 239 QString cpassword = QString::fromLocal8Bit(
241 crypt( password.mid(8).local8Bit(), (*it).left(2).latin1() ) ); 240 crypt( password.mid(8).local8Bit(), (*it).left(2).latin1() ) );
242#else 241#else
243 // ### revise 242 // ### revise
@@ -375,18 +374,20 @@ void ServerPI::read()
375{ 374{
376 while ( canReadLine() ) 375 while ( canReadLine() )
377 process( readLine().stripWhiteSpace() ); 376 process( readLine().stripWhiteSpace() );
378} 377}
379 378
380bool ServerPI::checkReadFile( const QString& file ) 379bool ServerPI::checkReadFile( const QString& file )
381{ 380{
382 QString filename; 381 QString filename;
383 382
384 if ( file[0] != "/" ) 383 if ( file.length() == 1 && file[0] == "/" )
384 filename = file;
385 else if ( file[0] != "/" )
385 filename = directory.path() + "/" + file; 386 filename = directory.path() + "/" + file;
386 else 387 else
387 filename = file; 388 filename = file;
388 389
389 QFileInfo fi( filename ); 390 QFileInfo fi( filename );
390 return ( fi.exists() && fi.isReadable() ); 391 return ( fi.exists() && fi.isReadable() );
391} 392}
392 393
@@ -692,16 +693,19 @@ void ServerPI::process( const QString& message )
692 693
693 // print working directory (PWD) 694 // print working directory (PWD)
694 else if ( cmd == "PWD" ) { 695 else if ( cmd == "PWD" ) {
695 send( "257 \"" + directory.path() +"\"" ); 696 send( "257 \"" + directory.path() +"\"" );
696 } 697 }
697 698
698 // list (LIST) 699 // list (LIST)
699 else if ( cmd == "LIST" ) { 700 else if ( cmd == "LIST" ) {
701 if ( args == "-la" )
702 args = QString::null;
703
700 if ( sendList( absFilePath( args ) ) ) 704 if ( sendList( absFilePath( args ) ) )
701 send( "150 File status okay" ); // No tr 705 send( "150 File status okay" ); // No tr
702 else 706 else
703 send( "500 Syntax error, command unrecognized" ); // No tr 707 send( "500 Syntax error, command unrecognized" ); // No tr
704 } 708 }
705 709
706 // size (SIZE) 710 // size (SIZE)
707 else if ( cmd == "SIZE" ) { 711 else if ( cmd == "SIZE" ) {