diff options
| author | Olivier Certner <olce@FreeBSD.org> | 2025-08-26 08:56:54 +0000 |
|---|---|---|
| committer | Olivier Certner <olce@FreeBSD.org> | 2025-09-09 15:56:40 +0000 |
| commit | de974a0f1b73e79466c25f3c85fe727004576fea (patch) | |
| tree | 33bb11f8438ccc3df862718edb715e99aa236226 | |
| parent | 1cf67b587023af90f2b2c6e87d9103ec42b2b9b2 (diff) | |
ddb ps: Print again the effective GID, separately
Following commit be1f7435ef218b1d ("kern: start tracking cr_gid outside
of cr_groups[]"), cr_groups[] doesn't contain the effective GID anymore.
Fix the 'show proc' DDB command to show it again, and make it stand out
with respect to the supplementary ones.
Fixes: be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after: 9 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52251
| -rw-r--r-- | sys/ddb/db_ps.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index 733c440f5ee3..a26cf8161294 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -459,12 +459,11 @@ DB_SHOW_COMMAND(proc, db_show_proc) db_printf("??? (%#x)\n", p->p_state); } if (p->p_ucred != NULL) { - db_printf(" uid: %d gids: ", p->p_ucred->cr_uid); - for (i = 0; i < p->p_ucred->cr_ngroups; i++) { - db_printf("%d", p->p_ucred->cr_groups[i]); - if (i < (p->p_ucred->cr_ngroups - 1)) - db_printf(", "); - } + db_printf(" uid: %d gid: %d supp gids: ", + p->p_ucred->cr_uid, p->p_ucred->cr_gid); + for (i = 0; i < p->p_ucred->cr_ngroups; i++) + db_printf(i == 0 ? "%d" : ", %d", + p->p_ucred->cr_groups[i]); db_printf("\n"); } if (p->p_pptr != NULL) |
