Created attachment 186046 [details] test case, sets env 0 and then runs a bash shell SUMMARY When launching a process with xdg-open via kio's systemd process launcher, environment variables whose names are not made of [a-zA-Z0-9_]* are filtered to fit systemd unit files[1]; but systemd has an additional restriction that environment variables not start with digits[2]. If an environment variable like "0a" is set, the process will fail to launch. STEPS TO REPRODUCE 1. Set an environment variable starting with "0". (Ex: setenv.c) 2. Run xdg-open somefile.png OBSERVED RESULT kf.kio.gui: Failed to launch process as service: "app-firefox@[...].service" "org.freedesktop.DBus.Error.InvalidArgs" "Invalid environment block." EXPECTED RESULT The environment should be filtered alongside other illegal systemd environment variables. SOFTWARE/OS VERSIONS Operating System: NixOS 25.05 KDE Plasma Version: 6.3.6 KDE Frameworks Version: 6.14.0 Qt Version: 6.9.1 xdg-utils 1.2.1 kio-6.14.0 ADDITIONAL INFORMATION [1] https://invent.kde.org/frameworks/kio/-/blob/67fa68b82e1795f636936b4f77623d0146f2ee8e/src/gui/systemd/systemdprocessrunner.cpp#L94 [2] https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#Environment=
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2050
Could you try my patch?
Git commit 292fadb4cce90ade731330ee126cd829232e37df by Méven Car, on behalf of Christoph Cullmann. Committed on 16/11/2025 at 14:24. Pushed by meven into branch 'master'. systemd: prevent passing invalid env vars starting with digit filter them out, too for safety: filter empty vars, should not happen, but still M +1 -1 src/gui/systemd/systemdprocessrunner.cpp https://invent.kde.org/frameworks/kio/-/commit/292fadb4cce90ade731330ee126cd829232e37df