From 791b90b9898cc41869538f1dfc303588436682b7 Mon Sep 17 00:00:00 2001 From: B Stack Date: Sat, 15 Feb 2020 11:50:31 -0500 Subject: add upstream 10.20 It is worth noting that the send email feature is not present in the GPL release. --- Bugs.txt | 16 +- Changelog.txt | 22 +- FreeFileSync/Build/Resources/Icons.zip | Bin 391482 -> 389295 bytes FreeFileSync/Build/Resources/Languages.zip | Bin 506524 -> 522133 bytes FreeFileSync/Build/Resources/cacert.pem | 38 +- FreeFileSync/Source/Makefile | 1 + FreeFileSync/Source/RealTimeSync/application.cpp | 2 - FreeFileSync/Source/RealTimeSync/tray_menu.cpp | 4 +- FreeFileSync/Source/afs/abstract.cpp | 2 +- FreeFileSync/Source/afs/concrete.cpp | 4 + FreeFileSync/Source/afs/ftp.cpp | 115 ++--- FreeFileSync/Source/afs/ftp.h | 3 + FreeFileSync/Source/afs/gdrive.cpp | 618 ++++++++--------------- FreeFileSync/Source/afs/init_curl_libssh2.cpp | 2 +- FreeFileSync/Source/afs/sftp.cpp | 139 ++--- FreeFileSync/Source/afs/sftp.h | 20 +- FreeFileSync/Source/base/application.cpp | 20 +- FreeFileSync/Source/base/config.cpp | 141 ++++-- FreeFileSync/Source/base/config.h | 13 +- FreeFileSync/Source/base/db_file.cpp | 137 ++--- FreeFileSync/Source/base/dir_exist_async.h | 10 +- FreeFileSync/Source/base/dir_lock.cpp | 122 ++--- FreeFileSync/Source/base/file_hierarchy.cpp | 4 +- FreeFileSync/Source/base/file_hierarchy.h | 2 +- FreeFileSync/Source/base/icon_loader.h | 2 +- FreeFileSync/Source/base/log_file.cpp | 580 ++++++++++++++++----- FreeFileSync/Source/base/log_file.h | 20 +- FreeFileSync/Source/base/return_codes.h | 4 +- FreeFileSync/Source/base/status_handler.h | 4 +- FreeFileSync/Source/base/structures.cpp | 6 +- FreeFileSync/Source/base/structures.h | 41 +- FreeFileSync/Source/base/synchronization.cpp | 2 +- FreeFileSync/Source/base/versioning.cpp | 4 +- FreeFileSync/Source/ui/batch_config.cpp | 4 +- FreeFileSync/Source/ui/batch_status_handler.cpp | 150 +++--- FreeFileSync/Source/ui/batch_status_handler.h | 10 +- FreeFileSync/Source/ui/cfg_grid.cpp | 6 +- FreeFileSync/Source/ui/command_box.cpp | 12 +- FreeFileSync/Source/ui/command_box.h | 2 +- FreeFileSync/Source/ui/file_grid.cpp | 8 +- FreeFileSync/Source/ui/folder_history_box.cpp | 4 +- FreeFileSync/Source/ui/folder_history_box.h | 30 +- FreeFileSync/Source/ui/folder_pair.h | 46 +- FreeFileSync/Source/ui/folder_selector.cpp | 2 +- FreeFileSync/Source/ui/gui_generated.cpp | 154 ++++-- FreeFileSync/Source/ui/gui_generated.h | 25 +- FreeFileSync/Source/ui/gui_status_handler.cpp | 118 ++--- FreeFileSync/Source/ui/gui_status_handler.h | 14 +- FreeFileSync/Source/ui/main_dlg.cpp | 155 +++--- FreeFileSync/Source/ui/main_dlg.h | 4 +- FreeFileSync/Source/ui/progress_indicator.cpp | 60 ++- FreeFileSync/Source/ui/progress_indicator.h | 4 +- FreeFileSync/Source/ui/search_grid.cpp | 4 +- FreeFileSync/Source/ui/small_dlgs.cpp | 106 ++-- FreeFileSync/Source/ui/small_dlgs.h | 3 +- FreeFileSync/Source/ui/sync_cfg.cpp | 333 ++++++++---- FreeFileSync/Source/ui/sync_cfg.h | 15 +- FreeFileSync/Source/ui/version_check.cpp | 8 +- FreeFileSync/Source/version/version.h | 2 +- libcurl/curl_wrap.h | 162 ++++++ libcurl/rest.cpp | 185 +++++++ libcurl/rest.h | 52 ++ libssh2/libssh2_wrap.h | 231 +++++++++ wx+/image_resources.cpp | 16 +- wx+/image_tools.h | 12 + zen/error_log.h | 47 +- zen/http.cpp | 165 ++++-- zen/http.h | 13 +- zen/json.h | 32 +- zen/serialize.h | 18 +- zen/shell_execute.h | 48 +- zen/shutdown.cpp | 4 +- zen/string_tools.h | 23 +- zen/sys_error.h | 3 +- zen/system.cpp | 84 +++ zen/system.h | 33 ++ zen/zlib_wrap.cpp | 20 + zen/zlib_wrap.h | 12 +- zen/zstring.cpp | 4 +- 79 files changed, 2960 insertions(+), 1581 deletions(-) create mode 100644 libcurl/curl_wrap.h create mode 100644 libcurl/rest.cpp create mode 100644 libcurl/rest.h create mode 100644 libssh2/libssh2_wrap.h create mode 100644 zen/system.cpp create mode 100644 zen/system.h diff --git a/Bugs.txt b/Bugs.txt index ad75f52f..fe61dc97 100755 --- a/Bugs.txt +++ b/Bugs.txt @@ -1,6 +1,6 @@ When manually compiling FreeFileSync, you should also fix the following bugs in its library dependencies. FreeFileSync generally uses the latest library versions and works with upstream to get the bugs fixed -that affect FreeFileSync. Therefore it is not recommended to compile against older library versions than +that affect FreeFileSync. Therefore it is NOT RECOMMENDED TO COMPILE AGAINST OLDER library versions than the ones mentioned below. The remaining issues that are yet to be fixed are listed in the following: @@ -64,17 +64,11 @@ move the following constants from src/sftp.h to include/libssh2_sftp.h: #define MAX_SFTP_READ_SIZE 30000 __________________________________________________________________________________________________________ -src/comp.c -https://github.com/libssh2/libssh2/pull/418 +src/transport.c +https://github.com/libssh2/libssh2/pull/443 -_libssh2_comp_methods(LIBSSH2_SESSION* session) -{ -+ #undef compress - if (session->flag.compress) - return comp_methods; - else - return no_comp_methods; -} +- if (encrypted && compressed) ++ if (encrypted && compressed && session->local.comp_abstract) __________________________________________________________________________________________________________ src/openssl.cpp diff --git a/Changelog.txt b/Changelog.txt index c4b991e7..a4103889 100755 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,23 @@ +FreeFileSync 10.20 [2020-02-14] +------------------------------- +Send email notifications after sync +Generate log files in HTML format +Detect sync database consistency errors +Start log file with preview of first 50 errors/warnings +Mitigate lock file data corruption +Print Windows error codes in hexadecimal +Fixed missing MTP and network links in folder picker (Linux) +Display versioning and log folder path history +Display and log all config names for merged configurations +Run post-sync command synchronously and log exit code +Fixed crash on Bitvise SFTP servers with zlib delayed compression +Show actual time out used in failure message +Show detailed error message when failing to test sound files +Fixed timeout for long-running FTP uploads by sending keep-alives +Use Donation Edition on unlimited number of virtual machines +Ignore accidental clicks in empty space of configuration panel + + FreeFileSync 10.19 [2019-12-27] ------------------------------- Unified rendering of disabled grid layouts @@ -599,7 +619,7 @@ Run SFTP tasks directly on worker threads without helper thread overhead FreeFileSync 8.4 [2016-08-12] ----------------------------- Mark temporary copies created by %local_path% read-only -Fixed crash when accessing Bitvise SFTP Servers +Fixed crash when accessing Bitvise SFTP servers Support nanosecond-precision file time copying (Linux) Start maximized instead of in full screen mode (OS X) Fixed crash while setting privileges during shutdown diff --git a/FreeFileSync/Build/Resources/Icons.zip b/FreeFileSync/Build/Resources/Icons.zip index a02a0759..79a4dd7f 100644 Binary files a/FreeFileSync/Build/Resources/Icons.zip and b/FreeFileSync/Build/Resources/Icons.zip differ diff --git a/FreeFileSync/Build/Resources/Languages.zip b/FreeFileSync/Build/Resources/Languages.zip index a6c2362b..81e8e960 100644 Binary files a/FreeFileSync/Build/Resources/Languages.zip and b/FreeFileSync/Build/Resources/Languages.zip differ diff --git a/FreeFileSync/Build/Resources/cacert.pem b/FreeFileSync/Build/Resources/cacert.pem index edc5090c..651694e8 100755 --- a/FreeFileSync/Build/Resources/cacert.pem +++ b/FreeFileSync/Build/Resources/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Wed Oct 16 03:12:09 2019 GMT +## Certificate data from Mozilla as of: Wed Jan 1 04:12:10 2020 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +14,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.27. -## SHA256: c979c6f35714a0fedb17d9e5ba37adecbbc91a8faf4186b4e23d6f9ca44fd6cb +## SHA256: f3bdcd74612952da8476a9d4147f50b29ad0710b7dd95b4c8690500209986d70 ## @@ -3430,3 +3430,37 @@ hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB 60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq dBb9HxEGmpv0 -----END CERTIFICATE----- + +Entrust Root Certification Authority - G4 +========================================= +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAwgb4xCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu +bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1 +dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eSAtIEc0MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYT +AlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 +L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEc0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3D +umSXbcr3DbVZwbPLqGgZ2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV +3imz/f3ET+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j5pds +8ELl3FFLFUHtSUrJ3hCX1nbB76W1N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SUHHuk2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjA +JOgc47OlIQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk5F6G ++TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPT +kcpG2om3PVODLAgfi49T3f+sHw== +-----END CERTIFICATE----- diff --git a/FreeFileSync/Source/Makefile b/FreeFileSync/Source/Makefile index d3c1209a..8ee8115f 100755 --- a/FreeFileSync/Source/Makefile +++ b/FreeFileSync/Source/Makefile @@ -78,6 +78,7 @@ CPP_FILES+=ui/taskbar.cpp CPP_FILES+=ui/tray_icon.cpp CPP_FILES+=ui/triple_splitter.cpp CPP_FILES+=ui/version_check.cpp +CPP_FILES+=../../libcurl/rest.cpp CPP_FILES+=../../zen/recycler.cpp CPP_FILES+=../../zen/file_access.cpp CPP_FILES+=../../zen/file_io.cpp diff --git a/FreeFileSync/Source/RealTimeSync/application.cpp b/FreeFileSync/Source/RealTimeSync/application.cpp index db28c580..7f81883b 100644 --- a/FreeFileSync/Source/RealTimeSync/application.cpp +++ b/FreeFileSync/Source/RealTimeSync/application.cpp @@ -46,8 +46,6 @@ bool Application::OnInit() ::gtk_rc_parse((fff::getResourceDirPf() + "Gtk2Styles.rc").c_str()); //fix hang on Ubuntu 19.10 (see FFS's application.cpp) - if (::setenv("GIO_USE_VFS", "local", true /*overwrite*/) != 0) - std::cerr << utfTo(formatSystemError(L"setenv(GIO_USE_VFS)", errno)) << "\n"; g_vfs_get_default(); //returns unowned GVfs* #elif GTK_MAJOR_VERSION == 3 diff --git a/FreeFileSync/Source/RealTimeSync/tray_menu.cpp b/FreeFileSync/Source/RealTimeSync/tray_menu.cpp index 3b50e9c6..a4c1a91a 100644 --- a/FreeFileSync/Source/RealTimeSync/tray_menu.cpp +++ b/FreeFileSync/Source/RealTimeSync/tray_menu.cpp @@ -105,7 +105,7 @@ private: void OnErrorFlashIcon(wxEvent& event) { iconFlashStatusLast_ = !iconFlashStatusLast_; - setTrayIcon(iconFlashStatusLast_ ? trayBmp_ : greyScale(trayBmp_), _("Error")); + setTrayIcon(greyScaleIfDisabled(trayBmp_, iconFlashStatusLast_), _("Error")); } void setTrayIcon(const wxBitmap& bmp, const wxString& statusTxt) @@ -274,7 +274,7 @@ rts::AbortReason rts::runFolderMonitor(const XmlRealConfig& config, const wxStri auto cmdLineExp = fff::expandMacros(cmdLine); try { - shellExecute(cmdLineExp, ExecutionType::SYNC, config.hideConsoleWindow); //throw FileError + shellExecute(cmdLineExp, ExecutionType::sync, config.hideConsoleWindow); //throw FileError } catch (const FileError& e) { diff --git a/FreeFileSync/Source/afs/abstract.cpp b/FreeFileSync/Source/afs/abstract.cpp index 0b3c85d5..9454f68b 100644 --- a/FreeFileSync/Source/afs/abstract.cpp +++ b/FreeFileSync/Source/afs/abstract.cpp @@ -193,7 +193,7 @@ AFS::FileCopyResult AFS::copyFileTransactional(const AbstractPath& apSource, con if (transactionalCopy && !hasNativeTransactionalCopy(apTarget)) { - std::optional parentPath = AFS::getParentPath(apTarget); + const std::optional parentPath = AFS::getParentPath(apTarget); if (!parentPath) throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(AFS::getDisplayPath(apTarget))), L"Path is device root."); const Zstring fileName = AFS::getItemName(apTarget); diff --git a/FreeFileSync/Source/afs/concrete.cpp b/FreeFileSync/Source/afs/concrete.cpp index b792c350..700351dd 100644 --- a/FreeFileSync/Source/afs/concrete.cpp +++ b/FreeFileSync/Source/afs/concrete.cpp @@ -15,6 +15,8 @@ using namespace fff; void fff::initAfs(const AfsConfig& cfg) { + ftpInit(); + sftpInit(); googleDriveInit(appendSeparator(cfg.configDirPathPf) + Zstr("GoogleDrive"), appendSeparator(cfg.resourceDirPathPf) + Zstr("cacert.pem")); } @@ -23,6 +25,8 @@ void fff::initAfs(const AfsConfig& cfg) void fff::teardownAfs() { googleDriveTeardown(); + sftpTeardown(); + ftpTeardown(); } diff --git a/FreeFileSync/Source/afs/ftp.cpp b/FreeFileSync/Source/afs/ftp.cpp index 0380df48..e502936a 100644 --- a/FreeFileSync/Source/afs/ftp.cpp +++ b/FreeFileSync/Source/afs/ftp.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "libcurl/curl_wrap.h" //DON'T include directly! +#include //DON'T include directly! #include "init_curl_libssh2.h" #include "ftp_common.h" #include "abstract_impl.h" @@ -307,23 +307,9 @@ public: ::curl_easy_cleanup(easyHandle_); } - //const FtpLoginInfo& getSessionId() const { return sessionId_; } - - struct Option - { - template - Option(CURLoption o, T val) : option(o), value(static_cast(val)) { static_assert(sizeof(val) <= sizeof(value)); } - - template - Option(CURLoption o, T* val) : option(o), value(reinterpret_cast(val)) { static_assert(sizeof(val) <= sizeof(value)); } - - CURLoption option = CURLOPT_LASTENTRY; - uint64_t value = 0; - }; - //returns server response (header data) std::string perform(const AfsPath& afsPath, bool isDir, curl_ftpmethod pathMethod, - const std::vector