DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

accounts-daemon cannot set user avatar under ProtectSystem=strict, throws read-only file system error

Open MEKCCK opened this issue 5 months ago • 9 comments

Compositor

Niri

Distribution

Arch Linux

If Other, please specify

No response

Select your Installation Method

DankInstaller

Was this your original Installation method?

Yes

If no, specify

No response

dms doctor -vC

DMS Doctor Report

System

  • [ok] Operating System: EndeavourOS
    • ID: endeavouros, Version: rolling, Arch: amd64
  • [ok] Architecture: amd64
  • [ok] Display Server: Wayland
    • WAYLAND_DISPLAY=wayland-1

Versions

  • [ok] DMS CLI: dms v1.4.6
    • /usr/bin/dms
  • [warn] Quickshell: Quickshell 0.3.0 (revision 68c2c85c33845385f7ab8147b32f1450b1e468e0, distributed by AUR (package: quickshell-git))
    • /usr/sbin/qs
  • [ok] DMS Shell: v1.4.6
    • /usr/share/quickshell/dms

Installation

  • [ok] DMS Configuration: Found
    • /usr/share/quickshell/dms
  • [ok] shell.qml: Present
    • /usr/share/quickshell/dms/shell.qml
  • [info] Install Type: System package
    • /usr/share/quickshell/dms

Compositor

  • [ok] Hyprland: 0.55.4
    • /usr/sbin/hyprland
  • [ok] niri: 26.04
    • /usr/sbin/niri
  • [ok] labwc: 0.20.0
    • /usr/sbin/labwc
  • [info] Active: niri
  • [ok] Background Blur: Supported
    • Compositor supports ext-background-effect-v1

Quickshell Features

  • [info] Polkit: Not available
    • Authentication prompts
  • [info] IdleMonitor: Not available
    • Idle detection
  • [info] IdleInhibitor: Not available
    • Prevent idle/sleep
  • [info] ShortcutInhibitor: Not available
    • Allow shortcut management (niri)
  • [info] BackgroundBlur: Not available
    • Background blur API support in Quickshell

