Summary: | Cannot change directory on FTP connection with AIX server | ||
---|---|---|---|
Product: | [Unmaintained] kio | Reporter: | gyszalai |
Component: | ftp | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | adawit, jan_lepper, leadman |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdelibs/014e8f3ca18b0dd22e041f9785afc578f1ebc51b | Version Fixed In: | 4.9.3 |
Sentry Crash Report: | |||
Attachments: |
screen shot identifying names with spaces at the beginning.
patch v1 patch v2 |
Description
gyszalai
2012-06-01 10:00:01 UTC
Does this happen only with Krusader, not Konqueror/Dolphin/other ftp clients ? Yes, it happens with Konqueror as well. By the way, it doesn't happen if I use sftp protocol instead of ftp. Hi, I have tested this on Ubuntu 12.04, with Krusader 2.4.0-beta1 and can confirm this behaviour. This bug happens also with AIX 5.3.0.0 and 6.1.0.0 as FTp server. As a sidenote, this bug also happens with MidnightCommander. Other FTP clients seem to work fine. Current status indicates that you need info. Please specify what exactly do you need, cause I really like Krusader and use it as everyday tool in my work. Lack of FTP connectiont paralyzes my work. What can I do to help you resolve this bug? Recently nothing was happening around this bug, so I investigated it a bit and have noticed following relation. The files with additional space in name are ONLY the ones, which have NOT been modified at current day. In such cases the 'hh:mm' part of modification date is replaced by 'YYYY ' followed by additional space, which makes krusader to add one additional space to file name. I am attaching screen shot, illustrating this situation: Bug_300988_Cannot_change_directory_on_FTP_connection_with_AIX_server.png Created attachment 72579 [details]
screen shot identifying names with spaces at the beginning.
Apparently this happens because the fix for https://bugs.kde.org/show_bug.cgi?id=88575 (Do not trim whitespaces from filenames.) (In reply to comment #7) > Apparently this happens because the fix for > https://bugs.kde.org/show_bug.cgi?id=88575 (Do not trim whitespaces from > filenames.) Well, since I am responsible for that fix, I looked into this and came up with a potential fix. However, I do not have access to an ftp server on a AIX machine and as such no means to test the patch. Can any of you either test the patch (you have to compile kdelibs 4.9 branch from source) or provide a test ftp server on an AIX box ? Created attachment 74220 [details]
patch v1
Comment on attachment 74220 [details] patch v1 >diff --git a/kioslave/ftp/ftp.cpp b/kioslave/ftp/ftp.cpp >index 26be283..6e2fdae 100644 >--- a/kioslave/ftp/ftp.cpp >+++ b/kioslave/ftp/ftp.cpp >@@ -1465,6 +1465,7 @@ void Ftp::stat(const KUrl &url) > FtpEntry ftpEnt; > while( ftpReadDir(ftpEnt) ) > { >+ fixupEntryName(&ftpEnt); > // We look for search or filename, since some servers (e.g. ftp.tuwien.ac.at) > // return only the filename when doing "dir /full/path/to/file" > if (!bFound) { >@@ -1548,6 +1549,7 @@ void Ftp::listDir( const KUrl &url ) > FtpEntry ftpEnt; > while( ftpReadDir(ftpEnt) ) > { >+ fixupEntryName(&ftpEnt); > //kDebug(7102) << ftpEnt.name; > //Q_ASSERT( !ftpEnt.name.isEmpty() ); > if ( !ftpEnt.name.isEmpty() ) >@@ -2607,3 +2609,38 @@ void Ftp::saveProxyAuthentication() > delete m_socketProxyAuth; > m_socketProxyAuth = 0; > } >+ >+void Ftp::fixupEntryName(FtpEntry* e) >+{ >+ Q_ASSERT(e); >+ if (!e->name.startsWith(QLatin1Char(' '))) >+ return; >+ >+ if (e->type == S_IFDIR) { >+ if (!ftpFolder(e->name, false)) { >+ // whitespaces in directory name are bogus... >+ int index = 0; >+ while (e->name.at(index) == QLatin1Char(' ')) { >+ index++; >+ const QString name (e->name.mid(index)); >+ if (ftpFolder(name, false)) { >+ kDebug(7102) << "fixing up directory name from" << e->name << "to" << name; >+ e->name = name; >+ } >+ } >+ } >+ } else { >+ if (!ftpFileExists(e->name)) { >+ // whitespaces in directory name are bogus... >+ int index = 0; >+ while (e->name.at(index) == QLatin1Char(' ')) { >+ index++; >+ const QString name (e->name.mid(index)); >+ if (ftpFileExists(name)) { >+ kDebug(7102) << "fixing up filename from" << e->name << "to" << name; >+ e->name = name; >+ } >+ } >+ } >+ } >+} >diff --git a/kioslave/ftp/ftp.h b/kioslave/ftp/ftp.h >index 2465a4b..f5c3ec1 100644 >--- a/kioslave/ftp/ftp.h >+++ b/kioslave/ftp/ftp.h >@@ -333,6 +333,12 @@ private: > */ > StatusCode ftpSendMimeType(int& iError, const KUrl& url); > >+ /** >+ * Fixes up an entry name so that extraneous whitespaces do not cause >+ * problems. See bug# 88575 and bug# 300988. >+ */ >+ void fixupEntryName(FtpEntry*); >+ > private Q_SLOTS: > void proxyAuthentication(const QNetworkProxy&, QAuthenticator*); > void saveProxyAuthentication(); Created attachment 74224 [details]
patch v2
Git commit 014e8f3ca18b0dd22e041f9785afc578f1ebc51b by Dawit Alemayehu. Committed on 29/09/2012 at 08:24. Pushed by adawit into branch 'KDE/4.9'. Make sure bogus whitespaces do not break listing. This patch addresses the regression caused by the fix for bug# 88575. Namely not trimming the white spaces from filenames breaks AIX ftp servers which seem to add bogus whitespace between the date and entry name. FIXED-IN:4.9.3 REVIEW:106636 M +89 -17 kioslave/ftp/ftp.cpp M +12 -1 kioslave/ftp/ftp.h http://commits.kde.org/kdelibs/014e8f3ca18b0dd22e041f9785afc578f1ebc51b Hello Dawit, Is this patch already in some packaged version I could install? i am asking because Ubunu team seems to not care much about Krusader - there is still 2.4.0-beta1 in Ubuntu 13.04. (In reply to comment #13) > Hello Dawit, > Is this patch already in some packaged version I could install? i am asking > because Ubunu team seems to not care much about Krusader - there is still > 2.4.0-beta1 in Ubuntu 13.04. It is not the Krusader version that matters for this patch. It is the kdelibs version. If it is equal to or greater than 4.9.3, then this patch should already be included. (In reply to comment #14) > It is not the Krusader version that matters for this patch. It is the > kdelibs version. If it is equal to or greater than 4.9.3, then this patch > should already be included. $ apt-cache policy kdelibs* [...] kdelibs-bin: Installed: 4:4.10.5-0ubuntu0.1 Candidate: 4:4.10.5-0ubuntu0.1 [...] So it seems 4.10.5>4.9.3, but I still am unable to use Krusader with AIX FTP. Any clue? |