core: support top level drop-ins through -.service.d for service units
static int service_verify(Service *s) {
assert(s);
-
- if (UNIT(s)->load_state != UNIT_LOADED)
- return 0;
+ assert(UNIT(s)->load_state == UNIT_LOADED);
+ if (!service_unit_name_is_valid(UNIT(s)->id)) {
+ log_unit_error(UNIT(s), "Service name is invalid or reserved. Refusing.");
+ return -EINVAL;
+ }
+
if (!s->exec_command[SERVICE_EXEC_START] && !s->exec_command[SERVICE_EXEC_STOP]
&& UNIT(s)->success_action == EMERGENCY_ACTION_NONE) {
/* FailureAction= only makes sense if one of the start or stop commands is specified.