From 51b42bc7b86448867d3438467ca620b71b9882c0 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 24 Oct 2017 14:32:51 +0200 Subject: [PATCH 1/5] Move back to Ubuntu 14.04, but with custom libyubikey and libykpers-1 builds, resolves #1114 --- Dockerfile | 57 +++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f7ace34c..ad9a2f442 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,51 +14,54 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -FROM centos:7 +FROM ubuntu:14.04 + +ENV QT5_VERSION=59 +ENV QT5_PPA_VERSION=${QT5_VERSION}2 RUN set -x \ - && curl "https://copr.fedorainfracloud.org/coprs/bugzy/keepassxc/repo/epel-7/bugzy-keepassxc-epel-7.repo" \ - > /etc/yum.repos.d/bugzy-keepassxc-epel-7.repo + && apt-get update -y \ + && apt-get -y install software-properties-common RUN set -x \ - && curl "https://copr.fedorainfracloud.org/coprs/sic/backports/repo/epel-7/sic-backports-epel-7.repo" \ - > /etc/yum.repos.d/sic-backports-epel-7.repo + && add-apt-repository ppa:beineri/opt-qt${QT5_PPA_VERSION}-trusty RUN set -x \ - && yum clean -y all \ - && yum upgrade -y + && apt-get update -y \ + && apt-get upgrade -y # build and runtime dependencies RUN set -x \ - && yum install -y \ - make \ - automake \ - gcc-c++ \ - cmake \ - libgcrypt16-devel \ - qt5-qtbase-devel \ - qt5-linguist \ - qt5-qttools \ - zlib-devel \ - qt5-qtx11extras \ - qt5-qtx11extras-devel \ - libXi-devel \ - libXtst-devel + && apt-get install -y \ + cmake3 \ + g++ \ + libgcrypt20-dev \ + qt${QT5_VERSION}base \ + qt${QT5_VERSION}tools \ + qt${QT5_VERSION}x11extras \ + zlib1g-dev \ + libxi-dev \ + libxtst-dev \ + mesa-common-dev + +ENV CMAKE_PREFIX_PATH=/opt/qt${QT5_VERSION}/lib/cmake +ENV LD_LIBRARY_PATH=/opt/qt${QT5_VERSION}/lib +RUN set -x \ + && echo /opt/qt${QT_VERSION}/lib > /etc/ld.so.conf.d/qt${QT5_VERSION}.conf # AppImage dependencies RUN set -x \ - && yum install -y \ + && apt-get install -y \ wget \ - fuse-libs + libfuse2 # build libyubikey ENV YUBIKEY_VERSION=1.13 -RUN set -x && yum install -y libusb-devel RUN set -x \ && wget "https://developers.yubico.com/yubico-c/Releases/libyubikey-${YUBIKEY_VERSION}.tar.gz" \ && tar xf libyubikey-${YUBIKEY_VERSION}.tar.gz \ && cd libyubikey-${YUBIKEY_VERSION} \ - && ./configure --prefix=/usr --libdir=/usr/lib64 \ + && ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \ && make \ && make install \ && cd .. \ @@ -66,11 +69,13 @@ RUN set -x \ # build libykpers-1 ENV YKPERS_VERSION=1.18.0 +RUN set -x \ + && apt-get install -y libusb-dev RUN set -x \ && wget "https://developers.yubico.com/yubikey-personalization/Releases/ykpers-${YKPERS_VERSION}.tar.gz" \ && tar xf ykpers-${YKPERS_VERSION}.tar.gz \ && cd ykpers-${YKPERS_VERSION} \ - && ./configure --prefix=/usr --libdir=/usr/lib64 \ + && ./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \ && make \ && make install \ && cd .. \ From f6933a88681cd57fd3d08db290ff4966eda810ad Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 24 Oct 2017 15:25:38 +0200 Subject: [PATCH 2/5] Ensure that YubiKey is only polled once, even if showEvent() is called twice --- src/gui/DatabaseOpenWidget.cpp | 16 ++++++++++++---- src/gui/DatabaseOpenWidget.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index ee0e9de26..e487f97ca 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -95,11 +95,16 @@ void DatabaseOpenWidget::showEvent(QShowEvent* event) m_ui->editPassword->setFocus(); #ifdef WITH_XC_YUBIKEY - connect(YubiKey::instance(), SIGNAL(detected(int,bool)), SLOT(yubikeyDetected(int,bool)), Qt::QueuedConnection); - connect(YubiKey::instance(), SIGNAL(detectComplete()), SLOT(yubikeyDetectComplete()), Qt::QueuedConnection); - connect(YubiKey::instance(), SIGNAL(notFound()), SLOT(noYubikeyFound()), Qt::QueuedConnection); + // showEvent() may be called twice, so make sure we are only polling once + if (!m_yubiKeyBeingPolled) { + connect(YubiKey::instance(), SIGNAL(detected(int, bool)), SLOT(yubikeyDetected(int, bool)), + Qt::QueuedConnection); + connect(YubiKey::instance(), SIGNAL(detectComplete()), SLOT(yubikeyDetectComplete()), Qt::QueuedConnection); + connect(YubiKey::instance(), SIGNAL(notFound()), SLOT(noYubikeyFound()), Qt::QueuedConnection); - pollYubikey(); + pollYubikey(); + m_yubiKeyBeingPolled = true; + } #endif } @@ -110,6 +115,7 @@ void DatabaseOpenWidget::hideEvent(QHideEvent* event) #ifdef WITH_XC_YUBIKEY // Don't listen to any Yubikey events if we are hidden disconnect(YubiKey::instance(), 0, this, 0); + m_yubiKeyBeingPolled = false; #endif } @@ -311,10 +317,12 @@ void DatabaseOpenWidget::yubikeyDetectComplete() m_ui->checkChallengeResponse->setEnabled(true); m_ui->buttonRedetectYubikey->setEnabled(true); m_ui->yubikeyProgress->setVisible(false); + m_yubiKeyBeingPolled = false; } void DatabaseOpenWidget::noYubikeyFound() { m_ui->buttonRedetectYubikey->setEnabled(true); m_ui->yubikeyProgress->setVisible(false); + m_yubiKeyBeingPolled = false; } diff --git a/src/gui/DatabaseOpenWidget.h b/src/gui/DatabaseOpenWidget.h index a7691a91e..aade111c3 100644 --- a/src/gui/DatabaseOpenWidget.h +++ b/src/gui/DatabaseOpenWidget.h @@ -73,6 +73,7 @@ protected: QString m_filename; private: + bool m_yubiKeyBeingPolled = false; Q_DISABLE_COPY(DatabaseOpenWidget) }; From 05d02b702ad232f673860457dfe9ee258a1e937d Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 24 Oct 2017 15:07:10 +0200 Subject: [PATCH 3/5] Restrict global menu fix to Qt < 5.9.0, resolves #691 --- src/gui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index f1d5f866c..e37a7d28c 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -881,7 +881,7 @@ void MainWindow::toggleWindow() raise(); activateWindow(); -#if defined(Q_OS_LINUX) && ! defined(QT_NO_DBUS) +#if defined(Q_OS_LINUX) && ! defined(QT_NO_DBUS) && (QT_VERSION < QT_VERSION_CHECK(5, 9, 0)) // re-register global D-Bus menu (needed on Ubuntu with Unity) // see https://github.com/keepassxreboot/keepassxc/issues/271 // and https://bugreports.qt.io/browse/QTBUG-58723 From cd6aac9acf0282594c90b77353c97d9a905e3d69 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 24 Oct 2017 15:37:03 +0200 Subject: [PATCH 4/5] Remove libdbus and libsystemd blacklisting --- AppImage-Recipe.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/AppImage-Recipe.sh b/AppImage-Recipe.sh index c421aa79e..d8b715492 100755 --- a/AppImage-Recipe.sh +++ b/AppImage-Recipe.sh @@ -66,10 +66,6 @@ get_apprun copy_deps delete_blacklisted -# remove dbus and systemd libs as they are not blacklisted -find . -name libdbus-1.so.3 -exec rm {} \; -find . -name libsystemd.so.0 -exec rm {} \; - get_desktop get_icon cat << EOF > ./usr/bin/keepassxc_env From 83fd387f2f187c4a11be0bff6535d3e2b49e136d Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 24 Oct 2017 17:10:01 +0200 Subject: [PATCH 5/5] Fix desktop integration --- AppImage-Recipe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppImage-Recipe.sh b/AppImage-Recipe.sh index d8b715492..e29c05620 100755 --- a/AppImage-Recipe.sh +++ b/AppImage-Recipe.sh @@ -85,8 +85,8 @@ else fi EOF chmod +x ./usr/bin/keepassxc_env -sed -i 's/Exec=keepassxc/Exec=keepassxc_env/' org.keepassxc.desktop -get_desktopintegration $LOWERAPP +sed -i 's/Exec=keepassxc/Exec=keepassxc_env/' org.${LOWERAPP}.desktop +get_desktopintegration "org.${LOWERAPP}" GLIBC_NEEDED=$(glibc_needed)