blob: fb8d693b36fc563f641187a70c1aff33b912ecd3 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{pwd} ---
Fred Drakef6863c11999-03-02 16:37:17 +00002 The password database}
3
Fred Drakeb91e9341998-07-23 17:59:49 +00004\declaremodule{builtin}{pwd}
Fred Drakea54a8871999-03-02 17:03:42 +00005 \platform{Unix}
Fred Drakeb91e9341998-07-23 17:59:49 +00006\modulesynopsis{The password database (\function{getpwnam()} and friends).}
7
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00008This module provides access to the \UNIX{} password database.
9It is available on all \UNIX{} versions.
10
11Password database entries are reported as 7-tuples containing the
Fred Drakea5aefba1998-08-14 17:05:17 +000012following items from the password database (see \code{<pwd.h>}), in order:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000013\code{pw_name},
14\code{pw_passwd},
15\code{pw_uid},
16\code{pw_gid},
17\code{pw_gecos},
18\code{pw_dir},
19\code{pw_shell}.
20The uid and gid items are integers, all others are strings.
Fred Drakef6863c11999-03-02 16:37:17 +000021\exception{KeyError} is raised if the entry asked for cannot be found.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000022
23It defines the following items:
24
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000025\begin{funcdesc}{getpwuid}{uid}
26Return the password database entry for the given numeric user ID.
27\end{funcdesc}
28
29\begin{funcdesc}{getpwnam}{name}
30Return the password database entry for the given user name.
31\end{funcdesc}
32
33\begin{funcdesc}{getpwall}{}
34Return a list of all available password database entries, in arbitrary order.
35\end{funcdesc}