Summary: | authentication failure on netware ftp server | ||
---|---|---|---|
Product: | [Unmaintained] kio | Reporter: | Michał Kosmulski <michal> |
Component: | ftp | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Michał Kosmulski
2004-02-29 20:11:46 UTC
Is this the same as http://bugs.kde.org/show_bug.cgi?id=36055? How does the directory listing look like, when using the command-line 'ftp' program? Yes, it seems to be the same thing as #36055. Unfortunately, I don't have access to the ftp server where I first noticed the problem any more. The files that used to be there were moved to another machine which is also a netware server and is located in the same building so chances are it's configured in the same way. Unfortunately, access to the machine is restricted to several IP addresses only, and on the machines from which I can access the server, there is no konqueror. Below is a partial listing (from ncftp). All other files have exactly the same permissions. - [RWCEAFMS] nzs_mkosmul 2105 Mar 19 18:55 debata.php - [RWCEAFMS] nzs_mkosmul 1411 May 4 22:03 dnihiszp.php - [RWCEAFMS] nzs_mkosmul 1253 Mar 19 18:55 dniotwarte.php - [RWCEAFMS] nzs_mkosmul 2550 Mar 19 12:48 favicon.ico - [RWCEAFMS] nzs_mkosmul 797 May 31 11:31 galeria.php - [RWCEAFMS] nzs_mkosmul 1211 Mar 19 12:48 home.gif - [RWCEAFMS] nzs_mkosmul 1408 Mar 19 12:48 icons.gif - [RWCEAFMS] nzs_mkosmul 1266 Mar 19 12:48 identity.gif d [RWCEAFMS] nzs_mkosmul 512 Mar 19 12:48 images *** This bug has been marked as a duplicate of 36055 *** Actually the netware listing is quite different from the d-------- listing from Microsoft, so those bugs are not duplicates. I'll fix the netware listing parsing now. CVS commit by faure: Fix parsing of Netware FTP servers, so that files don't all appear with a lock (no permissions). BUG: 76442 M +179 -172 ftp.cc 1.218 --- kdelibs/kioslave/ftp/ftp.cc #1.217:1.218 @@ -1749,4 +1749,9 @@ bool Ftp::ftpReadDir(FtpEntry& de) kdDebug(7102) << "dir > " << buffer << endl; + //Normally the listing looks like + // -rw-r--r-- 1 dfaure dfaure 102 Nov 9 12:30 log + // but on Netware servers like ftp://ci-1.ci.pwr.wroc.pl/ it looks like (#76442) + // d [RWCEAFMS] Admin 512 Oct 13 2004 PSI + // we should always get the following 5 fields ... const char *p_access, *p_junk, *p_owner, *p_group, *p_size; @@ -1757,5 +1762,11 @@ bool Ftp::ftpReadDir(FtpEntry& de) if( (p_size = strtok(NULL," ")) == 0) continue; - // try to parse it as a directory entry ... + //kdDebug(7102) << "p_access=" << p_access << " p_junk=" << p_junk << " p_owner=" << p_owner << " p_group=" << p_group << " p_size=" << p_size << endl; + + de.access = 0; + if ( strlen( p_access ) == 1 && p_junk[0] == '[' ) { // Netware + de.access = S_IRWXU | S_IRWXG | S_IRWXO; // unknown -> give all permissions + } + const char *p_date_1, *p_date_2, *p_date_3, *p_name; @@ -1772,5 +1783,6 @@ bool Ftp::ftpReadDir(FtpEntry& de) // Check whether the size we just read was really the size // or a month (this happens when the server lists no group) - // Test on sunsite.uio.no, for instance + // Used to be the case on sunsite.uio.no, but not anymore + // This is needed for the Netware case, too. if ( !isdigit( *p_size ) ) { @@ -1786,10 +1798,9 @@ bool Ftp::ftpReadDir(FtpEntry& de) } - if ( p_date_1 != 0 ) - if ((p_date_2 = strtok(NULL," ")) != 0) - if ((p_date_3 = strtok(NULL," ")) != 0) - if ((p_name = strtok(NULL,"\r\n")) != 0) + if ( p_date_1 != 0 && + (p_date_2 = strtok(NULL," ")) != 0 && + (p_date_3 = strtok(NULL," ")) != 0 && + (p_name = strtok(NULL,"\r\n")) != 0 ) { - { QCString tmp( p_name ); @@ -1817,5 +1828,4 @@ bool Ftp::ftpReadDir(FtpEntry& de) } - de.access = 0; de.type = S_IFREG; switch ( p_access[0] ) { @@ -1865,7 +1875,4 @@ bool Ftp::ftpReadDir(FtpEntry& de) de.access |= S_ISVTX; - // maybe fromLocal8Bit would be better in some cases, - // but what proves that the ftp server is in the same encoding - // than the user ?? de.owner = remoteEncoding()->decode(p_owner); de.group = remoteEncoding()->decode(p_group); @@ -1930,5 +1937,5 @@ bool Ftp::ftpReadDir(FtpEntry& de) return true; } - } + } // line invalid, loop to get another line return false; } |