FreeBSD Bugzilla – Attachment 184407 Details for
Bug 220779
getgroups result is affected by setegid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test case demonstrating the behaviour
u.c (text/x-csrc), 546 bytes, created by
Michael Zuo
on 2017-07-16 17:52:16 UTC
(
hide
)
Description:
test case demonstrating the behaviour
Filename:
MIME Type:
Creator:
Michael Zuo
Created:
2017-07-16 17:52:16 UTC
Size:
546 bytes
patch
obsolete
>#include <unistd.h> >#include <limits.h> >#include <stdio.h> >#include <err.h> > >int main(int argc, char **argv) { > gid_t gids[NGROUPS_MAX]; > int j, n = getgroups(NGROUPS_MAX, gids); > if (n == -1) > err(2, "getgroups"); > for (j = 0; j < n; j++) > printf("%d ", gids[j]); > printf("egid=%d\n", getegid()); > > if (setegid(getegid()+1) == -1) > err(3, "setegid"); > > n = getgroups(NGROUPS_MAX, gids); > if (n == -1) > err(2, "getgroups"); > for (j = 0; j < n; j++) > printf("%d ", gids[j]); > printf("egid=%d\n", getegid()); > > return gids[0] == getegid(); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 220779
: 184407