Bug 432231

Summary: When creating a folder on ftp share every name already exists.
Product: [Frameworks and Libraries] frameworks-kio Reporter: tb44332211
Component: FTPAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kdelibs-bugs, kfm-devel, meven29, nate
Priority: NOR    
Version: 5.78.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:

Description tb44332211 2021-01-28 08:14:54 UTC
SUMMARY
I can't create a folder on my ftp share anymore. Every time I select the 'add folder' option and want to enter a name, the message 'A file with name ... already exists' comes up, even though I manually checked that no file/folder with this name exists.
I also tried adding a folder from a different machine (but with the same ftp user) and everything worked fine.

STEPS TO REPRODUCE
1. Open an ftp share in dolphin.
2. Try to add a new folder
3. 

OBSERVED RESULT
'A file with name ... already exists' message shows up every time, no matter which name is given.

EXPECTED RESULT
Only show the message, when a file/folder with the specified name already exists.

SOFTWARE/OS VERSIONS
Windows: /
macOS: /
Linux/KDE Plasma: 5.10.7-3-MANJARO
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Méven Car 2021-01-30 09:11:50 UTC
KNewFileMenu now checks dynamically files do not exist as users type, this seems to point at an issue with the ftp kio worker stat that returns garbage when stating not-existing files/directories instead of responding an error .

I am assuming you are using the kio worker ftp:// , i.e the url where you are trying to creating a file begins with ftp:/
Comment 2 Méven Car 2021-01-30 09:55:02 UTC
In particular:

```
    if (statSide == QLatin1String("source")) {
        qCDebug(KIO_FTP) << "Not found, but assuming found, because some servers don't allow listing";
        // MS Server is incapable of handling "list <blah>" in a case insensitive way
        // But "retr <blah>" works. So lie in stat(), to get going...
        //
        // There's also the case of ftp://ftp2.3ddownloads.com/90380/linuxgames/loki/patches/ut/ut-patch-436.run
        // where listing permissions are denied, but downloading is still possible.
        ftpShortStatAnswer(filename, false /*file, not dir*/);

        return Result::pass();
    }
```
https://invent.kde.org/frameworks/kio/-/blob/master/src/ioslaves/ftp/ftp.cpp#L1317
Comment 3 Nate Graham 2021-02-11 17:08:07 UTC

*** This bug has been marked as a duplicate of bug 429541 ***