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

user-environment-generators runs as root context instead of user context

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • rhel-9.8
    • rhel-9.8
    • systemd
    • None
    • Yes
    • Important
    • rhel-plumbers
    • 29
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Proposed Exception
    • None
    • None
    • Unspecified Release Note Type - Unknown
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      User session environment variables set by /usr/lib/systemd/user-environment-generators/60-flatpak are using root's home directory instead of the actual user's home.

      Expected: XDG_DATA_DIRS contains /home/<user>/.local/share/flatpak/exports/share

      Actual: XDG_DATA_DIRS contains /root/.local/share/flatpak/exports/share

      The generator script /usr/lib/systemd/user-environment-generators/60-flatpak executes:
      #!/usr/bin/sh
      export GIO_USE_VFS=local
      exec flatpak --print-updated-env

      The flatpak --print-updated-env command is not receiving correct user session context and defaults to root's environment.

      • Works as expected: systemd 252-65.el9
      • Broken: systemd-252-67.el9

       

        Steps to Reproduce

        1. Install systemd 252-67
        2. Log in as a non-root user from GDM
        3. Check echo $XDG_DATA_DIRS
        4. Observe /root/.local/share/flatpak/exports/share instead of /home/<user>/.local/share/flatpak/exports/share

              fsumsalrh Frantisek Sumsal
              rh-ee-joatorre Joan Torres Lopez
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: