Debian Codegraph @

man/hesiod_getpwnam.3

raw
1 .\" $Id: hesiod_getpwnam.3,v 1.1 1996-12-08 21:38:24 ghudson Exp $
2 .\"
3 .\" Copyright 1996 by the Massachusetts Institute of Technology.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" * Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\"
12 .\" * Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in
14 .\" the documentation and/or other materials provided with the
15 .\" distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 .\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .TH HESIOD 3 "30 November 1996"
31 .SH NAME
32 hesiod_getpwnam, hesiod_getpwuid, hesiod_free_passwd \- Hesiod functions for retrieving passwd information
33 .SH SYNOPSIS
34 .nf
35 .B #include <hesiod.h>
36 .PP
37 .B struct passwd *hesiod_getpwnam(void *\fIcontext\fP, const char *\fIname\fP)
38 .B struct passwd *hesiod_getpwuid(void *\fIcontext\fP, uid_t \fIuid\fP)
39 .B void hesiod_free_passwd(void *\fIcontext\fP, struct passwd *\fIpw\fP)
40 .PP
41 .B cc file.c \-lhesiod
42 .fi
43 .SH DESCRIPTION
44 This family of functions allows you to retrieve passwd database
45 information using Hesiod. To perform lookups, you need an initialized
46 Hesiod context; see hesiod(3) for details. You may look up passwd
47 information by name or by uid; information is returned in the same
48 format as by
49 .I getpwnam
50 or
51 .IR getpwuid .
52 It is the caller's responsibility to call
53 .I hesiod_free_passwd
54 with the returned passwd entry to free the resources used by the
55 passwd entry.
56 .PP
57 Hesiod queries for passwd information are made using the ``passwd'' or
58 ``uid'' Hesiod type, using either the username or the decimal
59 representation of the uid as the Hesiod name. The corresponding
60 records should be a colon-separated list of fields giving the
61 username, encrypted password, uid, gid, GECOS information, home
62 directory, and shell of the user.
63 .SH RETURN VALUES
64 On failure,
65 .I hesiod_getpwnam
66 and
67 .I hesiod_getpwuid
68 return NULL and set the global variable
69 .I errno
70 to indicate the error.
71 .SH ERRORS
72 These calls may fail for any of the reasons the routine
73 .I hesiod_resolve
74 may fail.
75 .SH SEE ALSO
76 hesiod(3)