[systemd-commits] src/systemctl

Lennart Poettering lennart at kemper.freedesktop.org
Sun Jan 4 16:57:43 PST 2015


 src/systemctl/systemctl.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit aba843317d8acc4634417becebaedcfe5805d49d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jan 5 01:56:47 2015 +0100

    systemctl: properly iterate through service array when dispatching to sysv
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1175734

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9c4b9ed..3d939f0 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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



More information about the systemd-commits mailing list