blob: 32113b4f04a790ecfbf350d9ff7b2e736999c848 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{pwd}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule{builtin}{pwd}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003
Fred Drakeb91e9341998-07-23 17:59:49 +00004
5\modulesynopsis{The password database (\function{getpwnam()} and friends).}
6
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00007This module provides access to the \UNIX{} password database.
8It is available on all \UNIX{} versions.
9
10Password database entries are reported as 7-tuples containing the
11following items from the password database (see \file{<pwd.h>}), in order:
12\code{pw_name},
13\code{pw_passwd},
14\code{pw_uid},
15\code{pw_gid},
16\code{pw_gecos},
17\code{pw_dir},
18\code{pw_shell}.
19The uid and gid items are integers, all others are strings.
Guido van Rossumeb0f0661997-12-30 20:38:16 +000020A \code{KeyError} exception is raised if the entry asked for cannot be found.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000021
22It defines the following items:
23
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000024\begin{funcdesc}{getpwuid}{uid}
25Return the password database entry for the given numeric user ID.
26\end{funcdesc}
27
28\begin{funcdesc}{getpwnam}{name}
29Return the password database entry for the given user name.
30\end{funcdesc}
31
32\begin{funcdesc}{getpwall}{}
33Return a list of all available password database entries, in arbitrary order.
34\end{funcdesc}