diff --git a/.drone.yml b/.drone.yml index 9410c1bb5..3df15e5f6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,11 +22,11 @@ steps: source /opt/qt57/bin/qt57-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -59,11 +59,11 @@ steps: source /opt/qt58/bin/qt58-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -96,11 +96,11 @@ steps: source /opt/qt59/bin/qt59-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -137,11 +137,11 @@ steps: source /opt/qt510/bin/qt510-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -178,11 +178,11 @@ steps: source /opt/qt511/bin/qt511-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -219,11 +219,11 @@ steps: source /opt/qt511/bin/qt511-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -237,7 +237,7 @@ name: qt-5.12 steps: - name: build and test - image: nextcloudci/client-5.12:client-5.12-2 + image: nextcloudci/client-5.12:client-5.12-3 commands: # Install QtKeyChain - /bin/bash -c " @@ -260,11 +260,11 @@ steps: source /opt/qt512/bin/qt512-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -278,7 +278,7 @@ name: qt-5.12-clang steps: - name: build and test - image: nextcloudci/client-5.12:client-5.12-2 + image: nextcloudci/client-5.12:client-5.12-3 commands: # Install QtKeyChain - /bin/bash -c " @@ -301,11 +301,11 @@ steps: source /opt/qt512/bin/qt512-env.sh && mkdir build && cd build && - cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 ../ && + cmake -D NO_SHIBBOLETH=1 -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=1 -DSANITIZE_ADDRESS=ON ../ && make && useradd -m -s /bin/bash test && chown -R test:test . && - su -c 'ctest --output-on-failure' test" + su -c 'ASAN_OPTIONS=detect_leaks=0 ctest --output-on-failure' test" trigger: branch: - master @@ -319,7 +319,7 @@ name: AppImage steps: - name: build - image: nextcloudci/client-5.12:client-5.12-2 + image: nextcloudci/client-5.12:client-5.12-3 commands: - /bin/bash -c "./admin/linux/build-appimage.sh" trigger: diff --git a/.tx/nextcloud.client-desktop/de_translation b/.tx/nextcloud.client-desktop/de_translation index e3d9ad406..09564e030 100644 --- a/.tx/nextcloud.client-desktop/de_translation +++ b/.tx/nextcloud.client-desktop/de_translation @@ -198,7 +198,7 @@ X-GNOME-Autostart-Delay=3 # Translations -Icon[de]=@APPLICATION_ICON_NAME@ -Name[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation -Comment[de]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation -GenericName[de]=Synchronisationsordner +Icon[de_DE]=@APPLICATION_ICON_NAME@ +Name[de_DE]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation +Comment[de_DE]=@APPLICATION_NAME@ Client zur Desktop-Synchronisation +GenericName[de_DE]=Synchronisationsordner diff --git a/CMakeLists.txt b/CMakeLists.txt index f8e92e250..c022f6f16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,12 @@ if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() +option(SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF) +if (SANITIZE_ADDRESS) + include(SanitizerFlags) + enable_sanitizer() +endif () + # Handle Translations, pick all client_* files from trans directory. file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts) set(TRANSLATIONS ${TRANS_FILES}) diff --git a/admin/linux/debian/debian.eoan/control b/admin/linux/debian/debian.eoan/control index 8b2bbd536..1429f8bce 100644 --- a/admin/linux/debian/debian.eoan/control +++ b/admin/linux/debian/debian.eoan/control @@ -10,6 +10,7 @@ Build-Depends: cmake, libkf5kio-dev, libcmocka-dev, libcloudproviders-dev, + libdbus-1-dev, libhttp-dav-perl, libinotify-dev [kfreebsd-any], libqt5svg5-dev, diff --git a/admin/linux/debian/debian.stable/control b/admin/linux/debian/debian.stable/control index 1be12ad38..793df959f 100644 --- a/admin/linux/debian/debian.stable/control +++ b/admin/linux/debian/debian.stable/control @@ -11,6 +11,7 @@ Build-Depends: cmake, kio-dev, libcmocka-dev, libcloudproviders-dev, + libdbus-1-dev, libhttp-dav-perl, libinotify-dev [kfreebsd-any], libqt5webkit5-dev, diff --git a/admin/linux/debian/debian/control b/admin/linux/debian/debian/control index 87fb0dfb2..6021ab8b7 100644 --- a/admin/linux/debian/debian/control +++ b/admin/linux/debian/debian/control @@ -11,6 +11,7 @@ Build-Depends: cmake, libkf5kio-dev, libcmocka-dev, libcloudproviders-dev, + libdbus-1-dev, libhttp-dav-perl, libinotify-dev [kfreebsd-any], libqt5svg5-dev, diff --git a/binary b/binary index 3425fab2c..09f12de31 160000 --- a/binary +++ b/binary @@ -1 +1 @@ -Subproject commit 3425fab2c66118ffae3e3b16751e636ca71ee450 +Subproject commit 09f12de3122ad1acf735d0e85b77bfba1cac2a29 diff --git a/cmake/modules/SanitizerFlags.cmake b/cmake/modules/SanitizerFlags.cmake new file mode 100644 index 000000000..9d5c9ebda --- /dev/null +++ b/cmake/modules/SanitizerFlags.cmake @@ -0,0 +1,17 @@ + +# Enable address sanitizer (gcc/clang only) +macro(ENABLE_SANITIZER) + + if (NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + message(FATAL_ERROR "Sanitizer supported only for gcc/clang") + endif() + + set(SANITIZER_FLAGS "-fsanitize=address -fsanitize=leak -g") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZER_FLAGS}") + + set(LINKER_FLAGS "-fsanitize=address,undefined -fuse-ld=gold") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}") + +endmacro() + diff --git a/src/3rdparty/libcrashreporter-qt b/src/3rdparty/libcrashreporter-qt index 7df66f72a..a4409c5c1 160000 --- a/src/3rdparty/libcrashreporter-qt +++ b/src/3rdparty/libcrashreporter-qt @@ -1 +1 @@ -Subproject commit 7df66f72aac595295dffcf4dc8a536822008c51d +Subproject commit a4409c5c1b39dc208518bd0f2868fc2894bdcb3f diff --git a/src/3rdparty/qtmacgoodies b/src/3rdparty/qtmacgoodies index ebc7ec6f6..b59d091b3 160000 --- a/src/3rdparty/qtmacgoodies +++ b/src/3rdparty/qtmacgoodies @@ -1 +1 @@ -Subproject commit ebc7ec6f681c0ae52c9443dbf63c4d1224bf3aec +Subproject commit b59d091b3e6b98e7219cf636f7d21fb267242c27 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 37cfd7325..9f854b006 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,12 +29,12 @@ if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") endif() -endif() -# Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU -# extension (C++11 §16.3/4 forbids them). Silence clang's warnings. -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") + # Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU + # extension (C++11 §16.3/4 forbids them). Silence clang's warnings. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") +endif() if(WIN32) # Enable DEP & ASLR diff --git a/src/csync/csync_exclude.cpp b/src/csync/csync_exclude.cpp index 2b7e65083..21f8380ef 100644 --- a/src/csync/csync_exclude.cpp +++ b/src/csync/csync_exclude.cpp @@ -288,7 +288,11 @@ void ExcludedFiles::addManualExclude(const QByteArray &expr) void ExcludedFiles::addManualExclude(const QByteArray &expr, const QByteArray &basePath) { +#if defined(Q_OS_WIN) + Q_ASSERT(basePath.size() >= 2 && basePath.at(1) == ':'); +#else Q_ASSERT(basePath.startsWith('/')); +#endif Q_ASSERT(basePath.endsWith('/')); auto key = basePath; diff --git a/test/testfolderwatcher.cpp b/test/testfolderwatcher.cpp index fdd97701d..f515a1d60 100644 --- a/test/testfolderwatcher.cpp +++ b/test/testfolderwatcher.cpp @@ -146,7 +146,7 @@ private slots: mkdir(_rootPath + "/a0/b"); mkdir(_rootPath + "/a0/b/c"); touch(file); - mv(_rootPath + "/a0 ", _rootPath + "/a"); + mv(_rootPath + "/a0", _rootPath + "/a"); QVERIFY(waitForPathChanged(_rootPath + "/a/b/c/empty.txt")); } diff --git a/translations/client_fi.ts b/translations/client_fi.ts index 0704a74b3..2d89c14c6 100644 --- a/translations/client_fi.ts +++ b/translations/client_fi.ts @@ -107,27 +107,27 @@ Browser Authentication - + Selaintunnistautuminen Please switch to your browser to proceed. - + Vaihda selaimeen jatkaaksesi. An error occurred while connecting. Please try again. - + Yhdistäessä tapahtui virhe. Yritä uudelleen. Re-open Browser - + Avaa selain uudelleen Copy link - + Kopioi linkki @@ -135,27 +135,27 @@ Browser Authentication - + Selaintunnistautuminen Please switch to your browser to proceed. - + Vaihda selaimeen jatkaaksesi. An error occurred while connecting. Please try again. - + Yhdistäessä tapahtui virhe. Yritä uudelleen. Re-open Browser - + Avaa selain uudelleen Copy link - + Kopioi linkki @@ -974,17 +974,17 @@ If this action was unintended you can restore the lost data now. Delete all files? - + Poistetaanko kaikki tiedostot? Delete all files - + Poista kaikki tiedostot Restore deleted files - + Palauta poistetut tiedostot @@ -1569,17 +1569,17 @@ Continuing the sync as normal will cause all your files to be overwritten by an Add - + Lisää Remove - + Poista Remove all - + Poista kaikki @@ -1591,7 +1591,7 @@ Items where deletion is allowed will be deleted if they prevent a directory from Could not open file - + Tiedoston avaaminen ei onnistunut @@ -2777,7 +2777,7 @@ Osoitteen käyttäminen ei ole suositeltavaa. Add another link - + Lisää toinen linkki @@ -2945,12 +2945,12 @@ Osoitteen käyttäminen ei ole suositeltavaa. Copy public link - + Kopioi julkinen linkki Copy internal link - + Kopioi sisäinen linkki @@ -3060,7 +3060,7 @@ Osoitteen käyttäminen ei ole suositeltavaa. Server version: %1 - + Palvelimen versio: %1 @@ -3075,7 +3075,7 @@ Osoitteen käyttäminen ei ole suositeltavaa. The connection is not secure - + Tämä yhteys ei ole turvallinen @@ -3140,12 +3140,12 @@ Osoitteen käyttäminen ei ole suositeltavaa. Fingerprint (SHA-256): <tt>%1</tt> - + Sormenjälki (SHA-256): <tt>%1</tt> Fingerprint (SHA-512): <tt>%1</tt> - + Sormenjälki (SHA-512): <tt>%1</tt> @@ -3806,7 +3806,7 @@ Osoitteen käyttäminen ei ole suositeltavaa. Copy link - + Kopioi linkki diff --git a/translations/client_ru.ts b/translations/client_ru.ts index 192546882..b526934af 100644 --- a/translations/client_ru.ts +++ b/translations/client_ru.ts @@ -107,12 +107,12 @@ Browser Authentication - + Аутентификация с использованием браузера Please switch to your browser to proceed. - Чтобы продолжить, перейдите в ваш браузер. + Чтобы продолжить, перейдите в браузер. @@ -135,7 +135,7 @@ Browser Authentication - + Аутентификация с использованием браузера @@ -145,12 +145,12 @@ An error occurred while connecting. Please try again. - + Ошибка во время установления соединения, попробуйте ещё раз. Re-open Browser - + Повторно открыть браузер @@ -313,7 +313,7 @@ Edit Ignored Files - + Список исключений синхронизации… @@ -579,7 +579,7 @@ Files from the ignore list as well as symbolic links are not synced. This includes: - + Из синхронизации исключены символьные ссылки и следующие файлы: @@ -760,25 +760,25 @@ Error returned from the server: <em>%1</em> - + Сервер сообщил об ошибке: <em>%1</em> There was an error accessing the 'token' endpoint: <br><em>%1</em> - + При доступе к конечной точке токена произошла ошибка: <br><em>%1</em> Could not parse the JSON returned from the server: <br><em>%1</em> - + Не удалось разобрать ответ сервера в формате JSON: <br><em>%1</em> The reply from the server did not contain all expected fields - + В ответе сервера содержатся не все ожидаемые поля @@ -786,17 +786,17 @@ Connect to %1 - + Подключение к %1 Login in your browser (Login Flow v2) - + Выполнить вход в браузере (процедура входа версии 2) Unable to open the Browser, please copy the link to your Browser. - + Не удалось открыть браузер, скопируйте ссылку и перейдите по ней в своём браузере. @@ -804,7 +804,7 @@ Unable to open the Browser, please copy the link to your Browser. - + Не удалось открыть браузер, скопируйте ссылку и перейдите по ней в своём браузере. diff --git a/translations/client_sl.ts b/translations/client_sl.ts index b3a2c70af..6e23db0f2 100644 --- a/translations/client_sl.ts +++ b/translations/client_sl.ts @@ -2922,7 +2922,7 @@ Uporaba ni priporočljiva. Share options - + Možnosti souporabe diff --git a/translations/client_tr.ts b/translations/client_tr.ts index e36423099..b6c58da2e 100644 --- a/translations/client_tr.ts +++ b/translations/client_tr.ts @@ -579,7 +579,7 @@ Files from the ignore list as well as symbolic links are not synced. This includes: - + Yok sayma listesindeki dosyalar ve sembolik bağlantılar eşitlenmez. Şunlar bulunur: