Move setting of ioready 'wait' earlier in call chain, to
[python/dscho.git] / Doc / lib / libpwd.tex
blob1e7a1c8a60adec6bd5f35018bd0eaa7bccceb6e1
1 \section{\module{pwd} ---
2 The password database}
4 \declaremodule{builtin}{pwd}
5 \platform{Unix}
6 \modulesynopsis{The password database (\function{getpwnam()} and friends).}
8 This module provides access to the \UNIX{} user account and password
9 database. It is available on all \UNIX{} versions.
11 Password database entries are reported as a tuple-like object, whose
12 attributes correspond to the members of the \code{passwd} structure
13 (Attribute field below, see \code{<pwd.h>}):
15 \begin{tableiii}{r|l|l}{textrm}{Index}{Attribute}{Meaning}
16 \lineiii{0}{\code{pw_name}}{Login name}
17 \lineiii{1}{\code{pw_passwd}}{Optional encrypted password}
18 \lineiii{2}{\code{pw_uid}}{Numerical user ID}
19 \lineiii{3}{\code{pw_gid}}{Numerical group ID}
20 \lineiii{4}{\code{pw_gecos}}{User name or comment field}
21 \lineiii{5}{\code{pw_dir}}{User home directory}
22 \lineiii{6}{\code{pw_shell}}{User command interpreter}
23 \end{tableiii}
25 The uid and gid items are integers, all others are strings.
26 \exception{KeyError} is raised if the entry asked for cannot be found.
28 \note{In traditional \UNIX{} the field \code{pw_passwd} usually
29 contains a password encrypted with a DES derived algorithm (see module
30 \refmodule{crypt}\refbimodindex{crypt}). However most modern unices
31 use a so-called \emph{shadow password} system. On those unices the
32 field \code{pw_passwd} only contains a asterisk (\code{'*'}) or the
33 letter \character{x} where the encrypted password is stored in a file
34 \file{/etc/shadow} which is not world readable.}
36 It defines the following items:
38 \begin{funcdesc}{getpwuid}{uid}
39 Return the password database entry for the given numeric user ID.
40 \end{funcdesc}
42 \begin{funcdesc}{getpwnam}{name}
43 Return the password database entry for the given user name.
44 \end{funcdesc}
46 \begin{funcdesc}{getpwall}{}
47 Return a list of all available password database entries, in arbitrary order.
48 \end{funcdesc}
51 \begin{seealso}
52 \seemodule{grp}{An interface to the group database, similar to this.}
53 \end{seealso}