blob: a3ad2ef59cb41ba760a08117ea292f006ac6226d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
$NetBSD: patch-af,v 1.2 2009/02/11 17:59:32 drochner Exp $
--- ./jcc.c.orig 2008-06-27 13:13:56.000000000 +0200
+++ ./jcc.c
@@ -3349,6 +3349,17 @@ int main(int argc, const char *argv[])
{
log_error(LOG_LEVEL_FATAL, "Cannot setgid(): Insufficient permissions.");
}
+ if (NULL != grp)
+ {
+ if (setgroups(1, &grp->gr_gid))
+ {
+ log_error(LOG_LEVEL_FATAL, "setgroups() failed: %E");
+ }
+ }
+ else if (initgroups(pw->pw_name, pw->pw_gid))
+ {
+ log_error(LOG_LEVEL_FATAL, "initgroups() failed: %E");
+ }
if (do_chroot)
{
if (!pw->pw_dir)
|