unit-name: tighten checks for building valid unit names
authorLennart Poettering <lennart@poettering.net>
Sun, 24 May 2020 22:34:58 +0000 (00:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 May 2020 07:17:47 +0000 (09:17 +0200)
commitab19db01ae1826efb3cbdf6dcb6a14412f8844d4
tree267906580ee2744949e73e50c52567bd83fbb7ed
parent1283366a90e8aa8713af449a0e3a0096c90648e3
unit-name: tighten checks for building valid unit names

Let's be more thorough that whenever we build a unit name based on
parameters, that the result is actually a valid user name. If it isn't
fail early.

This should allows us to catch various issues earlier, in particular
when we synthesize mount units from /proc/self/mountinfo: instead of
actually attempting to allocate a mount unit we will fail much earlier
when we build the name to synthesize the unit under. Failing early is a
good thing generally.
src/basic/unit-name.c