Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177852630
D52275.1795433524.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
973 B
Referenced Files
None
Subscribers
None
D52275.1795433524.diff
View Options
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -1973,6 +1973,7 @@
struct ucred ucred;
gid_t *groups;
size_t len;
+ unsigned int ngroups;
assert(kd != NULL);
assert(kp != NULL);
@@ -1990,19 +1991,22 @@
proc.p_ucred, kp->ki_pid);
return (NULL);
}
- len = ucred.cr_ngroups * sizeof(gid_t);
+ ngroups = 1 + ucred.cr_ngroups;
+ len = ngroups * sizeof(gid_t);
groups = malloc(len);
if (groups == NULL) {
warn("malloc(%zu)", len);
return (NULL);
}
- if (!kvm_read_all(kd, (unsigned long)ucred.cr_groups, groups, len)) {
+ groups[0] = ucred.cr_gid;
+ if (!kvm_read_all(kd, (unsigned long)ucred.cr_groups, groups + 1,
+ len - sizeof(gid_t))) {
warnx("can't read groups at %p for pid %d",
ucred.cr_groups, kp->ki_pid);
free(groups);
return (NULL);
}
- *cntp = ucred.cr_ngroups;
+ *cntp = ngroups;
return (groups);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 11:32 AM (16 h, 42 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41929431
Default Alt Text
D52275.1795433524.diff (973 B)
Attached To
Mode
D52275: libprocstat: procstat_getgroups_kvm(): Output again the effective GID
Attached
Detach File
Event Timeline