Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
f671d6aa
Commit
f671d6aa
authored
Apr 18, 2002
by
Leigh B. Stoller
Browse files
Nasty kludge to deal with users in NGROUPS groups.
parent
9c2bbad8
Changes
1
Hide whitespace changes
Inline
Side-by-side
security/suexec.c
View file @
f671d6aa
...
...
@@ -442,15 +442,18 @@ int main(int argc, char *argv[])
ngroups
=
NGROUPS
;
getgrouplist
(
actual_uname
,
primary_gid
,
groups
,
&
ngroups
);
if
(
ngroups
==
NGROUPS
)
{
log_err
(
"emerg: failed to getgroups (%ld: %s)
\n
"
,
gid
,
cmd
);
exit
(
109
);
log_err
(
"crit: Too many groups (%ld: %s)
\n
"
,
gid
,
cmd
);
}
for
(
i
=
0
;
i
<
ngroups
;
i
++
)
{
if
(
groups
[
i
]
==
gid
)
break
;
}
if
(
i
==
ngroups
)
if
(
i
==
ngroups
)
{
/* Nasty! */
if
(
i
==
NGROUPS
)
ngroups
--
;
groups
[
ngroups
++
]
=
gid
;
}
if
(((
setgid
(
primary_gid
))
!=
0
)
||
(
setgroups
(
ngroups
,
groups
)
!=
0
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment