1 .\" $NetBSD: pwcache.3,v 1.17 2008/05/02 18:11:04 martin Exp $
4 .\" Copyright (c) 1989, 1991, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" 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.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
33 .\" All rights reserved.
35 .\" Redistribution and use in source and binary forms, with or without
36 .\" modification, are permitted provided that the following conditions
38 .\" 1. Redistributions of source code must retain the above copyright
39 .\" notice, this list of conditions and the following disclaimer.
40 .\" 2. Redistributions in binary form must reproduce the above copyright
41 .\" notice, this list of conditions and the following disclaimer in the
42 .\" documentation and/or other materials provided with the distribution.
44 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
45 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
46 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
48 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
49 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
50 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
51 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
52 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54 .\" POSSIBILITY OF SUCH DAMAGE.
57 .\" @(#)pwcache.3 8.1 (Berkeley) 6/9/93
66 .Nd cache password and group entries
72 .Fn user_from_uid "uid_t uid" "int nouser"
74 .Fn uid_from_user "const char *name" "uid_t *uid"
76 .Fn pwcache_userdb "int (*setpassent)(int)" "void (*endpwent)(void)" "struct passwd * (*getpwnam)(const char *)" "struct passwd * (*getpwuid)(uid_t)"
79 .Fn group_from_gid "gid_t gid" "int nogroup"
81 .Fn gid_from_group "const char *name" "gid_t *gid"
83 .Fn pwcache_groupdb "int (*setgroupent)(int)" "void (*endgrent)(void)" "struct group * (*getgrnam)(const char *)" "struct group * (*getgrgid)(gid_t)"
87 function returns the user name associated with the argument
89 The user name is cached so that multiple calls with the same
91 do not require additional calls to
93 If there is no user associated with the
96 to a string representation of the
100 is non-zero, in which case a
106 function returns the group name associated with the argument
108 The group name is cached so that multiple calls with the same
110 do not require additional calls to
112 If there is no group associated with the
114 a pointer is returned
115 to a string representation of the
119 is non-zero, in which case a
125 function returns the uid associated with the argument
127 The uid is cached so that multiple calls with the same
129 do not require additional calls to
131 If there is no uid associated with the
135 function returns \-1; otherwise it stores the uid at the location pointed to by
141 function returns the gid associated with the argument
143 The gid is cached so that multiple calls with the same
145 do not require additional calls to
147 If there is no gid associated with the
151 function returns \-1; otherwise it stores the gid at the location pointed to by
157 function changes the user database access routines which
161 call to search for users.
162 The caches are flushed and the existing
164 method is called before switching to the new routines.
168 must be provided, and
178 function changes the group database access routines which
182 call to search for groups.
183 The caches are flushed and the existing
185 method is called before switching to the new routines.
189 must be provided, and
206 functions first appeared in
213 functions first appeared in
220 functions first appeared in