From df719416ced804b0e45ac15264fbda934571471d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Apr 20 2016 21:11:50 +0000 Subject: Add patch for RH bug #1327072 (NTLM auth failure with latest samba) --- diff --git a/evolution-ews-3.16.5-ntlm-auth-test-failure.patch b/evolution-ews-3.16.5-ntlm-auth-test-failure.patch new file mode 100644 index 0000000..ed596db --- /dev/null +++ b/evolution-ews-3.16.5-ntlm-auth-test-failure.patch @@ -0,0 +1,144 @@ +diff -up evolution-ews-3.16.5/src/addressbook/e-book-backend-ews.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/addressbook/e-book-backend-ews.c +--- evolution-ews-3.16.5/src/addressbook/e-book-backend-ews.c.ntlm-auth-test-failure 2015-07-27 15:25:52.000000000 +0200 ++++ evolution-ews-3.16.5/src/addressbook/e-book-backend-ews.c 2016-04-20 23:00:51.234540255 +0200 +@@ -4166,6 +4166,13 @@ e_book_backend_ews_authenticate_sync (EB + } else { + ews_backend->priv->is_writable = FALSE; + e_backend_set_online (backend, FALSE); ++ ++ if (e_ews_connection_utils_get_without_password (ews_settings) && ++ result == E_SOURCE_AUTHENTICATION_REJECTED && ++ !e_named_parameters_exists (credentials, E_SOURCE_CREDENTIAL_PASSWORD)) { ++ e_ews_connection_utils_force_off_ntlm_auth_check (); ++ result = E_SOURCE_AUTHENTICATION_REQUIRED; ++ } + } + + e_book_backend_set_writable (E_BOOK_BACKEND (backend), ews_backend->priv->is_writable); +diff -up evolution-ews-3.16.5/src/calendar/e-cal-backend-ews.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/calendar/e-cal-backend-ews.c +--- evolution-ews-3.16.5/src/calendar/e-cal-backend-ews.c.ntlm-auth-test-failure 2015-03-23 08:28:34.000000000 +0100 ++++ evolution-ews-3.16.5/src/calendar/e-cal-backend-ews.c 2016-04-20 23:00:51.234540255 +0200 +@@ -4341,6 +4341,11 @@ e_cal_backend_ews_authenticate_sync (EBa + + ews_start_sync (cal_backend); + cbews_listen_notifications_cb (cal_backend, NULL, ews_settings); ++ } else if (e_ews_connection_utils_get_without_password (ews_settings) && ++ result == E_SOURCE_AUTHENTICATION_REJECTED && ++ !e_named_parameters_exists (credentials, E_SOURCE_CREDENTIAL_PASSWORD)) { ++ e_ews_connection_utils_force_off_ntlm_auth_check (); ++ result = E_SOURCE_AUTHENTICATION_REQUIRED; + } + + g_object_unref (connection); +diff -up evolution-ews-3.16.5/src/collection/e-ews-backend.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/collection/e-ews-backend.c +--- evolution-ews-3.16.5/src/collection/e-ews-backend.c.ntlm-auth-test-failure 2015-06-30 12:41:43.000000000 +0200 ++++ evolution-ews-3.16.5/src/collection/e-ews-backend.c 2016-04-20 23:00:51.234540255 +0200 +@@ -1044,6 +1044,11 @@ ews_backend_authenticate_sync (EBackend + e_collection_backend_authenticate_children (E_COLLECTION_BACKEND (backend), credentials); + + e_ews_backend_sync_folders (ews_backend, NULL, ews_backend_folders_synced_cb, NULL); ++ } else if (e_ews_connection_utils_get_without_password (ews_settings) && ++ result == E_SOURCE_AUTHENTICATION_REJECTED && ++ !e_named_parameters_exists (credentials, E_SOURCE_CREDENTIAL_PASSWORD)) { ++ e_ews_connection_utils_force_off_ntlm_auth_check (); ++ result = E_SOURCE_AUTHENTICATION_REQUIRED; + } + + return result; +diff -up evolution-ews-3.16.5/src/configuration/e-ews-config-utils.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/configuration/e-ews-config-utils.c +--- evolution-ews-3.16.5/src/configuration/e-ews-config-utils.c.ntlm-auth-test-failure 2015-06-17 18:07:41.000000000 +0200 ++++ evolution-ews-3.16.5/src/configuration/e-ews-config-utils.c 2016-04-20 23:00:51.235540255 +0200 +@@ -383,12 +383,18 @@ e_ews_config_utils_open_connection_for ( + + if (result != E_SOURCE_AUTHENTICATION_ACCEPTED) { + g_clear_object (&conn); +- break; ++ if (result != E_SOURCE_AUTHENTICATION_REJECTED || local_error) ++ break; + } +- } else { ++ } ++ ++ if (!conn) { + EShell *shell; + TryCredentialsData data; + ++ e_ews_connection_utils_force_off_ntlm_auth_check (); ++ g_clear_error (&local_error); ++ + shell = e_shell_get_default (); + + data.ews_settings = g_object_ref (ews_settings); +diff -up evolution-ews-3.16.5/src/configuration/e-mail-config-ews-autodiscover.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/configuration/e-mail-config-ews-autodiscover.c +--- evolution-ews-3.16.5/src/configuration/e-mail-config-ews-autodiscover.c.ntlm-auth-test-failure 2015-03-23 08:28:34.000000000 +0100 ++++ evolution-ews-3.16.5/src/configuration/e-mail-config-ews-autodiscover.c 2016-04-20 23:00:51.235540255 +0200 +@@ -169,13 +169,21 @@ mail_config_ews_autodiscover_run_thread + gboolean success = FALSE; + + if (!g_cancellable_set_error_if_cancelled (cancellable, &local_error) && !local_error) { +- if (e_ews_connection_utils_get_without_password (async_context->ews_settings)) { ++ gboolean without_password; ++ ++ without_password = e_ews_connection_utils_get_without_password (async_context->ews_settings); ++ if (without_password) { + success = e_ews_autodiscover_ws_url_sync ( + async_context->ews_settings, async_context->email_address, "", + cancellable, &local_error); +- } else { ++ } ++ ++ if (!without_password || g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_UNAUTHORIZED)) { + EShell *shell; + ++ e_ews_connection_utils_force_off_ntlm_auth_check (); ++ g_clear_error (&local_error); ++ + shell = e_shell_get_default (); + + success = e_credentials_prompter_loop_prompt_sync (e_shell_get_credentials_prompter (shell), +diff -up evolution-ews-3.16.5/src/server/e-ews-connection-utils.c.ntlm-auth-test-failure evolution-ews-3.16.5/src/server/e-ews-connection-utils.c +--- evolution-ews-3.16.5/src/server/e-ews-connection-utils.c.ntlm-auth-test-failure 2014-08-11 09:12:45.000000000 +0200 ++++ evolution-ews-3.16.5/src/server/e-ews-connection-utils.c 2016-04-20 23:00:51.235540255 +0200 +@@ -67,6 +67,8 @@ e_ews_connection_utils_check_element (co + return TRUE; + } + ++static gboolean force_off_ntlm_auth_check = FALSE; ++ + static gboolean + ews_connect_check_ntlm_available (void) + { +@@ -80,6 +82,9 @@ ews_connect_check_ntlm_available (void) + gchar *command; + gint ret; + ++ if (force_off_ntlm_auth_check) ++ return FALSE; ++ + /* We are attempting to predict what libsoup will do. */ + helper = g_getenv ("SOUP_NTLM_AUTH_DEBUG"); + if (!helper) +@@ -145,6 +150,11 @@ ews_connect_check_ntlm_available (void) + #endif + } + ++void ++e_ews_connection_utils_force_off_ntlm_auth_check (void) ++{ ++ force_off_ntlm_auth_check = TRUE; ++} + + /* Should we bother to attempt a connection without a password? Remember, + * this is *purely* an optimisation to avoid that extra round-trip if we +diff -up evolution-ews-3.16.5/src/server/e-ews-connection-utils.h.ntlm-auth-test-failure evolution-ews-3.16.5/src/server/e-ews-connection-utils.h +--- evolution-ews-3.16.5/src/server/e-ews-connection-utils.h.ntlm-auth-test-failure 2014-08-11 09:12:45.000000000 +0200 ++++ evolution-ews-3.16.5/src/server/e-ews-connection-utils.h 2016-04-20 23:00:51.235540255 +0200 +@@ -32,6 +32,8 @@ gboolean e_ews_connection_utils_check_el + const gchar *element_name, + const gchar *expected_name); + ++void e_ews_connection_utils_force_off_ntlm_auth_check ++ (void); + gboolean e_ews_connection_utils_get_without_password + (CamelEwsSettings *ews_settings); + diff --git a/evolution-ews.spec b/evolution-ews.spec index 4aabbbb..a8c47d6 100644 --- a/evolution-ews.spec +++ b/evolution-ews.spec @@ -3,14 +3,14 @@ Name: evolution-ews Version: 3.16.5 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/Productivity Summary: Evolution extension for Exchange Web Services License: LGPLv2 URL: https://wiki.gnome.org/Apps/Evolution Source: http://download.gnome.org/sources/%{name}/3.16/%{name}-%{version}.tar.xz -#Patch01: evolution-ews-3.5.90-xmlbuffer.patch +Patch01: evolution-ews-3.16.5-ntlm-auth-test-failure.patch Requires: evolution >= %{version} Requires: evolution-data-server >= %{version} @@ -39,7 +39,7 @@ versions 2007 and later, through its Exchange Web Services (EWS) interface. %prep %setup -q -#%patch01 -p1 -b .xmlbuffer +%patch01 -p1 -b .ntlm-auth-test-failure %build @@ -80,6 +80,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/evolution/modules/*.la %{_datadir}/evolution-data-server/ews/windowsZones.xml %changelog +* Wed Apr 20 2016 Milan Crha - 3.16.5-2 +- Add patch for RH bug #1327072 (NTLM auth failure with latest samba) + * Mon Aug 10 2015 Milan Crha - 3.16.5-1 - Update to 3.16.5