HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/lib/dpkg/info/gdm3.preinst
#!/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