priv-kweihmann / systemdlint

Systemd Linter
BSD 2-Clause "Simplified" License
32 stars 7 forks source link

[Security.NoUser] seems a bit harsh for user unit files #64

Open glitsj16 opened 8 months ago

glitsj16 commented 8 months ago

Not sure if my assumptions are correct, but I've always written systemd user (as opposed to system) units without a User=foo or DynamicUser=bar. systemd itself doesn't do that for user units, as they're designed to be run by the user that calls them via systemctl --user. So I was a bit surprised to notice systemdlint always tags these with [Security.NoUser] as an error, regardless where they are placed on the filesystem:

$ systemdlint /home/glitsj16/.config/systemd/user/logout.service
/home/glitsj16/.config/systemd/user/logout.service:1:error [Security.NoUser] - Neither User nor DynamicUser is set
$ systemdlint /usr/lib/systemd/user/dbus.service
/usr/lib/systemd/user/dbus.service:1:error [Security.NoUser] - Neither User nor DynamicUser is set
$ systemdlint /etc/systemd/user/privaxy.service
/etc/systemd/user/privaxy.service:1:error [Security.NoUser] - Neither User nor DynamicUser is set

Is there a way to drop this notice for user units? Or at least downgrade it to a warning?

priv-kweihmann commented 8 months ago

Currently that's not supported, but I'll take it into consideration for the 2.x planning

glitsj16 commented 8 months ago

That's fine. Looking forward to version 2.0. Thank you for considering it!