diff options
Diffstat (limited to 'kde-apps/kio-extras/files/kio-extras-17.04.3-smb.patch')
-rw-r--r-- | kde-apps/kio-extras/files/kio-extras-17.04.3-smb.patch | 240 |
1 files changed, 0 insertions, 240 deletions
diff --git a/kde-apps/kio-extras/files/kio-extras-17.04.3-smb.patch b/kde-apps/kio-extras/files/kio-extras-17.04.3-smb.patch deleted file mode 100644 index b6b83845f795..000000000000 --- a/kde-apps/kio-extras/files/kio-extras-17.04.3-smb.patch +++ /dev/null @@ -1,240 +0,0 @@ -From 2574c9158febdcb3dd7a0ebc3e76311f016d00d0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michal=20Mal=C3=BD?= <malymi@natur.cuni.cz> -Date: Wed, 12 Jul 2017 11:55:04 +0200 -Subject: Always create the "." UDSEntry - -Summary: -The smb_kio plugin does not create the "." UDSEntry, -relying on the underlying KIO infrastructure to create a default one. - -This patch ensures that the UDSEntry is always created with proper access permissions. - -CCBUG: 376344 - -Reviewers: elvisangelaccio - -Differential Revision: https://phabricator.kde.org/D6616 ---- - smb/kio_smb_browse.cpp | 23 ++++++++++++++++++++++- - 1 file changed, 22 insertions(+), 1 deletion(-) - -diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp -index 1ca90a2..06ca60b 100644 ---- a/smb/kio_smb_browse.cpp -+++ b/smb/kio_smb_browse.cpp -@@ -309,6 +309,7 @@ void SMBSlave::listDir( const QUrl& kurl ) - int dirfd; - struct smbc_dirent *dirp = NULL; - UDSEntry udsentry; -+ bool dir_is_root = true; - - dirfd = smbc_opendir( m_current_url.toSmbcUrl() ); - if (dirfd > 0){ -@@ -350,8 +351,14 @@ void SMBSlave::listDir( const QUrl& kurl ) - udsentry.insert(KIO::UDSEntry::UDS_HIDDEN, 1); - } - -- if (udsName == "." || udsName == "..") -+ if (udsName == ".") - { -+ // Skip the "." entry -+ // Mind the way m_current_url is handled in the loop -+ } -+ else if (udsName == "..") -+ { -+ dir_is_root = false; - // fprintf(stderr,"----------- hide: -%s-\n",dirp->name); - // do nothing and hide the hidden shares - } -@@ -430,6 +437,20 @@ void SMBSlave::listDir( const QUrl& kurl ) - udsentry.clear(); - } while (dirp); // checked already in the head - -+ if (dir_is_root) { -+ udsentry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); -+ udsentry.insert(KIO::UDSEntry::UDS_NAME, "."); -+ udsentry.insert(KIO::UDSEntry::UDS_ACCESS, (S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH)); -+ udsentry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String("application/x-smb-server")); -+ } -+ else -+ { -+ udsentry.insert(KIO::UDSEntry::UDS_NAME, "."); -+ browse_stat_path(m_current_url, udsentry, true); -+ } -+ listEntry(udsentry); -+ udsentry.clear(); -+ - // clean up - smbc_closedir(dirfd); - } --- -cgit v0.11.2 -From e792aa44b5aa0b122e006234a8f87a16ff12fe6f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michal=20Mal=C3=BD?= <malymi@natur.cuni.cz> -Date: Wed, 12 Jul 2017 11:57:12 +0200 -Subject: Return appropriate error code from browse_stat_path() instead of - trying to deal with the error internally. - -Summary: -Current behavior of browse_stat_path() can result in both finished() and error() being signaled to KIO. -This patch adjusts the logic to prevent this case. - -Reviewers: elvisangelaccio - -BUG: 376344 -FIXED-IN: 17.08.0 - -Differential Revision: https://phabricator.kde.org/D6617 ---- - smb/kio_smb.h | 5 ++-- - smb/kio_smb_browse.cpp | 67 ++++++++++++++++++++++++++++---------------------- - 2 files changed, 40 insertions(+), 32 deletions(-) - -diff --git a/smb/kio_smb.h b/smb/kio_smb.h -index a5cae11..a2a9343 100644 ---- a/smb/kio_smb.h -+++ b/smb/kio_smb.h -@@ -156,10 +156,9 @@ protected: - * Description : Return a stat of given SMBUrl. Calls cache_stat and - * pack it in UDSEntry. UDSEntry will not be cleared - * Parameter : SMBUrl the url to stat -- * ignore_errors do not call error(), but warning() -- * Return : false if any error occurred (errno), else true -+ * Return : cache_stat() return code - */ -- bool browse_stat_path(const SMBUrl& url, UDSEntry& udsentry, bool ignore_errors); -+ int browse_stat_path(const SMBUrl& url, UDSEntry& udsentry); - - /** - * Description : call smbc_stat and return stats of the url -diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp -index 06ca60b..84bfdc2 100644 ---- a/smb/kio_smb_browse.cpp -+++ b/smb/kio_smb_browse.cpp -@@ -55,8 +55,7 @@ int SMBSlave::cache_stat(const SMBUrl &url, struct stat* st ) - } - - //--------------------------------------------------------------------------- --bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ignore_errors) -- // Returns: true on success, false on failure -+int SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry) - { - SMBUrl url = _url; - -@@ -68,7 +67,7 @@ bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ign - qCDebug(KIO_SMB) << "mode: "<< st.st_mode; - warning(i18n("%1:\n" - "Unknown file type, neither directory or file.", url.toDisplayString())); -- return false; -+ return EINVAL; - } - - udsentry.insert(KIO::UDSEntry::UDS_FILE_TYPE, st.st_mode & S_IFMT); -@@ -96,24 +95,8 @@ bool SMBSlave::browse_stat_path(const SMBUrl& _url, UDSEntry& udsentry, bool ign - udsentry.insert(KIO::UDSEntry::UDS_ACCESS_TIME, st.st_atime); - // No, st_ctime is not UDS_CREATION_TIME... - } -- else -- { -- if (!ignore_errors) { -- if (cacheStatErr == EPERM || cacheStatErr == EACCES) -- if (checkPassword(url)) { -- redirection( url ); -- return false; -- } -- -- reportError(url, cacheStatErr); -- } else if (cacheStatErr == ENOENT || cacheStatErr == ENOTDIR) { -- warning(i18n("File does not exist: %1", url.url())); -- } -- qCDebug(KIO_SMB) << "ERROR!!"; -- return false; -- } - -- return true; -+ return cacheStatErr; - } - - //=========================================================================== -@@ -141,7 +124,7 @@ void SMBSlave::stat( const QUrl& kurl ) - switch(m_current_url.getType()) - { - case SMBURLTYPE_UNKNOWN: -- error(ERR_MALFORMED_URL,m_current_url.toDisplayString()); -+ error(ERR_MALFORMED_URL, url.toDisplayString()); - return; - - case SMBURLTYPE_ENTIRE_NETWORK: -@@ -150,12 +133,38 @@ void SMBSlave::stat( const QUrl& kurl ) - break; - - case SMBURLTYPE_SHARE_OR_PATH: -- if (browse_stat_path(m_current_url, udsentry, false)) -+ { -+ int ret = browse_stat_path(m_current_url, udsentry); -+ -+ if (ret == EPERM || ret == EACCES) -+ { -+ SMBUrl smbUrl(url); -+ -+ if (checkPassword(smbUrl)) -+ { -+ redirection(smbUrl); -+ finished(); -+ } -+ else -+ { -+ reportError(url, ret); -+ } -+ -+ return; -+ } -+ else if (ret == ENOENT || ret == ENOTDIR) -+ { -+ warning(i18n("File does not exist: %1", url.url())); -+ finished(); -+ return; -+ } -+ else if (ret != 0) -+ { -+ qCDebug(KIO_SMB) << "stat() error" << ret << url; -+ reportError(url, ret); -+ return; -+ } - break; -- else { -- qCDebug(KIO_SMB) << "ERROR!!"; -- finished(); -- return; - } - default: - qCDebug(KIO_SMB) << "UNKNOWN " << url; -@@ -366,7 +375,7 @@ void SMBSlave::listDir( const QUrl& kurl ) - { - // Set stat information - m_current_url.addPath(dirpName); -- browse_stat_path(m_current_url, udsentry, true); -+ browse_stat_path(m_current_url, udsentry); - m_current_url.cd(".."); - - // Call base class to list entry -@@ -375,7 +384,7 @@ void SMBSlave::listDir( const QUrl& kurl ) - else if(dirp->smbc_type == SMBC_DIR) - { - m_current_url.addPath(dirpName); -- browse_stat_path(m_current_url, udsentry, true); -+ browse_stat_path(m_current_url, udsentry); - m_current_url.cd(".."); - - // Call base class to list entry -@@ -446,7 +455,7 @@ void SMBSlave::listDir( const QUrl& kurl ) - else - { - udsentry.insert(KIO::UDSEntry::UDS_NAME, "."); -- browse_stat_path(m_current_url, udsentry, true); -+ browse_stat_path(m_current_url, udsentry); - } - listEntry(udsentry); - udsentry.clear(); --- -cgit v0.11.2 |