From f450ba4056f3af0d17aeb1e5534619ce2231b63d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:43:08 +0200 Subject: Adding debian version 43.0-3. Signed-off-by: Daniel Baumann --- debian/gdm3.preinst | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 debian/gdm3.preinst (limited to 'debian/gdm3.preinst') diff --git a/debian/gdm3.preinst b/debian/gdm3.preinst new file mode 100644 index 0000000..93ebed9 --- /dev/null +++ b/debian/gdm3.preinst @@ -0,0 +1,68 @@ +#!/bin/sh + +set -e + +if [ "$1" = "upgrade" ] || [ "$1" = "install" ]; then + # Remove wrongly replaced custom.config file by versions > 3.37.90 && < 3.38.1 + # This script can be safely removed post 20.10 release + prev_version="$2" + if dpkg --compare-versions "$prev_version" ge 3.37.90 && + dpkg --compare-versions "$prev_version" lt-nl 3.38.1; then + conf_file=/etc/gdm3/daemon.conf + if [ "${prev_version#*ubuntu}" != "$prev_version" ]; then + conf_file=/etc/gdm3/custom.conf + fi + + conf="${DPKG_ROOT}$conf_file" + if [ -f "$conf" ] && + echo "ed0a2d19ba7344faa0feadd783bb4fa5 $conf" | md5sum -c --status; then + # If the file matches this checksum, then it's a file generated by + # /usr/libexec/gdm-disable-wayland that was wrongly replaced, so we + # replace the conf file to match the one that was default in these + # broken versions, so that dpkg would replace it in case. + echo "Configuration file $conf_file has likely been damaged by" \ + "https://pad.lv/1899673, replacing with the gdm default..." + cat <<'EOF' > "$conf" +# GDM configuration storage +# +# See /usr/share/gdm/gdm.schemas for a list of available options. + +[daemon] +# Uncomment the line below to force the login screen to use Xorg +#WaylandEnable=false + +# Enabling automatic login +# AutomaticLoginEnable = true +# AutomaticLogin = user1 + +# Enabling timed login +# TimedLoginEnable = true +# TimedLogin = user1 +# TimedLoginDelay = 10 + +[security] + +[xdmcp] + +[chooser] + +[debug] +# Uncomment the line below to turn on debugging +# More verbose logs +# Additionally lets the X server dump core if it crashes +#Enable=true + +EOF + + # Verify that the file we've just added matches the default one + # We don't fail as it's not a fatal error, but will cause manual + # intervention at later points + default_md5sum="$(dpkg-query -W -f='${Conffiles}' gdm3 | \ + sed -n -e "\\'^ $conf_file ' { s/ obsolete$//; s/.* //; p }")" + echo "$default_md5sum $conf" | md5sum -c --status || + echo "Replaced configuration file isn't matching expected default" + fi + fi +fi + +#DEBHELPER# -- cgit v1.2.3