2 * Copyright (C) Stefan Metzmacher 2007 <metze@samba.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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
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
66 #define getpwnam nwrap_getpwnam
71 #define getpwnam_r nwrap_getpwnam_r
76 #define getpwuid nwrap_getpwuid
81 #define getpwuid_r nwrap_getpwuid_r
86 #define setpwent nwrap_setpwent
91 #define getpwent nwrap_getpwent
96 #define getpwent_r nwrap_getpwent_r
101 #define endpwent nwrap_endpwent
106 #define getgrlst __none_nwrap_getgrlst
111 #define getgrlst_r __none_nwrap_getgrlst_r
113 #ifdef initgroups_dyn
114 #undef initgroups_dyn
116 #define initgroups_dyn __none_nwrap_initgroups_dyn
121 #define initgroups nwrap_initgroups
126 #define getgrnam nwrap_getgrnam
131 #define getgrnam_r nwrap_getgrnam_r
136 #define getgrgid nwrap_getgrgid
141 #define getgrgid_r nwrap_getgrgid_r
146 #define setgrent nwrap_setgrent
151 #define getgrent nwrap_getgrent
156 #define getgrent_r nwrap_getgrent_r
161 #define endgrent nwrap_endgrent
163 #endif /* NSS_WRAPPER_REPLACE */
165 #endif /* __NSS_WRAPPER_H__ */