The condition on COL_GROUP incorrectly checked `!grp->gr_name`
instead of `!user->group`. This caused the GROUP column to always
be empty because when gr_name is non-NULL (normal case) the
assignment was skipped, and when gr_name is NULL, xstrdup() would
crash.
Fixes: https://github.com/util-linux/util-linux/issues/4097
Fixes: 52a6e45bfe5ddee1fed20f2f4f7542cac6bf13c9
Signed-off-by: Karel Zak <kzak@redhat.com>
user->uid = pwd->pw_uid;
break;
case COL_GROUP:
- if (!grp->gr_name)
+ if (!user->group)
user->group = xstrdup(grp->gr_name);
break;
case COL_GID: