aboutsummaryrefslogtreecommitdiffstats
path: root/ports/linux/guts/setfsgid.c
blob: 81e916e462804a5ae52bea7454c35519c7b6522f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* 
 * Copyright (c) 2008-2010 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 * static int
 * wrap_setfsgid(gid_t fsgid) {
 *	int rc = -1;
 */
	if (pseudo_euid == 0 ||
	    pseudo_egid == fsgid || pseudo_rgid == fsgid || pseudo_sgid == fsgid) {
		pseudo_fgid = fsgid;
		rc = 0;
	} else {
		rc = -1;
		errno = EPERM;
	}
/*	return rc;
 * }
 */