]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - hesiod_getpwnam.3
stash a copy of the pre-3.1 packaging and source
[1ts-debian.git] / hesiod_getpwnam.3
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 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose.  It is provided "as is"
15 .\" without express or implied warranty.
16 .\"
17 .TH HESIOD 3 "30 November 1996"
18 .SH NAME
19 hesiod_getpwnam, hesiod_getpwuid, hesiod_free_passwd \- Hesiod functions for retrieving passwd information
20 .SH SYNOPSIS
21 .nf
22 .B #include <hesiod.h>
23 .PP
24 .B struct passwd *hesiod_getpwnam(void *\fIcontext\fP, const char *\fIname\fP)
25 .B struct passwd *hesiod_getpwuid(void *\fIcontext\fP, uid_t \fIuid\fP)
26 .B void hesiod_free_passwd(void *\fIcontext\fP, struct passwd *\fIpw\fP)
27 .PP
28 .B cc file.c \-lhesiod
29 .fi
30 .SH DESCRIPTION
31 This family of functions allows you to retrieve passwd database
32 information using Hesiod.  To perform lookups, you need an initialized
33 Hesiod context; see hesiod(3) for details.  You may look up passwd
34 information by name or by uid; information is returned in the same
35 format as by
36 .I getpwnam
37 or
38 .IR getpwuid .
39 It is the caller's responsibility to call
40 .I hesiod_free_passwd
41 with the returned passwd entry to free the resources used by the
42 passwd entry.
43 .PP
44 Hesiod queries for passwd information are made using the ``passwd'' or
45 ``uid'' Hesiod type, using either the username or the decimal
46 representation of the uid as the Hesiod name.  The corresponding
47 records should be a colon-separated list of fields giving the
48 username, encrypted password, uid, gid, GECOS information, home
49 directory, and shell of the user.
50 .SH RETURN VALUES
51 On failure,
52 .I hesiod_getpwnam
53 and
54 .I hesiod_getpwuid
55 return NULL and set the global variable
56 .I errno
57 to indicate the error.
58 .SH ERRORS
59 These calls may fail for any of the reasons the routine
60 .I hesiod_resolve
61 may fail.
62 .SH SEE ALSO
63 hesiod(3)