smbd: Fix CID 1035536 Uninitialized pointer read
[Samba.git] / lib / uid_wrapper / uid_wrapper.h
blob21d0795d41089613f80271aec5f22973cabfd2f8
1 /*
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__
21 #ifndef uwrap_enabled
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
39 #ifdef samba_seteuid
40 #undef samba_seteuid
41 #endif
42 #define samba_seteuid uwrap_seteuid
44 #ifdef samba_setreuid
45 #undef samba_setreuid
46 #endif
47 #define samba_setreuid uwrap_setreuid
49 #ifdef samba_setresuid
50 #undef samba_setresuid
51 #endif
52 #define samba_setresuid uwrap_setresuid
54 #ifdef samba_setegid
55 #undef samba_setegid
56 #endif
57 #define samba_setegid uwrap_setegid
59 #ifdef samba_setregid
60 #undef samba_setregid
61 #endif
62 #define samba_setregid uwrap_setregid
64 #ifdef samba_setresgid
65 #undef samba_setresgid
66 #endif
67 #define samba_setresgid uwrap_setresgid
69 #ifdef geteuid
70 #undef geteuid
71 #endif
72 #define geteuid uwrap_geteuid
74 #ifdef getegid
75 #undef getegid
76 #endif
77 #define getegid uwrap_getegid
79 #ifdef samba_setgroups
80 #undef samba_setgroups
81 #endif
82 #define samba_setgroups uwrap_setgroups
84 #ifdef getgroups
85 #undef getgroups
86 #endif
87 #define getgroups uwrap_getgroups
89 #ifdef getuid
90 #undef getuid
91 #endif
92 #define getuid uwrap_getuid
94 #ifdef getgid
95 #undef getgid
96 #endif
97 #define getgid uwrap_getgid
99 #endif /* UID_WRAPPER_REPLACE */
100 #endif /* uwrap_enabled */
101 #endif /* __UID_WRAPPER_H__ */