1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

systemctl: properly iterate through service array when dispatching to sysv

https://bugzilla.redhat.com/show_bug.cgi?id=1175734
This commit is contained in:
Lennart Poettering 2015-01-05 01:56:47 +01:00
parent 805d14864f
commit aba843317d
Notes: Lennart Poettering 2015-02-12 13:52:36 +01:00
Backport: bugfix

View File

@ -5188,8 +5188,10 @@ static int enable_sysv_units(const char *verb, char **args) {
return -EPROTO;
/* Remove this entry, so that we don't try enabling it as native unit */
assert(f > 0 && streq(args[f-1], name));
assert_se(strv_remove(args + f - 1, name));
assert(f > 0);
f--;
assert(args[f] == name);
strv_remove(args, name);
}
#endif