2 Copyright (C) Andrew Tridgell 2009
3 Copyright (c) 2011 Andreas Schneider <asn@samba.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef __UID_WRAPPER_H__
20 #define __UID_WRAPPER_H__
23 int uwrap_enabled(void);
24 int uwrap_seteuid(uid_t euid
);
25 int uwrap_setreuid(uid_t reuid
, uid_t euid
);
26 int uwrap_setresuid(uid_t reuid
, uid_t euid
, uid_t suid
);
27 uid_t
uwrap_geteuid(void);
28 int uwrap_setegid(gid_t egid
);
29 int uwrap_setregid(gid_t rgid
, gid_t egid
);
30 int uwrap_setresgid(gid_t regid
, gid_t egid
, gid_t sgid
);
31 uid_t
uwrap_getegid(void);
32 int uwrap_setgroups(size_t size
, const gid_t
*list
);
33 int uwrap_getgroups(int size
, gid_t
*list
);
34 uid_t
uwrap_getuid(void);
35 gid_t
uwrap_getgid(void);
37 #ifdef UID_WRAPPER_REPLACE
42 #define samba_seteuid uwrap_seteuid
47 #define samba_setreuid uwrap_setreuid
49 #ifdef samba_setresuid
50 #undef samba_setresuid
52 #define samba_setresuid uwrap_setresuid
57 #define samba_setegid uwrap_setegid
62 #define samba_setregid uwrap_setregid
64 #ifdef samba_setresgid
65 #undef samba_setresgid
67 #define samba_setresgid uwrap_setresgid
72 #define geteuid uwrap_geteuid
77 #define getegid uwrap_getegid
79 #ifdef samba_setgroups
80 #undef samba_setgroups
82 #define samba_setgroups uwrap_setgroups
87 #define getgroups uwrap_getgroups
92 #define getuid uwrap_getuid
97 #define getgid uwrap_getgid
99 #endif /* UID_WRAPPER_REPLACE */
100 #endif /* uwrap_enabled */
101 #endif /* __UID_WRAPPER_H__ */