Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174355224
D46919.id148036.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46919.id148036.diff
View Options
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -3684,7 +3684,9 @@
cr->cr_uid = name_ul;
}
cr->cr_ngroups = 0;
- while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) {
+ while (names != NULL && *names != '\0') {
+ gid_t group;
+
name = strsep_quote(&names, ":");
name_ul = strtoul(name, &end, 10);
if (*end != '\0' || end == name) {
@@ -3692,13 +3694,16 @@
syslog(LOG_ERR, "unknown group: %s", name);
continue;
}
- groups[cr->cr_ngroups++] = gr->gr_gid;
+ group = gr->gr_gid;
} else {
- groups[cr->cr_ngroups++] = name_ul;
+ group = name_ul;
+ }
+ if (cr->cr_ngroups == NGROUPS_MAX) {
+ syslog(LOG_ERR, "too many groups");
+ break;
}
+ groups[cr->cr_ngroups++] = group;
}
- if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX)
- syslog(LOG_ERR, "too many groups");
if (cr->cr_ngroups > SMALLNGROUPS)
cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t));
memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 3:44 PM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40110175
Default Alt Text
D46919.id148036.diff (1 KB)
Attached To
Mode
D46919: mountd(8): parsecred(): uid:gid:... loop: Simplify a bit
Attached
Detach File
Event Timeline
Log In to Comment