]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homectl: show full list of selected groups as they are added 36271/head
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Feb 2025 11:19:52 +0000 (12:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Feb 2025 14:21:18 +0000 (15:21 +0100)
src/home/homectl.c

index cc2f073582715ba4feffd7ba58387a5ac8a7b92e..7acaf593018bec786eac22f8d91686a51676e598 100644 (file)
@@ -2549,10 +2549,19 @@ static int create_interactively(void) {
                 return log_error_errno(r, "Failed to set userName field: %m");
 
         _cleanup_strv_free_ char **available = NULL, **groups = NULL;
-
         for (;;) {
                 _cleanup_free_ char *s = NULL;
 
+                strv_sort_uniq(groups);
+
+                if (!strv_isempty(groups)) {
+                        _cleanup_free_ char *j = strv_join(groups, ", ");
+                        if (!j)
+                                return log_oom();
+
+                        log_info("Currently selected groups: %s", j);
+                }
+
                 r = ask_string_full(&s,
                                group_completion_callback, &available,
                                "%s Please enter an auxiliary group for user %s (empty to continue, \"list\" to list available groups): ",