summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-08-14 14:41:45 +0200
committerJörg Frings-Fürst <debian@jff.email>2019-08-14 14:41:45 +0200
commitf83e6f04c2e430326656513ce02c4206aac8cc07 (patch)
treef79daa6eac4a3d0e47806aa346a8280cd63fcd45
parente905afb102569e93e2f6ece9a9ab515ac1fd4f04 (diff)
parentb55471ee1bea95cb50be7576dce835310d1812de (diff)
Merge branch 'release/debian/0.30.4-2'
-rw-r--r--debian/changelog8
-rw-r--r--debian/patches/0110-fix_GoogleAuthenticator.patch135
-rw-r--r--debian/patches/series1
3 files changed, 144 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index b8ea9e7..3af7755 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+shotwell (0.30.4-2) unstable; urgency=medium
+
+ * Fix GoogleAuthenticator error handling (Closes: #934723):
+ - New debian/patches/0110-fix_GoogleAuthenticator.patch cherry-picked
+ from upstream.
+
+ -- Jörg Frings-Fürst <debian@jff.email> Wed, 14 Aug 2019 12:00:37 +0200
+
shotwell (0.30.4-1) unstable; urgency=medium
* New upstream release.
diff --git a/debian/patches/0110-fix_GoogleAuthenticator.patch b/debian/patches/0110-fix_GoogleAuthenticator.patch
new file mode 100644
index 0000000..2ea4155
--- /dev/null
+++ b/debian/patches/0110-fix_GoogleAuthenticator.patch
@@ -0,0 +1,135 @@
+Description: Fix GoogleAuthenticator
+Author: Jörg Frings-Fürst <debian@jff.email>
+Origin: upstream, https://gitlab.gnome.org/GNOME/shotwell/commit/db18c371984b80ead9daf4e0ae2058469d2f5524.diff
+Bug: https://gitlab.gnome.org/GNOME/shotwell/issues/158
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934723
+Forwarded: not-needed
+Last-Update: 2019-08-14
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
+===================================================================
+--- trunk.orig/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
++++ trunk/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala
+@@ -54,6 +54,12 @@ namespace Publishing.Authenticator.Shotw
+ }
+
+ public override void on_page_load() {
++ if (this.load_error != null) {
++ this.error();
++
++ return;
++ }
++
+ var uri = new Soup.URI(get_view().get_uri());
+ if (uri.scheme == "shotwell-auth" && this.auth_code == null) {
+ var form_data = Soup.Form.decode (uri.query);
+@@ -77,6 +83,8 @@ namespace Publishing.Authenticator.Shotw
+ }
+
+ internal class Flickr : Publishing.Authenticator.Shotwell.OAuth1.Authenticator {
++ private WebAuthenticationPane pane;
++
+ public Flickr(Spit.Publishing.PluginHost host) {
+ base(API_KEY, API_SECRET, host);
+ }
+@@ -185,13 +193,17 @@ namespace Publishing.Authenticator.Shotw
+ }
+
+ private void do_web_authentication(string token) {
+- var pane = new WebAuthenticationPane(token);
++ pane = new WebAuthenticationPane(token);
+ host.install_dialog_pane(pane);
+ pane.authorized.connect(this.do_verify_pin);
+ pane.error.connect(this.on_web_login_error);
+ }
+
+ private void on_web_login_error() {
++ if (pane.load_error != null) {
++ host.post_error(pane.load_error);
++ return;
++ }
+ host.post_error(new Spit.Publishing.PublishingError.PROTOCOL_ERROR(_("Flickr authorization failed")));
+ }
+
+Index: trunk/plugins/authenticator/shotwell/GoogleAuthenticator.vala
+===================================================================
+--- trunk.orig/plugins/authenticator/shotwell/GoogleAuthenticator.vala
++++ trunk/plugins/authenticator/shotwell/GoogleAuthenticator.vala
+@@ -21,6 +21,12 @@ namespace Publishing.Authenticator.Shotw
+ }
+
+ public override void on_page_load() {
++ if (this.load_error != null) {
++ this.error ();
++
++ return;
++ }
++
+ var uri = new Soup.URI(get_view().get_uri());
+ if (uri.scheme == REVERSE_CLIENT_ID && this.auth_code == null) {
+ var form_data = Soup.Form.decode (uri.query);
+@@ -173,6 +179,7 @@ namespace Publishing.Authenticator.Shotw
+
+ web_auth_pane = new WebAuthenticationPane(user_authorization_url);
+ web_auth_pane.authorized.connect(on_web_auth_pane_authorized);
++ web_auth_pane.error.connect(on_web_auth_pane_error);
+
+ host.install_dialog_pane(web_auth_pane);
+ }
+@@ -185,6 +192,10 @@ namespace Publishing.Authenticator.Shotw
+ do_get_access_tokens(auth_code);
+ }
+
++ private void on_web_auth_pane_error() {
++ host.post_error(web_auth_pane.load_error);
++ }
++
+ private void do_get_access_tokens(string auth_code) {
+ debug("ACTION: exchanging authorization code for access & refresh tokens");
+
+Index: trunk/plugins/common/WebAuthenticationPane.vala
+===================================================================
+--- trunk.orig/plugins/common/WebAuthenticationPane.vala
++++ trunk/plugins/common/WebAuthenticationPane.vala
+@@ -12,6 +12,7 @@ namespace Shotwell.Plugins.Common {
+ }
+
+ public string login_uri { owned get; construct; }
++ public Error load_error { get; private set; default = null; }
+
+ private WebKit.WebView webview;
+
+@@ -22,6 +23,7 @@ namespace Shotwell.Plugins.Common {
+ this.webview.get_settings ().enable_plugins = false;
+
+ this.webview.load_changed.connect (this.on_page_load_changed);
++ this.webview.load_failed.connect (this.on_page_load_failed);
+ this.webview.context_menu.connect ( () => { return false; });
+ }
+
+@@ -29,11 +31,24 @@ namespace Shotwell.Plugins.Common {
+
+ protected void set_cursor (Gdk.CursorType type) {
+ var window = webview.get_window ();
++ if (window == null)
++ return;
++
+ var display = window.get_display ();
++ if (display == null)
++ return;
++
+ var cursor = new Gdk.Cursor.for_display (display, type);
+ window.set_cursor (cursor);
+ }
+
++ private bool on_page_load_failed (WebKit.LoadEvent load_event, string uri, Error error) {
++ critical ("Failed to load uri %s: %s", uri, error.message);
++ this.load_error = error;
++
++ return false;
++ }
++
+ private void on_page_load_changed (WebKit.LoadEvent load_event) {
+ switch (load_event) {
+ case WebKit.LoadEvent.STARTED:
diff --git a/debian/patches/series b/debian/patches/series
index f52cd58..a710ad9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@
#0515-Fix_background_color_drawing.patch
#505-fix-viewer-desktop-file.patch
0105-gitversion.patch
+0110-fix_GoogleAuthenticator.patch