Systemd/src/analyze
Zbigniew Jędrzejewski-Szmek 934ef6a522 core: create socket service instances with the correct name from the start
Upon an incoming connection for an accepting socket, we'd create a unit like
foo@0.service, then figure out that the instance name should be e.g. "0-41-0",
and then add the name foo@0-41-0.service to the unit. This obviously violates
the rule that any service needs to have a constance instance part.

So let's reverse the order: we first determine the instance name and then
create the unit with the correct name from the start.

There are two cases where we don't know the instance name:
- analyze-verify: we just do a quick check that the instance unit can be
  created. So let's use a bogus instance string.
- selinux: the code wants to load the service unit to extract the ExecStart path
  and query it for the selinux label. Do the same as above.

Note that in both cases it is possible that the real unit that is loaded could
be different than the one with the bogus instance value, for example if there
is a dropin for a specific instance name. We can't do much about this, since we
can't figure out the instance name in advance. The old code had the same
shortcoming.
2020-06-10 09:45:55 +02:00
..
analyze-condition.c condition: add ConditionEnvironment= 2020-05-15 16:05:33 +02:00
analyze-condition.h analyze: add 'condition' verb 2019-06-27 10:54:37 +02:00
analyze-security.c basic/set: let set_put_strdup() create the set with string hash ops 2020-05-06 16:54:06 +02:00
analyze-security.h analyze: add new security verb 2018-11-30 16:48:09 +01:00
analyze-verify.c core: create socket service instances with the correct name from the start 2020-06-10 09:45:55 +02:00
analyze-verify.h verify: ignore nonexistent executables if required 2020-04-14 21:23:31 +02:00
analyze.c Merge pull request #15681 from vcaputo/buslocator 2020-05-07 09:46:01 -07:00
meson.build analyze: add 'condition' verb 2019-06-27 10:54:37 +02:00
test-verify.c verify: ignore nonexistent executables if required 2020-04-14 21:23:31 +02:00