@@ -15,12 +15,14 @@ Upstream-Status: Submitted [https://gitlab.freedesktop.org/xdg/xdg-utils/-/issue
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
CVE: CVE-2022-4055
+---
+ scripts/xdg-email.in | 89 --------------------------------------------
+ 1 file changed, 89 deletions(-)
-
-diff --git c/scripts/xdg-email.in w/scripts/xdg-email.in
-index 3614776..8bdb5a9 100644
---- c/scripts/xdg-email.in
-+++ w/scripts/xdg-email.in
+diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
+index 73898a4..4fe901e 100644
+--- a/scripts/xdg-email.in
++++ b/scripts/xdg-email.in
@@ -30,58 +30,6 @@ _USAGE
#@xdg-utils-common@
@@ -29,21 +31,21 @@ index 3614776..8bdb5a9 100644
-{
- local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH
- THUNDERBIRD="$1"
-- MAILTO=$(echo "$2" | sed 's/^mailto://')
+- MAILTO="$(echo "$2" | sed 's/^mailto://')"
- echo "$MAILTO" | grep -qs "^?"
- if [ "$?" = "0" ] ; then
-- MAILTO=$(echo "$MAILTO" | sed 's/^?//')
+- MAILTO="$(echo "$MAILTO" | sed 's/^?//')"
- else
-- MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/')
+- MAILTO="$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/')"
- fi
-
-- MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g')
-- TO=$(/bin/echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-- CC=$(/bin/echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-- BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }'))
-- SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1)
-- BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1)
-- ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//'))
+- MAILTO="$(echo "$MAILTO" | sed 's/&/\n/g')"
+- TO="$(/bin/echo -e "$(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')")"
+- CC="$(/bin/echo -e "$(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')")"
+- BCC="$(/bin/echo -e "$(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')")"
+- SUBJECT="$(echo "$MAILTO" | grep '^subject=' | tail -n 1)"
+- BODY="$(echo "$MAILTO" | grep '^body=' | tail -n 1)"
+- ATTACH="$(/bin/echo -e "$(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')")"
-
- if [ -z "$TO" ] ; then
- NEWMAILTO=
@@ -79,54 +81,51 @@ index 3614776..8bdb5a9 100644
-
open_kde()
{
- if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then
-@@ -135,15 +83,6 @@ open_kde()
+ local kreadconfig profile client
+@@ -139,14 +87,6 @@ open_kde()
open_gnome3()
{
- local client
- local desktop
-- desktop=`xdg-mime query default "x-scheme-handler/mailto"`
-- client=`desktop_file_to_binary "$desktop"`
-- echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1
-- if [ $? -eq 0 ] ; then
+- desktop="$(xdg-mime query default "x-scheme-handler/mailto")"
+- client="$(desktop_file_to_binary "$desktop")"
+- case "$client" in *thunderbird*|*icedove*)
- run_thunderbird "$client" "$1"
-- fi
+- esac
-
if gio help open 2>/dev/null 1>&2; then
DEBUG 1 "Running gio open \"$1\""
gio open "$1"
-@@ -164,13 +103,6 @@ open_gnome3()
+@@ -167,12 +107,6 @@ open_gnome3()
open_gnome()
{
- local client
-- client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || ""
-- echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1
-- if [ $? -eq 0 ] ; then
+- client="$(gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1)"
+- case "$client" in *thunderbird*|*icedove*)
- run_thunderbird "$client" "$1"
-- fi
+- esac
-
if gio help open 2>/dev/null 1>&2; then
DEBUG 1 "Running gio open \"$1\""
gio open "$1"
-@@ -236,15 +168,6 @@ open_flatpak()
+@@ -263,14 +197,6 @@ open_flatpak()
open_generic()
{
- local client
- local desktop
-- desktop=`xdg-mime query default "x-scheme-handler/mailto"`
-- client=`desktop_file_to_binary "$desktop"`
-- echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1
-- if [ $? -eq 0 ] ; then
+- desktop="$(xdg-mime query default "x-scheme-handler/mailto")"
+- client="$(desktop_file_to_binary "$desktop")"
+- case "$client" in *thunderbird*|*icedove*)
- run_thunderbird "$client" "$1"
-- fi
+- esac
-
xdg-open "$1"
- local ret=$?
-
-@@ -369,21 +292,6 @@ while [ $# -gt 0 ] ; do
+ exit $?
+ }
+@@ -372,21 +298,6 @@ while [ $# -gt 0 ] ; do
shift
;;
@@ -135,7 +134,7 @@ index 3614776..8bdb5a9 100644
- exit_failure_syntax "file argument missing for --attach option"
- fi
- check_input_file "$1"
-- file=`readlink -f "$1"` # Normalize path
+- file="$(xdg_realpath "$1")" # Normalize path
- if [ -z "$file" ] || [ ! -f "$file" ] ; then
- exit_failure_file_missing "file '$1' does not exist"
- fi
@@ -148,3 +147,6 @@ index 3614776..8bdb5a9 100644
-*)
exit_failure_syntax "unexpected option '$parm'"
;;
+--
+2.43.0
+
similarity index 90%
rename from meta/recipes-extended/xdg-utils/xdg-utils_1.1.3.bb
rename to meta/recipes-extended/xdg-utils/xdg-utils_1.2.1.bb
@@ -7,13 +7,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a5367a90934098d6b05af3b746405014"
DEPENDS = "xmlto-native libxslt-native"
-SRC_URI = "git://gitlab.freedesktop.org/xdg/xdg-utils.git;protocol=https;branch=master;tag=v${PV} \
+SRC_URI = "git://gitlab.freedesktop.org/xdg/xdg-utils.git;protocol=https;branch=v1.2.X;tag=v${PV} \
file://0001-Reinstate-xdg-terminal.patch \
file://0001-Don-t-build-the-in-script-manual.patch \
file://CVE-2022-4055.patch \
"
-SRCREV = "159fc37075db2decf446f453fe1a796da6921aad"
+SRCREV = "356c380ad6fecc9ce6bea1f6a77986ba67402c80"
# Needs brokensep as this doesn't use automake
inherit autotools-brokensep
Upstream release notes: * xdg-icon-resource: Fix for incorrect syntax * better support for Plasma6, Deepin, LXQt * partial support for WSL / flatpak's * Numerous other fixes and improvements Signed-off-by: Ross Burton <ross.burton@arm.com> --- .../xdg-utils/xdg-utils/CVE-2022-4055.patch | 76 ++++++++++--------- ...{xdg-utils_1.1.3.bb => xdg-utils_1.2.1.bb} | 4 +- 2 files changed, 41 insertions(+), 39 deletions(-) rename meta/recipes-extended/xdg-utils/{xdg-utils_1.1.3.bb => xdg-utils_1.2.1.bb} (90%)