From d07e341d7e5e9eda0b4c69948ceb54ad44c473a6 Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Fri, 19 May 2023 10:32:41 +0300 Subject: [PATCH] Fixed segfaults of contacts reading (non Yandex) in evolution --- ...dded-yandex-backend-support-prebuild.patch | 136 +----------------- 1 file changed, 2 insertions(+), 134 deletions(-) diff --git a/SOURCES/0001-Added-yandex-backend-support-prebuild.patch b/SOURCES/0001-Added-yandex-backend-support-prebuild.patch index fc20a4a..67ada2a 100644 --- a/SOURCES/0001-Added-yandex-backend-support-prebuild.patch +++ b/SOURCES/0001-Added-yandex-backend-support-prebuild.patch @@ -1,4 +1,4 @@ -From ee73290b8ce8d9f3b1b42dc4ddc8a3c8d649778d Mon Sep 17 00:00:00 2001 +From 1c142459975a8703b6a5771f576a1e3736360954 Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Mon, 15 May 2023 19:07:27 +0300 Subject: [PATCH] Added yandex backend support(prebuild) @@ -10,12 +10,6 @@ Subject: [PATCH] Added yandex backend support(prebuild) config.h.in | 6 + ...gnome.evolution-data-server.gschema.xml.in | 10 + po/POTFILES.in | 3 + - .../backends/google/e-book-backend-google.c | 1 + - .../backends/google/e-book-google-utils.c | 2 +- - src/addressbook/libebook-contacts/e-contact.c | 10 +- - src/addressbook/libebook-contacts/e-contact.h | 7 + - src/addressbook/libebook-contacts/e-vcard.h | 1 + - .../libedata-book/e-book-backend-sexp.c | 11 + src/camel/CMakeLists.txt | 2 + src/camel/camel-autocleanups.h | 1 + src/camel/camel-sasl-xoauth2-yandex.c | 44 ++ @@ -36,7 +30,7 @@ Subject: [PATCH] Added yandex backend support(prebuild) .../module-gnome-online-accounts.c | 3 + src/modules/yandex-backend/CMakeLists.txt | 23 + .../yandex-backend/module-yandex-backend.c | 727 ++++++++++++++++++ - 32 files changed, 1259 insertions(+), 5 deletions(-) + 26 files changed, 1229 insertions(+), 3 deletions(-) create mode 100644 src/camel/camel-sasl-xoauth2-yandex.c create mode 100644 src/camel/camel-sasl-xoauth2-yandex.h create mode 100644 src/libedataserver/e-oauth2-service-yandex.c @@ -154,132 +148,6 @@ index 9a25ab5..10dfcf8 100644 src/services/evolution-addressbook-factory/evolution-addressbook-factory.c src/services/evolution-alarm-notify/e-alarm-notify.c src/services/evolution-calendar-factory/evolution-calendar-factory.c -diff --git a/src/addressbook/backends/google/e-book-backend-google.c b/src/addressbook/backends/google/e-book-backend-google.c -index 4597169..043f174 100644 ---- a/src/addressbook/backends/google/e-book-backend-google.c -+++ b/src/addressbook/backends/google/e-book-backend-google.c -@@ -1159,6 +1159,7 @@ ebb_google_get_backend_property (EBookBackend *book_backend, - e_contact_field_name (E_CONTACT_IM_AIM), - e_contact_field_name (E_CONTACT_IM_JABBER), - e_contact_field_name (E_CONTACT_IM_YAHOO), -+ e_contact_field_name (E_CONTACT_IM_YANDEX), - e_contact_field_name (E_CONTACT_IM_MSN), - e_contact_field_name (E_CONTACT_IM_ICQ), - e_contact_field_name (E_CONTACT_IM_SKYPE), -diff --git a/src/addressbook/backends/google/e-book-google-utils.c b/src/addressbook/backends/google/e-book-google-utils.c -index 3b14a4e..ed70a4b 100644 ---- a/src/addressbook/backends/google/e-book-google-utils.c -+++ b/src/addressbook/backends/google/e-book-google-utils.c -@@ -1095,7 +1095,7 @@ static gboolean - is_known_google_im_protocol (const gchar *protocol) - { - const gchar *known_protocols[] = { -- "AIM", "MSN", "YAHOO", "SKYPE", "QQ", -+ "AIM", "MSN", "YAHOO", "YANDEX", "SKYPE", "QQ", - "GOOGLE-TALK", "ICQ", "JABBER" - }; - guint i; -diff --git a/src/addressbook/libebook-contacts/e-contact.c b/src/addressbook/libebook-contacts/e-contact.c -index 54f14fd..b0f1534 100644 ---- a/src/addressbook/libebook-contacts/e-contact.c -+++ b/src/addressbook/libebook-contacts/e-contact.c -@@ -75,7 +75,8 @@ static AttrTypeValue glob_attr_type_values[] = { - { EVC_X_JABBER, "WORK;HOME" }, - { EVC_X_MSN, "WORK;HOME" }, - { EVC_X_SKYPE, "WORK;HOME" }, -- { EVC_X_YAHOO, "WORK;HOME" } -+ { EVC_X_YAHOO, "WORK;HOME" }, -+ { EVC_X_YANDEX, "WORK;HOME" } - }; - - #define E_CONTACT_FIELD_TYPE_STRING 0x00000001 /* used for simple single valued attributes */ -@@ -249,6 +250,12 @@ static const EContactFieldInfo field_info[] = { - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YAHOO_WORK_1, EVC_X_YAHOO, "im_yahoo_work_1", N_("Yahoo! Work Screen Name 1"), FALSE, "WORK", 0), - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YAHOO_WORK_2, EVC_X_YAHOO, "im_yahoo_work_2", N_("Yahoo! Work Screen Name 2"), FALSE, "WORK", 1), - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YAHOO_WORK_3, EVC_X_YAHOO, "im_yahoo_work_3", N_("Yahoo! Work Screen Name 3"), FALSE, "WORK", 2), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_HOME_1, EVC_X_YANDEX, "im_yandex_home_1", N_("Yandex Home Screen Name 1"), FALSE, "HOME", 0), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_HOME_2, EVC_X_YANDEX, "im_yandex_home_2", N_("Yandex Home Screen Name 2"), FALSE, "HOME", 1), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_HOME_3, EVC_X_YANDEX, "im_yandex_home_3", N_("Yandex Home Screen Name 3"), FALSE, "HOME", 2), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_WORK_1, EVC_X_YANDEX, "im_yandex_work_1", N_("Yandex Work Screen Name 1"), FALSE, "WORK", 0), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_WORK_2, EVC_X_YANDEX, "im_yandex_work_2", N_("Yandex Work Screen Name 2"), FALSE, "WORK", 1), -+ ATTR_TYPE_STR_FIELD (E_CONTACT_IM_YANDEX_WORK_3, EVC_X_YANDEX, "im_yandex_work_3", N_("Yandex Work Screen Name 3"), FALSE, "WORK", 2), - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_MSN_HOME_1, EVC_X_MSN, "im_msn_home_1", N_("MSN Home Screen Name 1"), FALSE, "HOME", 0), - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_MSN_HOME_2, EVC_X_MSN, "im_msn_home_2", N_("MSN Home Screen Name 2"), FALSE, "HOME", 1), - ATTR_TYPE_STR_FIELD (E_CONTACT_IM_MSN_HOME_3, EVC_X_MSN, "im_msn_home_3", N_("MSN Home Screen Name 3"), FALSE, "HOME", 2), -@@ -292,6 +299,7 @@ static const EContactFieldInfo field_info[] = { - MULTI_LIST_FIELD (E_CONTACT_IM_GROUPWISE, EVC_X_GROUPWISE, "im_groupwise", N_("GroupWise ID List"), FALSE), - MULTI_LIST_FIELD (E_CONTACT_IM_JABBER, EVC_X_JABBER, "im_jabber", N_("Jabber ID List"), FALSE), - MULTI_LIST_FIELD (E_CONTACT_IM_YAHOO, EVC_X_YAHOO, "im_yahoo", N_("Yahoo! Screen Name List"), FALSE), -+ MULTI_LIST_FIELD (E_CONTACT_IM_YANDEX, EVC_X_YANDEX, "im_yandex", N_("Yandex Screen Name List"), FALSE), - MULTI_LIST_FIELD (E_CONTACT_IM_MSN, EVC_X_MSN, "im_msn", N_("MSN Screen Name List"), FALSE), - MULTI_LIST_FIELD (E_CONTACT_IM_ICQ, EVC_X_ICQ, "im_icq", N_("ICQ ID List"), FALSE), - -diff --git a/src/addressbook/libebook-contacts/e-contact.h b/src/addressbook/libebook-contacts/e-contact.h -index 3f1e084..b5d9ef5 100644 ---- a/src/addressbook/libebook-contacts/e-contact.h -+++ b/src/addressbook/libebook-contacts/e-contact.h -@@ -159,6 +159,12 @@ typedef enum { - E_CONTACT_IM_YAHOO_WORK_1, /* Synthetic string field */ - E_CONTACT_IM_YAHOO_WORK_2, /* Synthetic string field */ - E_CONTACT_IM_YAHOO_WORK_3, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_HOME_1, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_HOME_2, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_HOME_3, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_WORK_1, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_WORK_2, /* Synthetic string field */ -+ E_CONTACT_IM_YANDEX_WORK_3, /* Synthetic string field */ - E_CONTACT_IM_MSN_HOME_1, /* Synthetic string field */ - E_CONTACT_IM_MSN_HOME_2, /* Synthetic string field */ - E_CONTACT_IM_MSN_HOME_3, /* Synthetic string field */ -@@ -198,6 +204,7 @@ typedef enum { - E_CONTACT_IM_GROUPWISE, /* Multi-valued */ - E_CONTACT_IM_JABBER, /* Multi-valued */ - E_CONTACT_IM_YAHOO, /* Multi-valued */ -+ E_CONTACT_IM_YANDEX, /* Multi-valued */ - E_CONTACT_IM_MSN, /* Multi-valued */ - E_CONTACT_IM_ICQ, /* Multi-valued */ - -diff --git a/src/addressbook/libebook-contacts/e-vcard.h b/src/addressbook/libebook-contacts/e-vcard.h -index 9efcb3d..9a31ad7 100644 ---- a/src/addressbook/libebook-contacts/e-vcard.h -+++ b/src/addressbook/libebook-contacts/e-vcard.h -@@ -135,6 +135,7 @@ G_BEGIN_DECLS - #define EVC_X_VIDEO_URL "X-EVOLUTION-VIDEO-URL" - #define EVC_X_WANTS_HTML "X-MOZILLA-HTML" - #define EVC_X_YAHOO "X-YAHOO" -+#define EVC_X_YANDEX "X-YANDEX" - - /** - * EVC_X_BOOK_UID: -diff --git a/src/addressbook/libedata-book/e-book-backend-sexp.c b/src/addressbook/libedata-book/e-book-backend-sexp.c -index 5f971cf..9977311 100644 ---- a/src/addressbook/libedata-book/e-book-backend-sexp.c -+++ b/src/addressbook/libedata-book/e-book-backend-sexp.c -@@ -127,6 +127,16 @@ compare_im_yahoo (EContact *contact, - return compare_im (contact, str, region, compare, E_CONTACT_IM_YAHOO); - } - -+static gboolean -+compare_im_yandex (EContact *contact, -+ const gchar *str, -+ const gchar *region, -+ CompareFunc compare) -+{ -+ return compare_im (contact, str, region, compare, E_CONTACT_IM_YANDEX); -+} -+ -+ - static gboolean - compare_im_gadugadu (EContact *contact, - const gchar *str, -@@ -384,6 +394,7 @@ static struct prop_info { - LIST_PROP ( "im_icq", compare_im_icq ), - LIST_PROP ( "im_jabber", compare_im_jabber ), - LIST_PROP ( "im_yahoo", compare_im_yahoo ), -+ LIST_PROP ( "im_yandex", compare_im_yandex ), - LIST_PROP ( "im_gadugadu", compare_im_gadugadu ), - LIST_PROP ( "im_groupwise", compare_im_groupwise ), - LIST_PROP ( "email", compare_email ), diff --git a/src/camel/CMakeLists.txt b/src/camel/CMakeLists.txt index 2ba609b..26b2033 100644 --- a/src/camel/CMakeLists.txt