1998-04-04 07:23:21 +00:00
|
|
|
\section{Built-in Module \module{pwd}}
|
1997-07-17 16:34:52 +00:00
|
|
|
\label{module-pwd}
|
1994-01-02 01:22:07 +00:00
|
|
|
|
|
|
|
\bimodindex{pwd}
|
|
|
|
This module provides access to the \UNIX{} password database.
|
|
|
|
It is available on all \UNIX{} versions.
|
|
|
|
|
|
|
|
Password database entries are reported as 7-tuples containing the
|
|
|
|
following items from the password database (see \file{<pwd.h>}), in order:
|
|
|
|
\code{pw_name},
|
|
|
|
\code{pw_passwd},
|
|
|
|
\code{pw_uid},
|
|
|
|
\code{pw_gid},
|
|
|
|
\code{pw_gecos},
|
|
|
|
\code{pw_dir},
|
|
|
|
\code{pw_shell}.
|
|
|
|
The uid and gid items are integers, all others are strings.
|
1997-12-30 20:38:16 +00:00
|
|
|
A \code{KeyError} exception is raised if the entry asked for cannot be found.
|
1994-01-02 01:22:07 +00:00
|
|
|
|
|
|
|
It defines the following items:
|
|
|
|
|
|
|
|
\begin{funcdesc}{getpwuid}{uid}
|
|
|
|
Return the password database entry for the given numeric user ID.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{getpwnam}{name}
|
|
|
|
Return the password database entry for the given user name.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{getpwall}{}
|
|
|
|
Return a list of all available password database entries, in arbitrary order.
|
|
|
|
\end{funcdesc}
|