1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

uid_wrapper: Add uwrap_setregid().

This commit is contained in:
Andreas Schneider 2011-10-06 16:52:03 +02:00
parent c2b9e9b0ea
commit 17f1276fea
2 changed files with 17 additions and 0 deletions

View File

@ -104,6 +104,17 @@ _PUBLIC_ int uwrap_setegid(gid_t egid)
return 0;
}
_PUBLIC_ int uwrap_setregid(gid_t rgid, gid_t egid)
{
uwrap_init();
if (!uwrap.enabled) {
return setregid(rgid, egid);
}
/* assume for now that the ruid stays as root */
uwrap.egid = egid;
return 0;
}
_PUBLIC_ uid_t uwrap_getegid(void)
{
uwrap_init();

View File

@ -24,6 +24,7 @@ int uwrap_seteuid(uid_t euid);
int uwrap_setreuid(uid_t reuid, uid_t euid);
uid_t uwrap_geteuid(void);
int uwrap_setegid(gid_t egid);
int uwrap_setregid(gid_t egid);
uid_t uwrap_getegid(void);
int uwrap_setgroups(size_t size, const gid_t *list);
int uwrap_getgroups(int size, gid_t *list);
@ -45,6 +46,11 @@ gid_t uwrap_getgid(void);
#endif
#define setegid uwrap_setegid
#ifdef setregid
#undef setregid
#endif
#define setregid uwrap_setegid
#ifdef geteuid
#undef geteuid
#endif