Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jan 2025 12:27:13 GMT
From:      Olivier Certner <olce@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 043e259e41d3 - stable/13 - mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1
Message-ID:  <202501171227.50HCRDUq052483@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=043e259e41d3f17f3c9415db0135ad82cb532f1f

commit 043e259e41d3f17f3c9415db0135ad82cb532f1f
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-10-03 14:49:40 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-01-17 12:24:52 +0000

    mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1
    
    Lift this unnecessary limitation.
    
    Approved by:    markj (mentor)
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D46921
    
    (cherry picked from commit 7f7f3b6cafac6e8ab993a14386e34991224f86f3)
---
 usr.sbin/mountd/mountd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 6b3a9af1c279..cdf42de2fcdb 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -3612,8 +3612,6 @@ parsecred(char *namelist, struct expcred *cr)
 			ngroups = NGROUPS_MAX + 1;
 		}
 
-		if (ngroups > NGROUPS_MAX)
-			ngroups = NGROUPS_MAX;
 		if (ngroups > SMALLNGROUPS)
 			cr->cr_groups = malloc(ngroups * sizeof(gid_t));
 		cr->cr_ngroups = ngroups;
@@ -3647,7 +3645,7 @@ parsecred(char *namelist, struct expcred *cr)
 		} else {
 			group = name_ul;
 		}
-		if (cr->cr_ngroups == NGROUPS_MAX) {
+		if (cr->cr_ngroups == NGROUPS_MAX + 1) {
 			syslog(LOG_ERR, "too many groups");
 			break;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501171227.50HCRDUq052483>