Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-95837

gdm does not respect a precedence order for loading session files

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • rhel-9.7
    • rhel-8.7.0
    • gdm
    • None
    • Low
    • 1
    • rhel-display-window-mgmt
    • ssg_display
    • 1
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Display WM #4/2025
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      According to the documentation[1],

      By default, GDM will install desktop files in the <share>/xsessions
      directory. GDM will search the following directories in this order
      to find desktop files: <etc>/X11/sessions/, <dmconfdir>/Sessions,
      <share>/xsessions, and <share>/gdm/BuiltInSessions. By default the
      <dmconfdir> is set to <etc>/dm/ unless GDM is configured to use a
      different directory via the "--with-dmconfdir" option.

      A session can be disabled by editing the desktop file and adding a
      line as follows: Hidden=true.

      So it should be possible to hide an installed session (e.g. gnome-session) by
      doing creating an overriding file at /etc/dm/Sessions/ or /etc/X11/sessions/.

      1. https://help.gnome.org/admin/gdm/stable/configuration.html.en#sessionconfig

      Version-Release number of selected component (if applicable):

      gdm-3.28.2 and later (happens on RHEL 7, 8 and 9)

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create overriding files for the Standard session:

      1. mkdir -p /etc/dm/Sessions/ /etc/X11/sessions/
      2. ( cat /usr/share/wayland-sessions/gnome.desktop; echo Hidden=true ) > \
        /etc/dm/Sessions/gnome.desktop
      3. ( cat /usr/share/xsessions/gnome.desktop; echo Hidden=true ) > \
        /etc/X11/sessions/gnome.desktop
      4. ( cat /usr/share/xsessions/gnome-xorg.desktop; echo Hidden=true ) > \
        /etc/X11/sessions/gnome-xorg.desktop

      2. Restart gdm

      1. systemctl restart gdm.service

      3. Choose a user in the greeter screen and click on the cogwheel.

      Actual results:

      The "Standard (Wayland display server)" and "Standard (X11 display server) on
      Xorg" options are still shown.

      Expected results:

      The "Standard (Wayland display server)" and "Standard (X11 display server) on
      Xorg" options should not be shown.

      Additional info:

      A fix is already available upstream:

      https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/202

      /usr/share/xsessions/gnome.desktop and /usr/share/xsessions/gnome-xorg.desktop
      are reduntant. One of them should not exist.

      Currently the only workaround is to remove the existing session files or append
      "Hidden=true" to them:

      1. echo Hidden=true >> /usr/share/wayland-sessions/gnome.desktop
      2. echo Hidden=true >> /usr/share/xsessions/gnome.desktop
      3. echo Hidden=true >> /usr/share/xsessions/gnome-xorg.desktop
      4. systemctl restart gdm

      But this does not survive a re-installation of gnome-session-xsession and/or
      gnome-session-wayland-session.

      The directory names are confusing:

      /etc/dm/Sessions/ -> Wayland sessions
      /etc/X11/sessions/ -> Xorg sessions

      A fix is required on RHEL 9 too. It would be desirable to have a fix for RHEL 7
      also, since customers frequently ask for ways to disable either the Standard
      or the Classic session.

              rh-ee-joatorre Joan Torres Lopez
              rhn-support-casantos Carlos Santos
              Joan Torres Lopez Joan Torres Lopez
              Michal Odehnal Michal Odehnal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: