core: check the unit type more thoroughly when deserializing

Resolves: #27523
This commit is contained in:
Frantisek Sumsal
2023-05-05 22:15:23 +02:00
parent cc938f1ce0
commit 24e91e08f8
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -6162,7 +6162,9 @@ int activation_details_deserialize(const char *key, const char *value, Activatio
return -EINVAL;
t = unit_type_from_string(value);
if (t == _UNIT_TYPE_INVALID)
/* The activation details vtable has defined ops only for path
* and timer units */
if (!IN_SET(t, UNIT_PATH, UNIT_TIMER))
return -EINVAL;
*details = malloc0(activation_details_vtable[t]->object_size);
@@ -0,0 +1,4 @@
d.socket
job
activation-details-unit-type=service