s4-netlogon: return WERR_NO_SUCH_DOMAIN instead of WERR_DS_UNAVAILABLE if we are...
[Samba/gebeck_regimport.git] / lib / uid_wrapper / uid_wrapper.h
blob680e5445833c4876a10d847feb12894f1dfb8cc5
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 uid_t uwrap_getegid(void);
31 int uwrap_setgroups(size_t size, const gid_t *list);
32 int uwrap_getgroups(int size, gid_t *list);
33 uid_t uwrap_getuid(void);
34 gid_t uwrap_getgid(void);
36 #ifdef UID_WRAPPER_REPLACE
38 #ifdef seteuid
39 #undef seteuid
40 #endif
41 #define seteuid uwrap_seteuid
43 #ifdef setreuid
44 #undef setreuid
45 #endif
46 #define setreuid uwrap_setreuid
48 #ifdef setresuid
49 #undef setresuid
50 #endif
51 #define setresuid uwrap_setresuid
53 #ifdef setegid
54 #undef setegid
55 #endif
56 #define setegid uwrap_setegid
58 #ifdef setregid
59 #undef setregid
60 #endif
61 #define setregid uwrap_setregid
63 #ifdef setresgid
64 #undef setresgid
65 #endif
66 #define setresgid uwrap_setresgid
68 #ifdef geteuid
69 #undef geteuid
70 #endif
71 #define geteuid uwrap_geteuid
73 #ifdef getegid
74 #undef getegid
75 #endif
76 #define getegid uwrap_getegid
78 #ifdef setgroups
79 #undef setgroups
80 #endif
81 #define setgroups uwrap_setgroups
83 #ifdef getgroups
84 #undef getgroups
85 #endif
86 #define getgroups uwrap_getgroups
88 #ifdef getuid
89 #undef getuid
90 #endif
91 #define getuid uwrap_getuid
93 #ifdef getgid
94 #undef getgid
95 #endif
96 #define getgid uwrap_getgid
98 #endif /* UID_WRAPPER_REPLACE */
99 #endif /* uwrap_enabled */
100 #endif /* __UID_WRAPPER_H__ */