| 1 | /*
|
|---|
| 2 | * Copyright (C) Stefan Metzmacher 2007 <[email protected]>
|
|---|
| 3 | *
|
|---|
| 4 | * All rights reserved.
|
|---|
| 5 | *
|
|---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | * modification, are permitted provided that the following conditions
|
|---|
| 8 | * are met:
|
|---|
| 9 | *
|
|---|
| 10 | * 1. Redistributions of source code must retain the above copyright
|
|---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | *
|
|---|
| 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.
|
|---|
| 16 | *
|
|---|
| 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.
|
|---|
| 20 | *
|
|---|
| 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.
|
|---|
| 32 | */
|
|---|
| 33 |
|
|---|
| 34 | #ifndef __NSS_WRAPPER_H__
|
|---|
| 35 | #define __NSS_WRAPPER_H__
|
|---|
| 36 |
|
|---|
| 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);
|
|---|
| 60 |
|
|---|
| 61 | #ifdef NSS_WRAPPER_REPLACE
|
|---|
| 62 |
|
|---|
| 63 | #ifdef getpwnam
|
|---|
| 64 | #undef getpwnam
|
|---|
| 65 | #endif
|
|---|
| 66 | #define getpwnam nwrap_getpwnam
|
|---|
| 67 |
|
|---|
| 68 | #ifdef getpwnam_r
|
|---|
| 69 | #undef getpwnam_r
|
|---|
| 70 | #endif
|
|---|
| 71 | #define getpwnam_r nwrap_getpwnam_r
|
|---|
| 72 |
|
|---|
| 73 | #ifdef getpwuid
|
|---|
| 74 | #undef getpwuid
|
|---|
| 75 | #endif
|
|---|
| 76 | #define getpwuid nwrap_getpwuid
|
|---|
| 77 |
|
|---|
| 78 | #ifdef getpwuid_r
|
|---|
| 79 | #undef getpwuid_r
|
|---|
| 80 | #endif
|
|---|
| 81 | #define getpwuid_r nwrap_getpwuid_r
|
|---|
| 82 |
|
|---|
| 83 | #ifdef setpwent
|
|---|
| 84 | #undef setpwent
|
|---|
| 85 | #endif
|
|---|
| 86 | #define setpwent nwrap_setpwent
|
|---|
| 87 |
|
|---|
| 88 | #ifdef getpwent
|
|---|
| 89 | #undef getpwent
|
|---|
| 90 | #endif
|
|---|
| 91 | #define getpwent nwrap_getpwent
|
|---|
| 92 |
|
|---|
| 93 | #ifdef getpwent_r
|
|---|
| 94 | #undef getpwent_r
|
|---|
| 95 | #endif
|
|---|
| 96 | #define getpwent_r nwrap_getpwent_r
|
|---|
| 97 |
|
|---|
| 98 | #ifdef endpwent
|
|---|
| 99 | #undef endpwent
|
|---|
| 100 | #endif
|
|---|
| 101 | #define endpwent nwrap_endpwent
|
|---|
| 102 |
|
|---|
| 103 | #ifdef getgrlst
|
|---|
| 104 | #undef getgrlst
|
|---|
| 105 | #endif
|
|---|
| 106 | #define getgrlst __none_nwrap_getgrlst
|
|---|
| 107 |
|
|---|
| 108 | #ifdef getgrlst_r
|
|---|
| 109 | #undef getgrlst_r
|
|---|
| 110 | #endif
|
|---|
| 111 | #define getgrlst_r __none_nwrap_getgrlst_r
|
|---|
| 112 |
|
|---|
| 113 | #ifdef initgroups_dyn
|
|---|
| 114 | #undef initgroups_dyn
|
|---|
| 115 | #endif
|
|---|
| 116 | #define initgroups_dyn __none_nwrap_initgroups_dyn
|
|---|
| 117 |
|
|---|
| 118 | #ifdef initgroups
|
|---|
| 119 | #undef initgroups
|
|---|
| 120 | #endif
|
|---|
| 121 | #define initgroups nwrap_initgroups
|
|---|
| 122 |
|
|---|
| 123 | #ifdef getgrnam
|
|---|
| 124 | #undef getgrnam
|
|---|
| 125 | #endif
|
|---|
| 126 | #define getgrnam nwrap_getgrnam
|
|---|
| 127 |
|
|---|
| 128 | #ifdef getgrnam_r
|
|---|
| 129 | #undef getgrnam_r
|
|---|
| 130 | #endif
|
|---|
| 131 | #define getgrnam_r nwrap_getgrnam_r
|
|---|
| 132 |
|
|---|
| 133 | #ifdef getgrgid
|
|---|
| 134 | #undef getgrgid
|
|---|
| 135 | #endif
|
|---|
| 136 | #define getgrgid nwrap_getgrgid
|
|---|
| 137 |
|
|---|
| 138 | #ifdef getgrgid_r
|
|---|
| 139 | #undef getgrgid_r
|
|---|
| 140 | #endif
|
|---|
| 141 | #define getgrgid_r nwrap_getgrgid_r
|
|---|
| 142 |
|
|---|
| 143 | #ifdef setgrent
|
|---|
| 144 | #undef setgrent
|
|---|
| 145 | #endif
|
|---|
| 146 | #define setgrent nwrap_setgrent
|
|---|
| 147 |
|
|---|
| 148 | #ifdef getgrent
|
|---|
| 149 | #undef getgrent
|
|---|
| 150 | #endif
|
|---|
| 151 | #define getgrent nwrap_getgrent
|
|---|
| 152 |
|
|---|
| 153 | #ifdef getgrent_r
|
|---|
| 154 | #undef getgrent_r
|
|---|
| 155 | #endif
|
|---|
| 156 | #define getgrent_r nwrap_getgrent_r
|
|---|
| 157 |
|
|---|
| 158 | #ifdef endgrent
|
|---|
| 159 | #undef endgrent
|
|---|
| 160 | #endif
|
|---|
| 161 | #define endgrent nwrap_endgrent
|
|---|
| 162 |
|
|---|
| 163 | #endif /* NSS_WRAPPER_REPLACE */
|
|---|
| 164 |
|
|---|
| 165 | #endif /* __NSS_WRAPPER_H__ */
|
|---|