diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/test-fix-D-Bus-policy-override-for-TEST-73-LOCALE.patch | 25 | ||||
-rwxr-xr-x | debian/tests/localed-locale | 18 | ||||
-rwxr-xr-x | debian/tests/localed-x11-keymap | 18 |
5 files changed, 68 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index f3c7bfc..abaee4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +systemd (256.4-2) unstable; urgency=medium + + * autopkgtest: allow localectl in localed tests. + + -- Luca Boccassi <bluca@debian.org> Thu, 25 Jul 2024 13:18:09 +0100 + systemd (256.4-1~progress7.99u1) graograman-backports; urgency=medium * Uploading to graograman-backports, remaining changes: diff --git a/debian/patches/series b/debian/patches/series index a00f68b..af6e44e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +test-fix-D-Bus-policy-override-for-TEST-73-LOCALE.patch progress-linux/0001-agetty-nohostname.patch progress-linux/0002-proc-hidepid.patch progress-linux/0003-logind-noautovts.patch diff --git a/debian/patches/test-fix-D-Bus-policy-override-for-TEST-73-LOCALE.patch b/debian/patches/test-fix-D-Bus-policy-override-for-TEST-73-LOCALE.patch new file mode 100644 index 0000000..5cf6e44 --- /dev/null +++ b/debian/patches/test-fix-D-Bus-policy-override-for-TEST-73-LOCALE.patch @@ -0,0 +1,25 @@ +Author: Luca Boccassi <bluca@debian.org> +Forwarded: yes +Description: test: fix D-Bus policy override for TEST-73-LOCALE + We don't need to allow non-root, and the policy needs to specify destination + and interface too, to narrow it down +--- a/test/units/TEST-73-LOCALE.sh ++++ b/test/units/TEST-73-LOCALE.sh +@@ -666,14 +666,9 @@ + "https://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> + <busconfig> + <policy user="root"> +- <allow send_member="SetLocale"/> +- <allow send_member="SetVConsoleKeyboard"/> +- <allow send_member="SetX11Keyboard"/> +- </policy> +- <policy context="default"> +- <allow send_member="SetLocale"/> +- <allow send_member="SetVConsoleKeyboard"/> +- <allow send_member="SetX11Keyboard"/> ++ <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetLocale"/> ++ <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetVConsoleKeyboard"/> ++ <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetX11Keyboard"/> + </policy> + </busconfig> + EOF diff --git a/debian/tests/localed-locale b/debian/tests/localed-locale index d666be2..85477b0 100755 --- a/debian/tests/localed-locale +++ b/debian/tests/localed-locale @@ -3,6 +3,24 @@ set -e . `dirname $0`/assert.sh +# Calls to localed are blocked as other tools are used to change settings, +# override that policy +mkdir -p /etc/dbus-1/system.d/ +cat >/etc/dbus-1/system.d/systemd-localed-read-only.conf <<EOF +<?xml version="1.0"?> +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "https://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetLocale"/> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetVConsoleKeyboard"/> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetX11Keyboard"/> + </policy> +</busconfig> +EOF +trap 'rm -f /etc/dbus-1/system.d/systemd-localed-read-only.conf' EXIT +systemctl reload dbus.service || true + if [ -f /etc/locale.conf ]; then cp /etc/locale.conf /etc/locale.conf.orig fi diff --git a/debian/tests/localed-x11-keymap b/debian/tests/localed-x11-keymap index 1fd29d3..b4f8af8 100755 --- a/debian/tests/localed-x11-keymap +++ b/debian/tests/localed-x11-keymap @@ -24,9 +24,27 @@ cleanup() { rm -f /etc/default/keyboard fi rm -f /etc/X11/xorg.conf.d/00-keyboard.conf + rm -f /etc/dbus-1/system.d/systemd-localed-read-only.conf } trap cleanup EXIT INT QUIT PIPE +# Calls to localed are blocked as other tools are used to change settings, +# override that policy +mkdir -p /etc/dbus-1/system.d/ +cat >/etc/dbus-1/system.d/systemd-localed-read-only.conf <<EOF +<?xml version="1.0"?> +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "https://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetLocale"/> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetVConsoleKeyboard"/> + <allow send_destination="org.freedesktop.locale1" send_interface="org.freedesktop.locale1" send_member="SetX11Keyboard"/> + </policy> +</busconfig> +EOF +systemctl reload dbus.service || true + # should activate daemon and work STATUS=`localectl` assert_in "X11 Layout:" "`localectl --no-pager`" |