[git commit] id: Fix output in case of groups error

Denys Vlasenko vda.linux at googlemail.com
Sun Oct 4 22:52:46 UTC 2026


commit: https://git.busybox.net/busybox/commit/?id=85efaab17934dd16bea9cf41baec9c3185eb0553
branch: https://git.busybox.net/busybox/log/?h=master

On a severely constrained system (m68k-nommu) I got confusing output from
`id` command:

    ~ # id
    uid=0 gid=0id: can't get groups

After this change it's a bit more readable:

    ~ # id
    uid=0 gid=0
    id: can't get groups

function                                             old     new   delta
id_main                                              474     484     +10

Signed-off-by: Wojtek Kaniewski <wojtekka at toxygen.net>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/id.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coreutils/id.c b/coreutils/id.c
index 319e80c0c..8b43fcd1c 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -230,6 +230,7 @@ int id_main(int argc UNUSED_PARAM, char **argv)
 				prefix = ",";
 			}
 		} else if (n < 0) { /* error in get_groups() */
+			bb_putchar('\n');
 			if (ENABLE_DESKTOP)
 				bb_simple_error_msg_and_die("can't get groups");
 			return EXIT_FAILURE;


More information about the busybox-cvs mailing list