ddb ps: Print again the effective GID, separately

Following commit be1f7435ef ("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:          be1f7435ef ("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

(cherry picked from commit de974a0f1b73e79466c25f3c85fe727004576fea)
This commit is contained in:
Olivier Certner 2025-08-26 10:56:54 +02:00
parent 221a5fb331
commit 960dbe036d
No known key found for this signature in database
GPG key ID: 8CA13040971E2627

View file

@ -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)