Remove smb_np_struct
[Samba/gebeck_regimport.git] / lib / nss_wrapper / nss_wrapper.h
blob35a47348a83ef1a0e0b6e7afcb1c088c4eae3277
1 /*
2 * Copyright (C) Stefan Metzmacher 2007 <metze@samba.org>
4 * All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the author nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
34 #ifndef __NSS_WRAPPER_H__
35 #define __NSS_WRAPPER_H__
37 struct passwd *nwrap_getpwnam(const char *name);
38 int nwrap_getpwnam_r(const char *name, struct passwd *pwbuf,
39 char *buf, size_t buflen, struct passwd **pwbufp);
40 struct passwd *nwrap_getpwuid(uid_t uid);
41 int nwrap_getpwuid_r(uid_t uid, struct passwd *pwbuf,
42 char *buf, size_t buflen, struct passwd **pwbufp);
43 void nwrap_setpwent(void);
44 struct passwd *nwrap_getpwent(void);
45 int nwrap_getpwent_r(struct passwd *pwbuf, char *buf,
46 size_t buflen, struct passwd **pwbufp);
47 void nwrap_endpwent(void);
48 int nwrap_initgroups(const char *user, gid_t group);
49 struct group *nwrap_getgrnam(const char *name);
50 int nwrap_getgrnam_r(const char *name, struct group *gbuf,
51 char *buf, size_t buflen, struct group **gbufp);
52 struct group *nwrap_getgrgid(gid_t gid);
53 int nwrap_getgrgid_r(gid_t gid, struct group *gbuf,
54 char *buf, size_t buflen, struct group **gbufp);
55 void nwrap_setgrent(void);
56 struct group *nwrap_getgrent(void);
57 int nwrap_getgrent_r(struct group *gbuf, char *buf,
58 size_t buflen, struct group **gbufp);
59 void nwrap_endgrent(void);
61 #ifdef NSS_WRAPPER_REPLACE
63 #ifdef getpwnam
64 #undef getpwnam
65 #endif
66 #define getpwnam nwrap_getpwnam
68 #ifdef getpwnam_r
69 #undef getpwnam_r
70 #endif
71 #define getpwnam_r nwrap_getpwnam_r
73 #ifdef getpwuid
74 #undef getpwuid
75 #endif
76 #define getpwuid nwrap_getpwuid
78 #ifdef getpwuid_r
79 #undef getpwuid_r
80 #endif
81 #define getpwuid_r nwrap_getpwuid_r
83 #ifdef setpwent
84 #undef setpwent
85 #endif
86 #define setpwent nwrap_setpwent
88 #ifdef getpwent
89 #undef getpwent
90 #endif
91 #define getpwent nwrap_getpwent
93 #ifdef getpwent_r
94 #undef getpwent_r
95 #endif
96 #define getpwent_r nwrap_getpwent_r
98 #ifdef endpwent
99 #undef endpwent
100 #endif
101 #define endpwent nwrap_endpwent
103 #ifdef getgrlst
104 #undef getgrlst
105 #endif
106 #define getgrlst __none_nwrap_getgrlst
108 #ifdef getgrlst_r
109 #undef getgrlst_r
110 #endif
111 #define getgrlst_r __none_nwrap_getgrlst_r
113 #ifdef initgroups_dyn
114 #undef initgroups_dyn
115 #endif
116 #define initgroups_dyn __none_nwrap_initgroups_dyn
118 #ifdef initgroups
119 #undef initgroups
120 #endif
121 #define initgroups nwrap_initgroups
123 #ifdef getgrnam
124 #undef getgrnam
125 #endif
126 #define getgrnam nwrap_getgrnam
128 #ifdef getgrnam_r
129 #undef getgrnam_r
130 #endif
131 #define getgrnam_r nwrap_getgrnam_r
133 #ifdef getgrgid
134 #undef getgrgid
135 #endif
136 #define getgrgid nwrap_getgrgid
138 #ifdef getgrgid_r
139 #undef getgrgid_r
140 #endif
141 #define getgrgid_r nwrap_getgrgid_r
143 #ifdef setgrent
144 #undef setgrent
145 #endif
146 #define setgrent nwrap_setgrent
148 #ifdef getgrent
149 #undef getgrent
150 #endif
151 #define getgrent nwrap_getgrent
153 #ifdef getgrent_r
154 #undef getgrent_r
155 #endif
156 #define getgrent_r nwrap_getgrent_r
158 #ifdef endgrent
159 #undef endgrent
160 #endif
161 #define endgrent nwrap_endgrent
163 #endif /* NSS_WRAPPER_REPLACE */
165 #endif /* __NSS_WRAPPER_H__ */