https://bugs.kde.org/show_bug.cgi?id=528714

            Bug ID: 528714
           Summary: KNetAttach fails to prompt for SMB credentials when
                    stat() returns EINVAL
    Classification: Frameworks and Libraries
           Product: kio-extras
      Version First 25.04.3
       Reported In:
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Samba
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

ENVIRONMENT
Debian GNU/Linux 13.6 (trixie)
Plasma 6.3.6, KDE Frameworks 6.13.0, Qt 6.8.2
kio-extras 25.04.3, libsmbclient 4.22.11
SMB server: Windows 11 24H2

STEPS TO REPRODUCE
1. Run knetattach without cached credentials for the SMB share.
2. Choose Microsoft Windows network drive and enter the server IP and the name
of an existing share that requires authentication.
3. Leave Create an icon for this remote folder checked and click Save &
Connect.

OBSERVED RESULT
KNetAttach displays “Unable to connect to server. Please check your settings
and try again.” No credentials dialog appears, and the shortcut is not saved.
The SMB worker logs:
    stat() error 22 QUrl("smb://<server>/DolphinTest")
    errNum 22

A separate listing of the same URL also encountered errno 22, then reached
checkPassword() and openPasswordDialog(). The share existed and TCP port 445
was reachable from the client.

EXPECTED RESULT
Prompt for SMB credentials, retry the connection, and save the shortcut after
successful authentication.

TECHNICAL NOTE
In the tested kio-extras version, SMBWorker::listDir() calls checkPassword() on
EINVAL. SMBWorker::stat(), which KNetAttach uses for the connection test,
returns the error in this case. The source on master currently shows the same
difference. Runtime reproduction was on kio-extras 25.04.3.
https://github.com/KDE/kio-extras/blob/v25.04.3/smb/kio_smb_browse.cpp#L108-L153
https://github.com/KDE/kio-extras/blob/v25.04.3/smb/kio_smb_browse.cpp#L422-L441

Related precedent: bug 399699 aligned stat() with listDir() for EEXIST.
https://bugs.kde.org/show_bug.cgi?id=399699

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to