]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: actually sort the parsed LUO session list
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 24 Jun 2026 18:07:56 +0000 (19:07 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 24 Jun 2026 18:08:41 +0000 (19:08 +0100)
The strv_sort() call sat after a for (;;) loop whose only exits are
return statements inside the loop, so it never ran.

CID#1660125

Follow-up for 82b8615463c306f8f7eeaec13600c89a7bbef151

src/core/load-fragment.c

index 3fa92aff56bf20041917f091075de373090cb433..ce4517e85bd2950b2fb946ab9bd6515559b03cca 100644 (file)
@@ -6823,8 +6823,10 @@ int config_parse_luo_sessions(
                                    "Failed to parse LUOSession= value, ignoring: %s", rvalue);
                         return 0;
                 }
-                if (r == 0)
+                if (r == 0) {
+                        strv_sort(*sessions);
                         return 0;
+                }
 
                 if (!luo_session_name_is_valid(word)) {
                         log_syntax(unit, LOG_WARNING, filename, line, 0,
@@ -6842,6 +6844,4 @@ int config_parse_luo_sessions(
                 if (r < 0)
                         return log_oom();
         }
-
-        strv_sort(*sessions);
 }