Optional Features

  • [ok] accountsservice: Available
    • User accounts
  • [ok] power-profiles-daemon: Available
    • Power profile management
  • [ok] logind: Available
    • Session management
  • [ok] cups-pk-helper: Available
    • Printer management
  • [info] I2C/DDC: No monitors detected
    • External monitor brightness control
  • [ok] qt6-imageformats: Installed (1 formats)
    • Formats: GIF (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
  • [ok] kimageformats: Installed (4 formats)
    • Formats: AVIF, HEIF, JXL, EXR (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
  • [ok] Terminal: kitty
  • [ok] Network: NetworkManager
    • NetworkManager present; iwd also running (likely NM's Wi-Fi backend). Using NM API.
  • [ok] matugen: Installed
    • Dynamic theming
  • [ok] dgop: Installed
    • System monitoring
  • [ok] cava: Installed
    • Audio visualizer
  • [info] khal: Not installed
    • Calendar events
  • [ok] danksearch: Installed
    • File search
  • [ok] fprintd: Installed
    • Fingerprint auth

Config Files

  • [ok] settings.json: Present
    • /home/elite/.config/DankMaterialShell/settings.json
  • [info] clsettings.json: Not yet created
    • /home/elite/.config/DankMaterialShell/clsettings.json
  • [info] plugin_settings.json: Not yet created
    • /home/elite/.config/DankMaterialShell/plugin_settings.json
  • [ok] session.json: Present
    • /home/elite/.local/state/DankMaterialShell/session.json
  • [ok] dms-colors.json: Present
    • /home/elite/.cache/DankMaterialShell/dms-colors.json

Services

  • [warn] dms.service: Disabled
  • [info] greetd: Not installed
    • Optional greeter service

Environment

  • [info] QT_QPA_PLATFORMTHEME: gtk3
  • [info] QS_ICON_THEME: Adwaita

Summary: 0 error(s), 2 warning(s), 27 ok

Description

Bug Summary

When accounts-daemon.service enables ProtectSystem=strict , the service fails to complete user avatar configuration, with logs reporting a read-only filesystem error.

Root Cause

  1. ProtectSystem=strict mounts most system directories as read-only by default, including /tmp .
  2. The service unit does not include /tmp inside ReadWritePaths , so the daemon has no write permission for the global temporary directory.
  3. There is no TMPDIR environment variable defined to redirect temporary file operations to an isolated, service-owned writable runtime directory.
  4. The avatar upload/replacement workflow of AccountsService depends entirely on creating temporary image files within /tmp before persisting icons to /var/lib/AccountsService/icons/ .

This creates contradictory logic: the sandbox hardening rules block a core built-in feature of the daemon. The security isolation configuration fails to accommodate the program's fundamental IO requirements for temporary file creation.

Steps to Reproduce

  1. Run accounts-daemon with the default unit containing ProtectSystem=strict .
  2. Attempt to assign a custom user profile avatar via desktop environment settings.
  3. The avatar change operation aborts, journal logs output read-only filesystem error when creating temp files in /tmp .

Expected Behavior

Adjust the service unit to resolve the conflict between strict filesystem protection and avatar functionality. Two valid solutions:

  1. Add /tmp to the service's ReadWritePaths list to permit temporary file writes;
  2. Allocate a private runtime temporary directory using RuntimeDirectory , set TMPDIR to this isolated path, and whitelist it in ReadWritePaths (tighter security, aligns with strict sandbox design goals).

Environment Information

  • Distribution: EndeavourOS (Arch Linux)
  • accountsservice package version: 1.4.6

Expected Behavior

No response

Steps to Reproduce

This problem has been there since installation, and my friend has the same issue

Error Messages/Logs

No response

Screenshots/Recordings

No response

MEKCCK avatar Jun 28 '26 10:06 MEKCCK

Can also confirm this on a fresh minimal vanilla Arch install.

Unable to reproduce on a fresh minimal fedora install.

toods2 avatar Jun 28 '26 23:06 toods2

Here as well on CachyOS + Niri + DMS. This was an erase and install today, my previous same install earlier today had no issue at all but I had to set my avatar a good while ago.

BetafuTX avatar Jun 29 '26 01:06 BetafuTX

In the meantime, if you want to do it manually...

  1. Navigate to /var/lib/AccountsService/ and add your icon png there using your user name. So, my user is toodz and thus I have /var/lib/AccountsService/toodz ...where toodz is my png I want to use as my user icon/avatar.

  2. Navigate to /var/lib/AccountsService/users/ and edit your users file to include a line to reference the location of your user icon you created in step 1. In my case that would be Icon=/var/lib/AccountsService/icons/toodz. My users file looks like:

[User]
Session=
Icon=/var/lib/AccountsService/icons/toodz
SystemAcount=false

You'll need to be root/sudo to make these edits and logout/reboot to see changes. Run dms greeter sync to pull your icon onto the dms greeter page if you use dms greeter.

toods2 avatar Jun 29 '26 19:06 toods2

Same here with endeavourOS + niri

RayyanAbdullahKhan avatar Jun 30 '26 07:06 RayyanAbdullahKhan

Can also confirm this on a fresh minimal vanilla Arch install.

Unable to reproduce on a fresh minimal fedora install.

https://gitlab.freedesktop.org/accountsservice/accountsservice/-/work_items/139

MEKCCK avatar Jul 03 '26 13:07 MEKCCK

Can also confirm this on a fresh minimal vanilla Arch install. Unable to reproduce on a fresh minimal fedora install.

https://gitlab.freedesktop.org/accountsservice/accountsservice/-/work_items/139

So they updated this feature of AccountsService to standardize on the homed pathing and broke it? 😂

I don’t know a single person that uses homed anyway.

toods2 avatar Jul 03 '26 13:07 toods2

Dont think theres much we can do until the fix lands upstream, but the workaround should work

sudo systemctl edit accounts-daemon
# add:
[Service]
ReadWritePaths=/tmp
# then:
sudo systemctl restart accounts-daemon

bbedward avatar Jul 03 '26 16:07 bbedward

Arch just pushed an update to AccountsService that should contain the fix, give it a test.

toods2 avatar Jul 04 '26 02:07 toods2

Confirmed fixed on Arch as of accountsservice version 26.27.3-1

Tested by swapping user avatar/icon back and forth with different images in DMS settings menus.

toods2 avatar Jul 08 '26 00:07 toods2