Bug 203977

Summary: several times is not possible the access data for libsmbclient
Product: [Unmaintained] kio Reporter: Giuseppe Della Bianca <giusdbg>
Component: smbAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch
Improvement of the previous patch

Description Giuseppe Della Bianca 2009-08-15 19:26:11 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Using kio_smb several times is not possible to insert or insert again the access data for libsmbclient, for the following reasons:

1 - The openPasswordDialog check if the access data is stored in to kpasswdserver on different mode of checkCachedAuthentication.
2 - The libsmbclient return access denied but the openPasswordDialog on several case do not active the access data dialog mask.
3 - The openPasswordDialog store in to kpasswdserver the access data even if the access data, for libsmbclient, are mistaken.

4 - smbd program in the case of access denied at the filesystem level, return bad error NT_STATUS_BAD_NETWORK_NAME in place of the correct error NT_STATUS_ACCESS_DENIED.


The attached patch is a workaround (the fix well require a large rewrite of the code) for point 1, 2, 3 .
The patch for fix point 4 is on https://bugzilla.samba.org/show_bug.cgi?id=6616
Comment 1 Giuseppe Della Bianca 2009-08-15 19:29:05 UTC
Created attachment 36178 [details]
Patch
Comment 2 Giuseppe Della Bianca 2009-08-15 21:39:40 UTC
Comment on attachment 36178 [details]
Patch

I am sorry, for wrong title, and for partial wrong patch.

Please, don't apply this section of the patch:

diff -Naur smb_orig/kio_smb_browse.cpp smb/kio_smb_browse.cpp
--- smb_orig/kio_smb_browse.cpp	2009-08-15 15:29:56.466036172 +0200
+++ smb/kio_smb_browse.cpp	2009-08-15 16:00:17.691147077 +0200
@@ -152,7 +152,8 @@
         break;
 
     case SMBURLTYPE_SHARE_OR_PATH:
-        if (browse_stat_path(m_current_url, udsentry, false))
+// the request the access data for libsmbclient is useless, and is a duplicate that one in listDir
+        if (browse_stat_path(m_current_url, udsentry, true))
             break;
         else {
             kDebug(KIO_SMB) << "SMBSlave::stat ERROR!!";
Comment 3 Giuseppe Della Bianca 2009-08-17 20:28:29 UTC
Created attachment 36230 [details]
Improvement of the previous patch

This patch is a large improvement of the previous patch and replace it completely. 

Not a perfect workaround, but I think that do not we can do better (should rewrite kio / kioslave).

Apply patch:
cp access_denied_patch.diff KDE/kdebase/rumtime/kioslave
cd KDE/kdebase/rumtime/kioslave
patch -p0 < access_denied_patch.diff