diff --git a/extras/packaging/gnu-linux/Makefile b/extras/packaging/gnu-linux/Makefile index 524bbb38124a962e63f95aed1d3cda839dec2909..5ed9b6441632a27dbc5bccb035701f69c2346cc3 100644 --- a/extras/packaging/gnu-linux/Makefile +++ b/extras/packaging/gnu-linux/Makefile @@ -49,7 +49,7 @@ QT_MAJOR := 6 QT_MINOR := 4 QT_PATCH := 3 QT_TARBALL_CHECKSUM := 29a7eebdbba0ea57978dea6083709c93593a60f0f3133a3de08b9571ee8eaab4 -DEBIAN_QT_VERSION := $(QT_MAJOR).$(QT_MINOR).$(QT_PATCH)-1 +DEBIAN_QT_VERSION := $(QT_MAJOR).$(QT_MINOR).$(QT_PATCH)-2 DEBIAN_QT_DSC_FILENAME := libqt-jami_$(DEBIAN_QT_VERSION).dsc QT_JAMI_PREFIX := /usr/lib/libqt-jami diff --git a/extras/packaging/gnu-linux/rules/debian-qt/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch b/extras/packaging/gnu-linux/rules/debian-qt/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2ca9dbceaa43d8d91cf5550e932ed4dc27f43c0 --- /dev/null +++ b/extras/packaging/gnu-linux/rules/debian-qt/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch @@ -0,0 +1,52 @@ +From f4410fcbb093f259eaff4a20fc4266a535479235 Mon Sep 17 00:00:00 2001 +From: Sebastien Blin <sebastien.blin@savoirfairelinux.com> +Date: Mon, 29 May 2023 13:09:53 -0400 +Subject: [PATCH] OpenFile portal: do not use O_PATH fds + +Using O_PATH requires correctly specifying whether the fd is writable or +not. Stating that the fd is writable without it actually being writable +results into rejection on xdg-desktop-portal side. Other implementations +like xdg-open or gtk have also moved away from O_PATH fds so this will +make a matching implementation and avoid possible rejections from xdp. + +Fixes: QTBUG-113143 +Original: https://codereview.qt-project.org/c/qt/qtbase/+/475425 +--- + qtbase/src/gui/platform/unix/qgenericunixservices.cpp | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/qtbase/src/gui/platform/unix/qgenericunixservices.cpp b/qtbase/src/gui/platform/unix/qgenericunixservices.cpp +index a0e5466c58..fe0fdaa625 100644 +--- a/qtbase/src/gui/platform/unix/qgenericunixservices.cpp ++++ b/qtbase/src/gui/platform/unix/qgenericunixservices.cpp +@@ -163,8 +163,7 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) + // handle_token (s) - A string that will be used as the last element of the @handle. + // writable (b) - Whether to allow the chosen application to write to the file. + +-#ifdef O_PATH +- const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_PATH); ++ const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_RDONLY); + if (fd != -1) { + QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.portal.Desktop"_L1, + "/org/freedesktop/portal/desktop"_L1, +@@ -174,16 +173,13 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) + QDBusUnixFileDescriptor descriptor; + descriptor.giveFileDescriptor(fd); + +- const QVariantMap options = {{"writable"_L1, true}}; ++ const QVariantMap options = {}; + + // FIXME parent_window_id + message << QString() << QVariant::fromValue(descriptor) << options; + + return QDBusConnection::sessionBus().call(message); + } +-#else +- Q_UNUSED(url); +-#endif + + return QDBusMessage::createError(QDBusError::InternalError, qt_error_string()); + } +-- +2.40.1 + diff --git a/extras/packaging/gnu-linux/rules/debian-qt/patches/series b/extras/packaging/gnu-linux/rules/debian-qt/patches/series index 55dc20056f55ca2b5440f4f97127972ccd246c36..98b1f3a1f632977e5116ae49a54506f7679dc3ad 100644 --- a/extras/packaging/gnu-linux/rules/debian-qt/patches/series +++ b/extras/packaging/gnu-linux/rules/debian-qt/patches/series @@ -1 +1,2 @@ -0001-fix-gcc13.patch \ No newline at end of file +0001-fix-gcc13.patch +0002-OpenFile-portal-do-not-use-O_PATH-fds.patch \ No newline at end of file diff --git a/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec b/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec index 4e0a68d41afaa10d238576a415c6445ec457e37c..c4260532ad0d3ad8c569546cdd794aff27efb244 100644 --- a/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec +++ b/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec @@ -27,6 +27,7 @@ Vendor: Savoir-faire Linux Inc. URL: https://jami.net/ Source: jami-libqt-%{version}.tar.xz Patch0: 0001-fix-gcc13.patch +Patch1: 0002-OpenFile-portal-do-not-use-O_PATH-fds.patch %global gst 0.10 %if 0%{?fedora} || 0%{?rhel} > 7 @@ -62,6 +63,7 @@ This package contains Qt libraries for Jami. %prep %setup -n qt-everywhere-src-%{version} %patch0 -p1 +%patch1 -p1 %build echo "Building Qt using %{job_count} parallel jobs" diff --git a/extras/packaging/gnu-linux/rules/rpm/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch b/extras/packaging/gnu-linux/rules/rpm/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2ca9dbceaa43d8d91cf5550e932ed4dc27f43c0 --- /dev/null +++ b/extras/packaging/gnu-linux/rules/rpm/patches/0002-OpenFile-portal-do-not-use-O_PATH-fds.patch @@ -0,0 +1,52 @@ +From f4410fcbb093f259eaff4a20fc4266a535479235 Mon Sep 17 00:00:00 2001 +From: Sebastien Blin <sebastien.blin@savoirfairelinux.com> +Date: Mon, 29 May 2023 13:09:53 -0400 +Subject: [PATCH] OpenFile portal: do not use O_PATH fds + +Using O_PATH requires correctly specifying whether the fd is writable or +not. Stating that the fd is writable without it actually being writable +results into rejection on xdg-desktop-portal side. Other implementations +like xdg-open or gtk have also moved away from O_PATH fds so this will +make a matching implementation and avoid possible rejections from xdp. + +Fixes: QTBUG-113143 +Original: https://codereview.qt-project.org/c/qt/qtbase/+/475425 +--- + qtbase/src/gui/platform/unix/qgenericunixservices.cpp | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/qtbase/src/gui/platform/unix/qgenericunixservices.cpp b/qtbase/src/gui/platform/unix/qgenericunixservices.cpp +index a0e5466c58..fe0fdaa625 100644 +--- a/qtbase/src/gui/platform/unix/qgenericunixservices.cpp ++++ b/qtbase/src/gui/platform/unix/qgenericunixservices.cpp +@@ -163,8 +163,7 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) + // handle_token (s) - A string that will be used as the last element of the @handle. + // writable (b) - Whether to allow the chosen application to write to the file. + +-#ifdef O_PATH +- const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_PATH); ++ const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_RDONLY); + if (fd != -1) { + QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.portal.Desktop"_L1, + "/org/freedesktop/portal/desktop"_L1, +@@ -174,16 +173,13 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) + QDBusUnixFileDescriptor descriptor; + descriptor.giveFileDescriptor(fd); + +- const QVariantMap options = {{"writable"_L1, true}}; ++ const QVariantMap options = {}; + + // FIXME parent_window_id + message << QString() << QVariant::fromValue(descriptor) << options; + + return QDBusConnection::sessionBus().call(message); + } +-#else +- Q_UNUSED(url); +-#endif + + return QDBusMessage::createError(QDBusError::InternalError, qt_error_string()); + } +-- +2.40.1 + diff --git a/extras/packaging/gnu-linux/scripts/build-package-rpm.sh b/extras/packaging/gnu-linux/scripts/build-package-rpm.sh index 2ae016a974fe0f48900200d90d479ac343471f79..a7019e6c2cd25f151a48f927beb80fcae587002c 100755 --- a/extras/packaging/gnu-linux/scripts/build-package-rpm.sh +++ b/extras/packaging/gnu-linux/scripts/build-package-rpm.sh @@ -46,7 +46,7 @@ CMAKE_PREFIX_PATH="${QT_JAMI_PREFIX}/lib/cmake:${CMAKE_PREFIX_PATH}" QT_MAJOR=6 QT_MINOR=4 QT_PATCH=3 -QT_RELEASE_PATCH=1 +QT_RELEASE_PATCH=2 QT_MAJOR_MINOR=${QT_MAJOR}.${QT_MINOR} QT_MAJOR_MINOR_PATCH=${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}