summaryrefslogtreecommitdiffstats
path: root/src/core/service.c
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2019-10-17 05:10:05 +0200
committerGitHub <noreply@github.com>2019-10-17 05:10:05 +0200
commit959daf9bfc6617169710ef226718be90ab9f9037 (patch)
tree5071572a5ed18705fe1b786d3ac2fa9edf49da6b /src/core/service.c
parentMerge pull request #13784 from keszybz/constify-unit-pointers (diff)
parentshared/dropin: support -.service.d/ top level drop-in for service units (diff)
downloadsystemd-959daf9bfc6617169710ef226718be90ab9f9037.tar.xz
systemd-959daf9bfc6617169710ef226718be90ab9f9037.zip
Merge pull request #13743 from anitazha/dropin_all_the_things
core: support top level drop-ins through -.service.d for service units
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 3713490c93..256ca46fd8 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -550,6 +550,11 @@ static int service_verify(Service *s) {
assert(s);
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.