diff options
Diffstat (limited to 'ports/uids_generic/guts/setregid.c')
-rw-r--r-- | ports/uids_generic/guts/setregid.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ports/uids_generic/guts/setregid.c b/ports/uids_generic/guts/setregid.c new file mode 100644 index 0000000..78b2037 --- /dev/null +++ b/ports/uids_generic/guts/setregid.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008-2010 Wind River Systems; see + * guts/COPYRIGHT for information. + * + * static int + * wrap_setregid(gid_t rgid, gid_t egid) { + * int rc = -1; + */ + rc = 0; + if (pseudo_euid != 0 && rgid != (gid_t) -1 && + rgid != pseudo_egid && rgid != pseudo_rgid && rgid != pseudo_sgid) { + rc = -1; + errno = EPERM; + } + if (pseudo_euid != 0 && egid != (gid_t) -1 && + egid != pseudo_egid && egid != pseudo_rgid && egid != pseudo_sgid) { + rc = -1; + errno = EPERM; + } + if (rc != -1) { + if (rgid != (gid_t) -1) + pseudo_rgid = rgid; + if (egid != (gid_t) -1) + pseudo_egid = egid; + pseudo_fgid = pseudo_egid; + pseudo_client_touchuid(); + } +/* return rc; + * } + */ |