From 2fabf9cabaf1f4bab9f924afa116d1c7d84680b9 Mon Sep 17 00:00:00 2001 From: Kristian Fiskerstrand Date: Mon, 16 Oct 2017 23:14:28 +0200 Subject: app-crypt/pinentry: Fix grabbing issue in awesomewm Bug: https://bugs.gentoo.org/609678 Package-Manager: Portage-2.3.8, Repoman-2.3.3 --- ...isable-tooltips-in-keyboard-grabbing-mode.patch | 47 ++++++++++ ...nentry-1.0.0-gtk2-Fix-a-problem-with-fvwm.patch | 47 ++++++++++ app-crypt/pinentry/pinentry-1.0.0-r1.ebuild | 102 -------------------- app-crypt/pinentry/pinentry-1.0.0-r2.ebuild | 104 +++++++++++++++++++++ 4 files changed, 198 insertions(+), 102 deletions(-) create mode 100644 app-crypt/pinentry/files/pinentry-1.0.0-Disable-tooltips-in-keyboard-grabbing-mode.patch create mode 100644 app-crypt/pinentry/files/pinentry-1.0.0-gtk2-Fix-a-problem-with-fvwm.patch delete mode 100644 app-crypt/pinentry/pinentry-1.0.0-r1.ebuild create mode 100644 app-crypt/pinentry/pinentry-1.0.0-r2.ebuild (limited to 'app-crypt') diff --git a/app-crypt/pinentry/files/pinentry-1.0.0-Disable-tooltips-in-keyboard-grabbing-mode.patch b/app-crypt/pinentry/files/pinentry-1.0.0-Disable-tooltips-in-keyboard-grabbing-mode.patch new file mode 100644 index 000000000000..7724d1beae8c --- /dev/null +++ b/app-crypt/pinentry/files/pinentry-1.0.0-Disable-tooltips-in-keyboard-grabbing-mode.patch @@ -0,0 +1,47 @@ +From 1590b664d88be8386a4664c2994b685187d1eb25 Mon Sep 17 00:00:00 2001 +From: Damien Goutte-Gattat +Date: Thu, 3 Aug 2017 22:56:49 +0200 +Subject: [PATCH 1/6] gtk: Disable tooltips in keyboard-grabbing mode. + +* gtk+-2:/pinentry-gtk-2.c (show_hide_button): Do not show the +tooltip if we attempt to grab the keyboard. +(create_window): Likewise. +-- + +For unclear reasons, those tooltips may interfere with grabbing +under some tiling window managers. + +GnuPG-bug-id: 3297 +Signed-off-by: Damien Goutte-Gattat +--- + gtk+-2/pinentry-gtk-2.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c +index d467ec5..f17a702 100644 +--- a/gtk+-2/pinentry-gtk-2.c ++++ b/gtk+-2/pinentry-gtk-2.c +@@ -516,7 +516,10 @@ show_hide_button_toggled (GtkWidget *widget, gpointer data) + } + + gtk_label_set_markup (GTK_LABEL(label), text); +- gtk_widget_set_tooltip_text (GTK_WIDGET(button), tooltip); ++ if (!pinentry->grab) ++ { ++ gtk_widget_set_tooltip_text (GTK_WIDGET(button), tooltip); ++ } + g_free (tooltip); + } + +@@ -736,7 +739,7 @@ create_window (pinentry_t ctx) + gtk_progress_bar_set_text (GTK_PROGRESS_BAR (qualitybar), + QUALITYBAR_EMPTY_TEXT); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (qualitybar), 0.0); +- if (pinentry->quality_bar_tt) ++ if (pinentry->quality_bar_tt && !pinentry->grab) + { + #if !GTK_CHECK_VERSION (2, 12, 0) + gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), qualitybar, +-- +2.13.6 + diff --git a/app-crypt/pinentry/files/pinentry-1.0.0-gtk2-Fix-a-problem-with-fvwm.patch b/app-crypt/pinentry/files/pinentry-1.0.0-gtk2-Fix-a-problem-with-fvwm.patch new file mode 100644 index 000000000000..f7476de1ff67 --- /dev/null +++ b/app-crypt/pinentry/files/pinentry-1.0.0-gtk2-Fix-a-problem-with-fvwm.patch @@ -0,0 +1,47 @@ +From b0e0bdeac5d40ca645afc9017778b39a26303523 Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Wed, 11 Jan 2017 18:40:17 +0100 +Subject: [PATCH 01/25] gtk2: Fix a problem with fvwm + +* gtk+-2/pinentry-gtk-2.c (grab_pointer): Take care of +GDK_GRAB_ALREADY_GRABBED. +-- + +Debian-bug-id: 850708 +Co-authored-by: Vincent Lefevre +Signed-off-by: Werner Koch +--- + gtk+-2/pinentry-gtk-2.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c +index 473c4aa..e37601f 100644 +--- a/gtk+-2/pinentry-gtk-2.c ++++ b/gtk+-2/pinentry-gtk-2.c +@@ -203,7 +203,12 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data) + (void)data; + + /* Change the cursor for the duration of the grab to indicate that +- something is going on. */ ++ * something is going on. The fvwm window manager grabs the pointer ++ * for a short time and thus we may end up with the already grabbed ++ * error code. Actually this error code should be used to detect a ++ * malicious grabbing application but with fvwm this renders ++ * Pinentry only unusable. Thus we try again several times also for ++ * that error code. See Debian bug 850708 for details. */ + /* XXX: It would be nice to have a key cursor, unfortunately there + is none readily available. */ + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (win), +@@ -215,7 +220,8 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data) + NULL /* confine to */, + cursor, + gdk_event_get_time (event)); +- while (tries++ < max_tries && err == GDK_GRAB_NOT_VIEWABLE); ++ while (tries++ < max_tries && (err == GDK_GRAB_NOT_VIEWABLE ++ || err == GDK_GRAB_ALREADY_GRABBED)); + + if (err) + { +-- +2.13.6 + diff --git a/app-crypt/pinentry/pinentry-1.0.0-r1.ebuild b/app-crypt/pinentry/pinentry-1.0.0-r1.ebuild deleted file mode 100644 index 23de2e2209d0..000000000000 --- a/app-crypt/pinentry/pinentry-1.0.0-r1.ebuild +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit autotools flag-o-matic qmake-utils toolchain-funcs - -DESCRIPTION="Simple passphrase entry dialogs which utilize the Assuan protocol" -HOMEPAGE="https://gnupg.org/aegypten2/index.html" -SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="caps emacs gnome-keyring gtk ncurses qt5 static" - -CDEPEND=" - app-eselect/eselect-pinentry - >=dev-libs/libassuan-2.1 - >=dev-libs/libgcrypt-1.6.3 - >=dev-libs/libgpg-error-1.17 - caps? ( sys-libs/libcap ) - gnome-keyring? ( app-crypt/libsecret ) - gtk? ( x11-libs/gtk+:2 ) - ncurses? ( sys-libs/ncurses:0= ) - qt5? ( - dev-qt/qtcore:5 - dev-qt/qtgui:5 - dev-qt/qtwidgets:5 - ) - static? ( >=sys-libs/ncurses-5.7-r5:0=[static-libs,-gpm] ) -" -DEPEND="${CDEPEND} - sys-devel/gettext - virtual/pkgconfig -" -RDEPEND="${CDEPEND} - gnome-keyring? ( app-crypt/gcr ) -" - -REQUIRED_USE=" - || ( ncurses gtk qt5 ) - gtk? ( !static ) - qt5? ( !static ) - static? ( ncurses ) -" - -DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) - -PATCHES=( - "${FILESDIR}/${PN}-0.8.2-ncurses.patch" - "${FILESDIR}/${P}-build.patch" -) - -src_prepare() { - default - eautoreconf -} - -src_configure() { - use static && append-ldflags -static - [[ "$(gcc-major-version)" -ge 5 ]] && append-cxxflags -std=gnu++11 - - export QTLIB="$(qt5_get_libdir)" - - econf \ - --enable-pinentry-tty \ - $(use_with caps libcap) \ - $(use_enable emacs pinentry-emacs) \ - $(use_enable gnome-keyring libsecret) \ - $(use_enable gnome-keyring pinentry-gnome3) \ - $(use_enable gtk pinentry-gtk2) \ - $(use_enable ncurses pinentry-curses) \ - $(use_enable ncurses fallback-curses) \ - $(use_enable qt5 pinentry-qt) \ - MOC="$(qt5_get_bindir)"/moc -} - -src_install() { - default - rm -f "${ED}"/usr/bin/pinentry || die - - use qt5 && dosym pinentry-qt /usr/bin/pinentry-qt4 -} - -pkg_postinst() { - if ! has_version 'app-crypt/pinentry' || has_version '=2.6.9 support memory locking for unprivileged processes." - elog "The soft resource limit for memory locking specifies the limit an" - elog "unprivileged process may lock into memory. You can also use POSIX" - elog "capabilities to allow pinentry to lock memory. To do so activate the caps" - elog "USE flag and add the CAP_IPC_LOCK capability to the permitted set of" - elog "your users." - fi - - eselect pinentry update ifunset -} - -pkg_postrm() { - eselect pinentry update ifunset -} diff --git a/app-crypt/pinentry/pinentry-1.0.0-r2.ebuild b/app-crypt/pinentry/pinentry-1.0.0-r2.ebuild new file mode 100644 index 000000000000..f26a7c9f5bc5 --- /dev/null +++ b/app-crypt/pinentry/pinentry-1.0.0-r2.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools flag-o-matic qmake-utils toolchain-funcs + +DESCRIPTION="Simple passphrase entry dialogs which utilize the Assuan protocol" +HOMEPAGE="https://gnupg.org/aegypten2/index.html" +SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="caps emacs gnome-keyring gtk ncurses qt5 static" + +CDEPEND=" + app-eselect/eselect-pinentry + >=dev-libs/libassuan-2.1 + >=dev-libs/libgcrypt-1.6.3 + >=dev-libs/libgpg-error-1.17 + caps? ( sys-libs/libcap ) + gnome-keyring? ( app-crypt/libsecret ) + gtk? ( x11-libs/gtk+:2 ) + ncurses? ( sys-libs/ncurses:0= ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + ) + static? ( >=sys-libs/ncurses-5.7-r5:0=[static-libs,-gpm] ) +" +DEPEND="${CDEPEND} + sys-devel/gettext + virtual/pkgconfig +" +RDEPEND="${CDEPEND} + gnome-keyring? ( app-crypt/gcr ) +" + +REQUIRED_USE=" + || ( ncurses gtk qt5 ) + gtk? ( !static ) + qt5? ( !static ) + static? ( ncurses ) +" + +DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) + +PATCHES=( + "${FILESDIR}/${PN}-0.8.2-ncurses.patch" + "${FILESDIR}/${P}-build.patch" + "${FILESDIR}/${P}-Disable-tooltips-in-keyboard-grabbing-mode.patch" + "${FILESDIR}/${P}-gtk2-Fix-a-problem-with-fvwm.patch" +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + use static && append-ldflags -static + [[ "$(gcc-major-version)" -ge 5 ]] && append-cxxflags -std=gnu++11 + + export QTLIB="$(qt5_get_libdir)" + + econf \ + --enable-pinentry-tty \ + $(use_with caps libcap) \ + $(use_enable emacs pinentry-emacs) \ + $(use_enable gnome-keyring libsecret) \ + $(use_enable gnome-keyring pinentry-gnome3) \ + $(use_enable gtk pinentry-gtk2) \ + $(use_enable ncurses pinentry-curses) \ + $(use_enable ncurses fallback-curses) \ + $(use_enable qt5 pinentry-qt) \ + MOC="$(qt5_get_bindir)"/moc +} + +src_install() { + default + rm -f "${ED}"/usr/bin/pinentry || die + + use qt5 && dosym pinentry-qt /usr/bin/pinentry-qt4 +} + +pkg_postinst() { + if ! has_version 'app-crypt/pinentry' || has_version '=2.6.9 support memory locking for unprivileged processes." + elog "The soft resource limit for memory locking specifies the limit an" + elog "unprivileged process may lock into memory. You can also use POSIX" + elog "capabilities to allow pinentry to lock memory. To do so activate the caps" + elog "USE flag and add the CAP_IPC_LOCK capability to the permitted set of" + elog "your users." + fi + + eselect pinentry update ifunset +} + +pkg_postrm() { + eselect pinentry update ifunset +} -- cgit v1.2.3-65-gdbad