mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
uid_wrapper: Add uwrap_setreuid().
This commit is contained in:
@ -73,6 +73,17 @@ _PUBLIC_ int uwrap_seteuid(uid_t euid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
_PUBLIC_ int uwrap_setreuid(uid_t ruid, uid_t euid)
|
||||
{
|
||||
uwrap_init();
|
||||
if (!uwrap.enabled) {
|
||||
return setreuid(ruid, euid);
|
||||
}
|
||||
/* assume for now that the ruid stays as root */
|
||||
uwrap.euid = euid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_PUBLIC_ uid_t uwrap_geteuid(void)
|
||||
{
|
||||
uwrap_init();
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
int uwrap_enabled(void);
|
||||
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);
|
||||
uid_t uwrap_getegid(void);
|
||||
@ -34,6 +35,11 @@ gid_t uwrap_getgid(void);
|
||||
#endif
|
||||
#define seteuid uwrap_seteuid
|
||||
|
||||
#ifdef setreuid
|
||||
#undef setreuid
|
||||
#endif
|
||||
#define setreuid uwrap_setreuid
|
||||
|
||||
#ifdef setegid
|
||||
#undef setegid
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user