aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2025-11-14 11:59:09 +0000
committerOlivier Certner <olce@FreeBSD.org>2025-11-24 20:31:00 +0000
commitb92b1b47583036bd02e656564ff22c92b8949077 (patch)
tree51f17cf4d6613d9fb4efcd2047f459bae8b8460e /usr.bin
parent7b6644e160ed63b633e7c68a3cacf2c71d216cd5 (diff)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mdo/mdo.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/mdo/mdo.c b/usr.bin/mdo/mdo.c
index 3eb5d4e5c23f..879423bc0128 100644
--- a/usr.bin/mdo/mdo.c
+++ b/usr.bin/mdo/mdo.c
@@ -753,8 +753,14 @@ main(int argc, char **argv)
*/
setcred_flags |= SETCREDF_SUPP_GROUPS;
}
- } else if (supp_groups_str == NULL && (supp_mod_str == NULL ||
- supp_mod_str[0] != '@')) {
+ } else if (supp_groups_str == NULL && supp_mod_str != NULL &&
+ supp_mod_str[0] != '@') {
+ /*
+ * We do not need to determine the current groups if, as for the
+ * '!start_from_current_groups' case, we are going to replace
+ * them entirely, but here also if we do not amend them at all
+ * (because they are by definition already in place).
+ */
const int ngroups = getgroups(0, NULL);
if (ngroups > 0) {