1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

core: check the unit type more thoroughly when deserializing

Resolves: #27523
This commit is contained in:
Frantisek Sumsal 2023-05-04 16:56:28 +02:00
parent cc938f1ce0
commit 24e91e08f8
2 changed files with 7 additions and 1 deletions

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);

View File

@ -0,0 +1,4 @@
d.socket
job
activation-details-unit-type=service