From 6dc591bfe08074c5bce4fcc5e24167cfb2c2e7b4 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Tue, 31 Mar 2020 14:36:10 +0200 Subject: [PATCH 1/8] Fix a couple of typos --- changelog/unreleased/7018 | 2 +- changelog/unreleased/7043 | 4 ++-- changelog/unreleased/7247 | 2 +- changelog/unreleased/7774 | 2 +- changelog/unreleased/7799 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changelog/unreleased/7018 b/changelog/unreleased/7018 index a68bc84229..837a008ef1 100644 --- a/changelog/unreleased/7018 +++ b/changelog/unreleased/7018 @@ -1,5 +1,5 @@ Bugfix: Client sometimes does not show up when started by a user -We fixed a bug where a client somtimes does not show up when a user request a start. +We fixed a bug where a client sometimes does not show up when a user request a start. https://github.com/owncloud/client/issues/7018 diff --git a/changelog/unreleased/7043 b/changelog/unreleased/7043 index 8105bc2fe6..f16de84a34 100644 --- a/changelog/unreleased/7043 +++ b/changelog/unreleased/7043 @@ -1,6 +1,6 @@ -Bugfix: Fix serveral wrong colored icons in dark mode +Bugfix: Fix several wrong colored icons in dark mode -We fixed multiple issues where monocrome icons where not converted to match the +We fixed multiple issues where monochrome icons where not converted to match the current theme. https://github.com/owncloud/client/issues/7043 diff --git a/changelog/unreleased/7247 b/changelog/unreleased/7247 index 6b6c1a84df..8bc65aab6a 100644 --- a/changelog/unreleased/7247 +++ b/changelog/unreleased/7247 @@ -1,5 +1,5 @@ Bugfix: Fixed bug in public link with password required -In the sharing dialog, "password required" capabilities lead to incorrect behavior +In the sharing dialog, "password required" capabilities lead to incorrect behaviour https://github.com/owncloud/client/issues/7247 diff --git a/changelog/unreleased/7774 b/changelog/unreleased/7774 index e69e81b037..7aed3ef25c 100644 --- a/changelog/unreleased/7774 +++ b/changelog/unreleased/7774 @@ -1,4 +1,4 @@ -Bugfix: On Windows the share dialog somtimes does not open as the top most window +Bugfix: On Windows the share dialog sometimes does not open as the top most window We now ensure that the our dialogs are correctly raised. diff --git a/changelog/unreleased/7799 b/changelog/unreleased/7799 index 592ecbd8e6..545c15d5d1 100644 --- a/changelog/unreleased/7799 +++ b/changelog/unreleased/7799 @@ -1,5 +1,5 @@ Bugfix: Client sometimes crashes when a placeholder file was moved -We fixed an issue where moving a plcaeholder file would lead to a crash. +We fixed an issue where moving a placeholder file would lead to a crash. https://github.com/owncloud/client/issues/7799 From 0a8010be57a75299d538abdcc922adbad5cdea9e Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Tue, 31 Mar 2020 13:51:18 +0200 Subject: [PATCH 2/8] Cookies: Don't override cookies with outdated values This code was actually not breaking most cookie handling by accident. As the raw cookies where not split properly we added cookies with values like "key: val; key2 = val2; key3 = val3" When the code was corrected we overwrote the newer values in the jar with the old ones from a request. --- changelog/unreleased/7831 | 6 ++++++ src/libsync/accessmanager.cpp | 18 ------------------ src/libsync/accessmanager.h | 2 -- 3 files changed, 6 insertions(+), 20 deletions(-) create mode 100644 changelog/unreleased/7831 diff --git a/changelog/unreleased/7831 b/changelog/unreleased/7831 new file mode 100644 index 0000000000..56a11bd292 --- /dev/null +++ b/changelog/unreleased/7831 @@ -0,0 +1,6 @@ +Bugfix: Don't override cookies with old values + +We fixed a bug where a client somteimes overrode the content of the cookie jar +with outdated or corrupted values + +https://github.com/owncloud/client/pull/7831 diff --git a/src/libsync/accessmanager.cpp b/src/libsync/accessmanager.cpp index 8ee38c3995..b957e2c2bf 100644 --- a/src/libsync/accessmanager.cpp +++ b/src/libsync/accessmanager.cpp @@ -49,18 +49,6 @@ AccessManager::AccessManager(QObject *parent) setCookieJar(new CookieJar); } -void AccessManager::setRawCookie(const QByteArray &rawCookie, const QUrl &url) -{ - QNetworkCookie cookie(rawCookie.left(rawCookie.indexOf('=')), - rawCookie.mid(rawCookie.indexOf('=') + 1)); - qCDebug(lcAccessManager) << cookie.name() << cookie.value(); - QList cookieList; - cookieList.append(cookie); - - QNetworkCookieJar *jar = cookieJar(); - jar->setCookiesFromUrl(cookieList, url); -} - static QByteArray generateRequestId() { // Use a UUID with the starting and ending curly brace removed. @@ -71,12 +59,6 @@ static QByteArray generateRequestId() QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData) { QNetworkRequest newRequest(request); - - if (newRequest.hasRawHeader("cookie")) { - // This will set the cookie into the QNetworkCookieJar which will then override the cookie header - setRawCookie(request.rawHeader("cookie"), request.url()); - } - newRequest.setRawHeader(QByteArray("User-Agent"), Utility::userAgentString()); // Some firewalls reject requests that have a "User-Agent" but no "Accept" header diff --git a/src/libsync/accessmanager.h b/src/libsync/accessmanager.h index d38a13487f..a502fd9c1d 100644 --- a/src/libsync/accessmanager.h +++ b/src/libsync/accessmanager.h @@ -34,8 +34,6 @@ class OWNCLOUDSYNC_EXPORT AccessManager : public QNetworkAccessManager public: AccessManager(QObject *parent = 0); - void setRawCookie(const QByteArray &rawCookie, const QUrl &url); - protected: QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0) Q_DECL_OVERRIDE; }; From 189c1d3ddfc4f3c54f8a23f072f6b61b467c6d71 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 1 Apr 2020 10:45:45 +0200 Subject: [PATCH 3/8] Cookies: Do set cookies in DetermineAuthTypeJob too As we don't support cookie based authentication anymore we can provide cookies here. This fixes issues with loadbalancers access policy managers. --- src/libsync/networkjobs.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index 1a871896c4..4d885d2c6b 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -874,8 +874,6 @@ void DetermineAuthTypeJob::start() req.setAttribute(HttpCredentials::DontAddCredentialsAttribute, true); // Don't reuse previous auth credentials req.setAttribute(QNetworkRequest::AuthenticationReuseAttribute, QNetworkRequest::Manual); - // Don't send cookies, we can't determine the auth type if we're logged in - req.setAttribute(QNetworkRequest::CookieLoadControlAttribute, QNetworkRequest::Manual); auto propfind = _account->sendRequest("PROPFIND", _account->davUrl(), req); propfind->setTimeout(30 * 1000); From 2e85e4d06487b75a2fff8f30c44db29d31d9bcdf Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 30 Mar 2020 11:49:49 +0200 Subject: [PATCH 4/8] Mac Package: Update project file using the ide --- admin/osx/CMakeLists.txt | 4 +- admin/osx/macosx.pkgproj.cmake | 166 ++++++++++++++++++++++++++------- 2 files changed, 134 insertions(+), 36 deletions(-) diff --git a/admin/osx/CMakeLists.txt b/admin/osx/CMakeLists.txt index 5531223fb8..11a87734ed 100644 --- a/admin/osx/CMakeLists.txt +++ b/admin/osx/CMakeLists.txt @@ -6,9 +6,9 @@ # includes CMAKE_SOURCE_DIR or so. if (DEFINED MAC_INSTALLER_BACKGROUND_FILE ) - set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "1") + set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "true") else() - set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "0") + set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "false") endif() find_package(Qt5 5.6 COMPONENTS Core REQUIRED) diff --git a/admin/osx/macosx.pkgproj.cmake b/admin/osx/macosx.pkgproj.cmake index 0552e1c323..9a989a79d8 100644 --- a/admin/osx/macosx.pkgproj.cmake +++ b/admin/osx/macosx.pkgproj.cmake @@ -5,6 +5,10 @@ PACKAGES + MUST-CLOSE-APPLICATION-ITEMS + + MUST-CLOSE-APPLICATIONS + PACKAGE_FILES DEFAULT_INSTALL_LOCATION @@ -251,7 +255,7 @@ PATH_TYPE 0 PERMISSIONS - 493 + 1005 TYPE 1 UID @@ -353,6 +357,38 @@ UID 0 + + CHILDREN + + GID + 0 + PATH + Automator + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Extensions + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + GID 0 @@ -466,43 +502,65 @@ PAYLOAD_TYPE 0 + PRESERVE_EXTENDED_ATTRIBUTES + + SHOW_INVISIBLE + + SPLIT_FORKS + + TREAT_MISSING_FILES_AS_WARNING + VERSION - 2 + 5 PACKAGE_SCRIPTS - POSTINSTALL_PATH - - PATH - @CMAKE_CURRENT_BINARY_DIR@/post_install.sh - PATH_TYPE - 0 - - PREINSTALL_PATH - - PATH - @CMAKE_CURRENT_BINARY_DIR@/pre_install.sh - PATH_TYPE - 0 - - RESOURCES - - + POSTINSTALL_PATH + + PATH + @CMAKE_CURRENT_BINARY_DIR@/post_install.sh + PATH_TYPE + 0 + + PREINSTALL_PATH + + PATH + @CMAKE_CURRENT_BINARY_DIR@/pre_install.sh + PATH_TYPE + 0 + + RESOURCES + + PACKAGE_SETTINGS AUTHENTICATION 1 CONCLUSION_ACTION 0 + FOLLOW_SYMBOLIC_LINKS + IDENTIFIER @APPLICATION_REV_DOMAIN_INSTALLER@ + LOCATION + 0 NAME @APPLICATION_NAME_XML_ESCAPED@ OVERWRITE_PERMISSIONS + PAYLOAD_SIZE + -1 + REFERENCE_PATH + + RELOCATABLE + + USE_HFS+_COMPRESSION + VERSION @MIRALL_VERSION_FULL@ + TYPE + 0 UUID 7D7219B7-1897-48C3-8533-842BDEC46F71 @@ -532,6 +590,45 @@ ALIGNMENT 6 + APPAREANCES + + DARK_AQUA + + ALIGNMENT + 6 + BACKGROUND_PATH + + PATH + @MAC_INSTALLER_BACKGROUND_FILE@ + PATH_TYPE + 0 + + CUSTOM + + LAYOUT_DIRECTION + 0 + SCALING + 0 + + LIGHT_AQUA + + ALIGNMENT + 6 + BACKGROUND_PATH + + PATH + @MAC_INSTALLER_BACKGROUND_FILE@ + PATH_TYPE + 0 + + CUSTOM + + LAYOUT_DIRECTION + 0 + SCALING + 0 + + BACKGROUND_PATH PATH @@ -540,9 +637,13 @@ 0 CUSTOM - @MAC_INSTALLER_DO_CUSTOM_BACKGROUND@ + <@MAC_INSTALLER_DO_CUSTOM_BACKGROUND@/> + LAYOUT_DIRECTION + 0 SCALING 0 + SHARED_SETTINGS_FOR_ALL_APPAREANCES + INSTALLATION TYPE @@ -578,10 +679,8 @@ - INSTALLATION TYPE - 1 - MODE - 1 + MODE + 1 INSTALLATION_STEPS @@ -649,8 +748,6 @@ LICENSE - KEYWORDS - LOCALIZATIONS MODE @@ -683,10 +780,6 @@ LIST - POSTINSTALL_PATH - - PREINSTALL_PATH - RESOURCES ROOT_VOLUME_ONLY @@ -694,14 +787,15 @@ PROJECT_SETTINGS - ADVANCED_OPTIONS - + ADVANCED_OPTIONS + + BUILD_FORMAT 0 BUILD_PATH PATH - @CMAKE_INSTALL_PREFIX@/. + @CMAKE_INSTALL_PREFIX@/. PATH_TYPE 3 @@ -875,8 +969,12 @@ NAME @APPLICATION_NAME_XML_ESCAPED@ Installer + PAYLOAD_ONLY + REFERENCE_FOLDER_PATH - @CMAKE_INSTALL_DIR@ + + TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING + TYPE From 1c388f45bde5aba16618543cddf3885db5e0f683 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 30 Mar 2020 11:50:23 +0200 Subject: [PATCH 5/8] Mac Package: Disable installation to external drives --- admin/osx/macosx.pkgproj.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/osx/macosx.pkgproj.cmake b/admin/osx/macosx.pkgproj.cmake index 9a989a79d8..762df146e2 100644 --- a/admin/osx/macosx.pkgproj.cmake +++ b/admin/osx/macosx.pkgproj.cmake @@ -789,6 +789,8 @@ ADVANCED_OPTIONS + installer-script.domains:enable_localSystem + 1 BUILD_FORMAT 0 From f268bb706899ddba15ceb30aa0da9aadc0e795aa Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 30 Mar 2020 11:55:55 +0200 Subject: [PATCH 6/8] Mac Package: Restart client after update Issue: #3922 --- admin/osx/CMakeLists.txt | 8 ++++---- admin/osx/post_install.sh.cmake | 12 ++++++++++-- admin/osx/pre_install.sh.cmake | 10 +++++++--- changelog/unreleased/3922 | 5 +++++ 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 changelog/unreleased/3922 diff --git a/admin/osx/CMakeLists.txt b/admin/osx/CMakeLists.txt index 11a87734ed..720015c0dd 100644 --- a/admin/osx/CMakeLists.txt +++ b/admin/osx/CMakeLists.txt @@ -12,7 +12,7 @@ else() endif() find_package(Qt5 5.6 COMPONENTS Core REQUIRED) -configure_file(create_mac.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh) -configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj) -configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh) -configure_file(post_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/post_install.sh) +configure_file(create_mac.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh @ONLY) +configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj @ONLY) +configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh @ONLY) +configure_file(post_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/post_install.sh @ONLY) diff --git a/admin/osx/post_install.sh.cmake b/admin/osx/post_install.sh.cmake index 55d5e1c1d0..dbc14eb534 100644 --- a/admin/osx/post_install.sh.cmake +++ b/admin/osx/post_install.sh.cmake @@ -1,7 +1,9 @@ -#!/bin/sh +#!/bin/bash + +LOGGED_IN_USER_ID=$(id -u "${USER}") # Always enable the new 10.10 finder plugin if available -if [ -x "$(command -v pluginkit)" ]; then +if [[ -x "$(command -v pluginkit)" ]]; then # add it to DB. This happens automatically too but we try to push it a bit harder for issue #3463 pluginkit -a "/Applications/@APPLICATION_EXECUTABLE@.app/Contents/PlugIns/FinderSyncExt.appex/" # Since El Capitan we need to sleep #4650 @@ -10,4 +12,10 @@ if [ -x "$(command -v pluginkit)" ]; then pluginkit -e use -i @APPLICATION_REV_DOMAIN@.FinderSyncExt fi +if [[ -f "${INSTALLER_TEMP}/OC_RESTART_NEEDED" ]]; then + if [[ "${COMMAND_LINE_INSTALL}" = "" ]]; then + /bin/launchctl asuser "${LOGGED_IN_USER_ID}" /usr/bin/open -g "/Applications/@APPLICATION_EXECUTABLE@.app" + fi +fi + exit 0 diff --git a/admin/osx/pre_install.sh.cmake b/admin/osx/pre_install.sh.cmake index cd909e29ad..51809adc4c 100644 --- a/admin/osx/pre_install.sh.cmake +++ b/admin/osx/pre_install.sh.cmake @@ -1,6 +1,10 @@ -#!/bin/sh +#!/bin/bash -# kill the old version. see issue #2044 -killall @APPLICATION_EXECUTABLE@ +OC_INSTANCE=$(ps aux | grep "/Applications/@APPLICATION_EXECUTABLE@.app/Contents/MacOS/@APPLICATION_EXECUTABLE@") + +if [[ "${OC_INSTANCE}" != "" ]]; then + kill $(echo ${OC_INSTANCE} | awk '{print $2}') + touch $INSTALLER_TEMP/OC_RESTART_NEEDED +fi exit 0 diff --git a/changelog/unreleased/3922 b/changelog/unreleased/3922 new file mode 100644 index 0000000000..d42a244f7e --- /dev/null +++ b/changelog/unreleased/3922 @@ -0,0 +1,5 @@ +Change: Restart the client after an update + +We now start the client after an update, if the client was running before the update. + +https://github.com/owncloud/enterprise/issues/3922 From 3986a150dcf684d10845d70fa7467f2abbac29c8 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 1 Apr 2020 12:25:55 +0200 Subject: [PATCH 7/8] Fix change log entry --- changelog/unreleased/7774 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/7774 b/changelog/unreleased/7774 index 7aed3ef25c..041cf3772e 100644 --- a/changelog/unreleased/7774 +++ b/changelog/unreleased/7774 @@ -1,4 +1,4 @@ -Bugfix: On Windows the share dialog sometimes does not open as the top most window +Bugfix: On Windows the share dialog does not open as the top most window We now ensure that the our dialogs are correctly raised. From 7964e47a28411605930d81441400acdb30953c8c Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 1 Apr 2020 11:39:56 +0200 Subject: [PATCH 8/8] Test: Disable parallelism to ensure serial execution --- test/testsyncmove.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testsyncmove.cpp b/test/testsyncmove.cpp index 9476434fb8..b97d38e411 100644 --- a/test/testsyncmove.cpp +++ b/test/testsyncmove.cpp @@ -889,6 +889,9 @@ private slots: const QString src = "folder/folderA/file.txt"; const QString dest = "folder/folderB/file.txt"; FakeFolder fakeFolder{ FileInfo{ QString(), { FileInfo{ QStringLiteral("folder"), { FileInfo{ QStringLiteral("folderA"), { { QStringLiteral("file.txt"), 400 } } }, QStringLiteral("folderB") } } } } }; + auto syncOpts = fakeFolder.syncEngine().syncOptions(); + syncOpts._parallelNetworkJobs = 0; + fakeFolder.syncEngine().setSyncOptions(syncOpts); QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());