uid_wrapper: Add uwrap_setreuid().
[nivanova/samba-autobuild/.git] / lib / uid_wrapper / uid_wrapper.h
1 /*
2    Copyright (C) Andrew Tridgell 2009
3  
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
8    
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13    
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef __UID_WRAPPER_H__
19 #define __UID_WRAPPER_H__
20 #ifndef uwrap_enabled
21
22 int uwrap_enabled(void);
23 int uwrap_seteuid(uid_t euid);
24 int uwrap_setreuid(uid_t reuid, uid_t euid);
25 uid_t uwrap_geteuid(void);
26 int uwrap_setegid(gid_t egid);
27 uid_t uwrap_getegid(void);
28 int uwrap_setgroups(size_t size, const gid_t *list);
29 int uwrap_getgroups(int size, gid_t *list);
30 uid_t uwrap_getuid(void);
31 gid_t uwrap_getgid(void);
32
33 #ifdef seteuid
34 #undef seteuid
35 #endif
36 #define seteuid uwrap_seteuid
37
38 #ifdef setreuid
39 #undef setreuid
40 #endif
41 #define setreuid        uwrap_setreuid
42
43 #ifdef setegid
44 #undef setegid
45 #endif
46 #define setegid uwrap_setegid
47
48 #ifdef geteuid
49 #undef geteuid
50 #endif
51 #define geteuid uwrap_geteuid
52
53 #ifdef getegid
54 #undef getegid
55 #endif
56 #define getegid uwrap_getegid
57
58 #ifdef setgroups
59 #undef setgroups
60 #endif
61 #define setgroups uwrap_setgroups
62
63 #ifdef getgroups
64 #undef getgroups
65 #endif
66 #define getgroups uwrap_getgroups
67
68 #ifdef getuid
69 #undef getuid
70 #endif
71 #define getuid  uwrap_getuid
72
73 #ifdef getgid
74 #undef getgid
75 #endif
76 #define getgid  uwrap_getgid
77
78 #endif
79 #endif /* __UID_WRAPPER_H__ */