Skip to content

systemd error handling on user= is dangerous and makes no sense #6309

@Joerg-rw

Description

@Joerg-rw

Submission type

  • Bug report

systemd version the issue has been seen with

systemd 232

Used distribution

Linux ubuntu 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

In case of bug report: Expected behaviour you didn't see

systemd rejects invalid value to "user=" and throws bold warning, doesn't run the process

In case of bug report: Unexpected behaviour you saw

systemd considers a
user=_syntactically_invalid
like
foobar=
I.E. it ignores the correctly detected "user=" and runs the process with default root privileges.

This is highly surprising, unexpected (by the average user) and dangerous behavior.
Systemd should not bother at all about syntactical correctness of value at right-side of "user=" and simply leave it to the system to check if the particular system allows and knows a user of that name.

*1: It's not systemd's call to enforce anything about "syntactically correct names" here
*2: systemd MUST NOT run jobs as root when a "user=" been given, no matter what (except "root") is on the value side.

Rationale: it's considered highly dangerous to run a job as root when that job obviously is not meant to run as root, since admin gave "user=" parameter.
Syntax of user names gets enforced elsewhere, systemd must not duplicate any such policies unless it's creating a new user(name)

In case of bug report: Steps to reproduce the problem

see #6237

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions