From ce32889b3a42670bfbc3bbb87a689ae79e889e68 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 5 Jul 2020 00:47:33 +0100 Subject: [PATCH] Label servers that can cause data loss as dangerous Previous wording was incorrect as we were not stopping connections to the servers in question and within a modern software development environment is inappropriate and offensive. --- CHANGES | 2 +- source/common/CMakeLists.txt | 4 ++-- source/common/{svrblist.cpp => svrdlist.cpp} | 22 ++++++++++---------- source/common/{svrblist.h => svrdlist.h} | 8 +++---- source/frmEditAccount.cpp | 5 +++-- source/frmEditAccount.h | 1 - source/frmNewAccount.cpp | 6 +++--- source/tests/xestiaab_common.h | 10 ++++----- 8 files changed, 29 insertions(+), 29 deletions(-) rename source/common/{svrblist.cpp => svrdlist.cpp} (60%) rename source/common/{svrblist.h => svrdlist.h} (81%) diff --git a/CHANGES b/CHANGES index d26b7bd..308b802 100644 --- a/CHANGES +++ b/CHANGES @@ -144,7 +144,7 @@ Version 0.12 ============ 12 April 2016 -- Added check to see if a server is on the blacklist and to display a +- Added check to see if a server is on the dangerous list and to display a dialog confirming that data loss could happen if that server is used. - Added support for OS X. Support begins from OS X 10.11.4. Use of XAB on OS X before this version is unsupported. diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 5cb4a7f..552d13b 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -23,8 +23,8 @@ set(FILE_LIST base64.cpp preferences.h sslcertstructs.h structs.h - svrblist.cpp - svrblist.h + svrdlist.cpp + svrdlist.h textprocessing.cpp textprocessing.h timers.cpp diff --git a/source/common/svrblist.cpp b/source/common/svrdlist.cpp similarity index 60% rename from source/common/svrblist.cpp rename to source/common/svrdlist.cpp index 9894b21..997c9c1 100644 --- a/source/common/svrblist.cpp +++ b/source/common/svrdlist.cpp @@ -1,4 +1,4 @@ -// svrblist.cpp - Server Blacklist subroutines. +// svrdlist.cpp - Server Dangerous List subroutines. // // (c) 2012-2015 Xestia Software Development. // @@ -19,24 +19,24 @@ #include #include -bool CheckBlacklist(wxString ServerAddress){ +bool CheckDangerousList(wxString serverAddress){ - // Check if the server address is on the blacklist. + // Check if the server address is on the dangerous list. - wxString ServerBlacklist = "google.com"; - wxString BListHostname; + wxString dangerousServerList = "google.com"; + wxString dangerousListHostname; - wxStringTokenizer ServerBlacklistTkz(ServerBlacklist, wxT("|")); + wxStringTokenizer dangerousServerTokens(dangerousServerList, wxT("|")); - while(ServerBlacklistTkz.HasMoreTokens()){ + while(dangerousServerTokens.HasMoreTokens()){ - BListHostname = ServerBlacklistTkz.GetNextToken(); - if (BListHostname == ServerAddress){ - return TRUE; + dangerousListHostname = dangerousServerTokens.GetNextToken(); + if (dangerousListHostname == serverAddress){ + return true; } } - return FALSE; + return false; } \ No newline at end of file diff --git a/source/common/svrblist.h b/source/common/svrdlist.h similarity index 81% rename from source/common/svrblist.h rename to source/common/svrdlist.h index c2e7b3d..4781b05 100644 --- a/source/common/svrblist.h +++ b/source/common/svrdlist.h @@ -1,4 +1,4 @@ -// svrblist.h - Server Blacklist subroutines header. +// svrdlist.h - Server Dangerous List subroutines header. // // (c) 2012-2015 Xestia Software Development. // @@ -18,9 +18,9 @@ #include -#ifndef COMMON_SVRBLIST_H -#define COMMON_SVRBLIST_H +#ifndef COMMON_SVRDLIST_H +#define COMMON_SVRDLIST_H -bool CheckBlacklist(wxString ServerAddress); +bool CheckDangerousList(wxString serverAddress); #endif \ No newline at end of file diff --git a/source/frmEditAccount.cpp b/source/frmEditAccount.cpp index 67df523..920f526 100644 --- a/source/frmEditAccount.cpp +++ b/source/frmEditAccount.cpp @@ -17,6 +17,7 @@ // with Xestia Address Book. If not, see #include "frmEditAccount.h" +#include "common/svrdlist.h" frmEditAccount::frmEditAccount( wxWindow* parent ) : @@ -274,10 +275,10 @@ void frmEditAccount::LoadSettings( wxString AccNameIn ){ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) { - // Check if server address matches against the blacklist. + // Check if server address matches against the dangerous list. // Bring up warning message if it does. - if (CheckBlacklist(txtAddress->GetValue())){ + if (CheckDangerousList(txtAddress->GetValue())){ int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this); diff --git a/source/frmEditAccount.h b/source/frmEditAccount.h index a151528..4175721 100644 --- a/source/frmEditAccount.h +++ b/source/frmEditAccount.h @@ -27,7 +27,6 @@ Subclass of frmEditAccountADT, which is generated by wxFormBuilder. #include "AppXestiaAddrBk.h" #include #include "frmInvalidSSLCertificate.h" -#include "common/svrblist.h" #include "connobject/ConnectionObject.h" #if defined(__WIN32__) diff --git a/source/frmNewAccount.cpp b/source/frmNewAccount.cpp index b6a6c2e..9d0873e 100644 --- a/source/frmNewAccount.cpp +++ b/source/frmNewAccount.cpp @@ -28,7 +28,7 @@ #endif #include "common/dirs.h" -#include "common/svrblist.h" +#include "common/svrdlist.h" #include "frmInvalidSSLCertificate.h" DEFINE_EVENT_TYPE(UPDATERESULTS); @@ -140,10 +140,10 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - // Check if server address matches against the blacklist. + // Check if server address matches against the dangerous list. // Bring up warning message if it does. - if (CheckBlacklist(txtServerAddress->GetValue())){ + if (CheckDangerousList(txtServerAddress->GetValue())){ int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this); diff --git a/source/tests/xestiaab_common.h b/source/tests/xestiaab_common.h index ca9b727..c870765 100644 --- a/source/tests/xestiaab_common.h +++ b/source/tests/xestiaab_common.h @@ -20,7 +20,7 @@ #include "../common/dirs.h" #include "../common/filename.h" #include "../common/mime.h" -#include "../common/svrblist.h" +#include "../common/svrdlist.h" #include "../common/textprocessing.h" static wxString AccountInput1 = "Example1"; @@ -316,10 +316,10 @@ TEST(CommonFunctions, GivenTwoFilesWhenGetMIMEIsCalledThenBothFilesMIMETypesAreG } -TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCorrectStatus) +TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckDangerousListIsCalledThenReturnsCorrectStatus) { - // Test that the blacklist is actually working. + // Test that the dangerous list is actually working. // Given @@ -327,7 +327,7 @@ TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCo // When - domainStatus = CheckBlacklist("example.com"); + domainStatus = CheckDangerousList("example.com"); // Then @@ -336,7 +336,7 @@ TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCo // When domainStatus = false; - domainStatus = CheckBlacklist("google.com"); + domainStatus = CheckDangerousList("google.com"); // Then -- 2.39.5